Issue #2791
closedRsync publish includes units which have not yet been published via the predistributor
Description
Two specific special cases will cause units to be included in a publish which are not meant to be - units which have not been published via the predistributor.
1. Deleting a unit will cause a full republish of all units, including units which have not yet been published by the yum predistributor
dnf download cowsay
phttp POST https://localhost/pulp/api/v2/repositories/zoo/distributors/ < rsync_distributor.json
pulp-admin rpm repo sync run --repo-id zoo
phttp POST https://localhost/pulp/api/v2/repositories/zoo/actions/publish/ id=yum_distributor
phttp POST https://localhost/pulp/api/v2/repositories/zoo/actions/publish/ id=my_rpm_rsync_distributor
pulp-admin rpm repo remove rpm --repo-id zoo --str-eq 'filename=kangaroo-0.2-1.noarch.rpm'
phttp POST https://localhost/pulp/api/v2/repositories/zoo/actions/publish/ id=yum_distributor
pulp-admin rpm repo uploads rpm --repo-id zoo --file cowsay-3.04-4.fc25.noarch.rpm
phttp POST https://localhost/pulp/api/v2/repositories/zoo/actions/publish/ id=my_rpm_rsync_distributor
Result: cowsay RPM is published via rsync despite not having been published by the yum predistributor
2. On the very first rsync publish, if a predistributor publish has occurred it will do a full publish of all units, including those not yet published via the yum predistributor
dnf download cowsay
phttp POST https://localhost/pulp/api/v2/repositories/zoo/distributors/ < rsync_distributor.json
phttp POST https://localhost/pulp/api/v2/repositories/zoo/actions/publish/ id=yum_distributor
pulp-admin rpm repo uploads rpm --repo-id zoo --file cowsay-3.04-4.fc25.noarch.rpm
phttp POST https://localhost/pulp/api/v2/repositories/zoo/actions/publish/ id=my_rpm_rsync_distributor
Result: cowsay RPM is published via rsync despite not having been published by the yum predistributor
The culprit is this code in pulp/server/plugins/rsync/publish.py:
.....
.....
.....
if self.is_fastforward():
start_date = self.last_published
end_date = None
if self.predistributor:
end_date = self.predistributor["last_publish"]
date_filter = self.create_date_range_filter(start_date=start_date, end_date=end_date)
else:
date_filter = None
.....
.....
.....
def is_fastforward(self):
....
....
....
return last_published and ((last_deleted and last_published > last_deleted) or not last_deleted) and not force_full and not delete
If it is the first publish or if a unit has been or is being deleted, is_fastforward() resolves to False, and the date filter is set to "None". Therefore, it is not respecting the date of the predistributor publish.
Updated by dalley almost 6 years ago
- Status changed from ASSIGNED to POST
Updated by dalley almost 6 years ago
- Description updated (diff)
- Groomed changed from No to Yes
Added by dalley over 5 years ago
Updated by dalley over 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|82651e04a3ea2308a6c6a38a70128abe058a6f05.
Added by dalley over 5 years ago
Fix rsync publishing units it shouldn't
Fixes an issue with rsync logic where some units which have not yet been published by the predistributor are included with rsync publishes.
closes #2791 https://pulp.plan.io/issues/2791
(cherry picked from commit 82651e04a3ea2308a6c6a38a70128abe058a6f05)
Updated by dalley over 5 years ago
Applied in changeset pulp|a9c6d55b1a79d648ab779f40d8cc43e0b418fed9.
Updated by pcreech over 5 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Fix rsync publishing units it shouldn't
Fixes an issue with rsync logic where some units which have not yet been published by the predistributor are included with rsync publishes.
closes #2791 https://pulp.plan.io/issues/2791