Optimize sync and last_sync_details in pulp_rpm

Right now pulp_rpm stores last_sync_details on repositories for the sake of the optimize sync. We are currently implementing an analogous feature for pulp_deb. @x9c4 has suggested we might store this information on each repo version instead.

The advantages are that this information would then be immutable and also available for other purposes like debugging/understanding old repo versions. At least in the pulp_deb case, I also think there could be cases where the last sync did one thing, but the newest repo version was not created by that last sync but rather a modify action, which then necessitates a different optimize behaviour/invalidates the last_sync_details. How is this solved for pulp_rpm?

So my question is: How does pulp_rpm feel about this proposal? Is it something that might also make sense for pulp_rpm? Does it matter if pulp_deb and pulp_rpm choose differing implementations here? The API interface for triggering optimized syncs would be identical for both plugins either way.


I believe you would need to subclass the repoversion model and i don’t think we have a precedence to that. Or we’d have to add this change to pulpcore directly which is a separate discussion whether it makes sense for the rest of plugins.

I believe this particular case is solved like this https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/tasks/synchronizing.py#L338

It should be fine.