@@ -174,12 +174,10 @@ def distribution_extra_fields(self, repository, upstream_distribution):
174174 """
175175 Return the fields that need to be updated/cleared on distributions for idempotence.
176176
177- Note: repository_version is NOT included here. It is set atomically in
178- finalize_replication after all syncs complete.
177+ Note: repository, publication, and repository_version are NOT included here.
178+ They are all updated atomically in finalize_replication after all syncs complete.
179179 """
180180 return {
181- "repository" : None ,
182- "publication" : None ,
183181 "base_path" : upstream_distribution ["base_path" ],
184182 }
185183
@@ -192,8 +190,6 @@ def create_or_update_distribution(self, repository, upstream_distribution):
192190 )
193191 if not self ._is_managed (distro ):
194192 return None
195- # Clear repository and publication so they don't conflict when
196- # finalize_replication sets repository_version atomically.
197193 needs_update = self .needs_update (distribution_data , distro )
198194 if needs_update :
199195 dispatch (
@@ -208,13 +204,8 @@ def create_or_update_distribution(self, repository, upstream_distribution):
208204 },
209205 )
210206 except self .distribution_model_cls .DoesNotExist :
211- # Don't set repository or publication for new distributions —
212- # repository_version will be set in finalize_replication after sync completes.
213- create_data = {
214- k : v for k , v in distribution_data .items () if k not in ("repository" , "publication" )
215- }
207+ create_data = dict (distribution_data )
216208 create_data ["name" ] = upstream_distribution ["name" ]
217- create_data ["pulp_labels" ] = distribution_data ["pulp_labels" ]
218209 dispatch (
219210 general_create ,
220211 task_group = self .task_group ,
0 commit comments