-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip syncing when replicated distributions were not updated
closes #5493
- Loading branch information
Showing
10 changed files
with
367 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Optimized replication to skip syncing when upstream distributions are unchanged. This uses the new | ||
`content_last_updated` field on the distribution serializer to track content source timestamps. |
37 changes: 37 additions & 0 deletions
37
pulpcore/app/migrations/0122_record_timestamps_for_replicated_distributions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by Django 4.2.11 on 2024-08-06 19:27 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django_lifecycle.mixins | ||
import pulpcore.app.models.base | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0121_add_profile_artifacts_table'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='LastUpdatedRecord', | ||
fields=[ | ||
('pulp_id', models.UUIDField(default=pulpcore.app.models.base.pulp_uuid, editable=False, primary_key=True, serialize=False)), | ||
('pulp_created', models.DateTimeField(auto_now_add=True)), | ||
('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)), | ||
('content_last_updated', models.DateTimeField()), | ||
('last_replication', models.DateTimeField()), | ||
('distribution', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.distribution')), | ||
('upstream_pulp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.upstreampulp')), | ||
], | ||
options={ | ||
'unique_together': {('distribution', 'upstream_pulp')}, | ||
}, | ||
bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model), | ||
), | ||
migrations.AddField( | ||
model_name='upstreampulp', | ||
name='last_updated_timestamps', | ||
field=models.ManyToManyField(through='core.LastUpdatedRecord', to='core.distribution'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.