Skip to content

Readd manifest artifact backwards compatibility#2381

Merged
gerrod3 merged 4 commits into
pulp:2.26from
gerrod3:ff
Jun 2, 2026
Merged

Readd manifest artifact backwards compatibility#2381
gerrod3 merged 4 commits into
pulp:2.26from
gerrod3:ff

Conversation

@gerrod3
Copy link
Copy Markdown
Contributor

@gerrod3 gerrod3 commented Jun 2, 2026

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

await tf.flush()
manifest_path = tf.name
if not manifest.data:
# TODO: BACKWARD COMPATIBILITY - remove after fully migrating to artifactless manifest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Fully migrating" at this point should include making the manifest.data field not null, so the migration actually fails if it's not yet done.

Copy link
Copy Markdown
Contributor

@dralley dralley Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mdellweg
mdellweg previously approved these changes Jun 2, 2026
Copy link
Copy Markdown
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this adds the compatibility code back to 2.26 specifically.
Should we still make the sync autorepair in main?

@gerrod3
Copy link
Copy Markdown
Contributor Author

gerrod3 commented Jun 2, 2026

So this adds the compatibility code back to 2.26 specifically. Should we still make the sync autorepair in main?

Yes, I think we maybe also want to autorepair on this PR. This just enables the old behavior, but at the end it still requires the user to run management command to fully transition to our new field. It might make sense to just run the data migration for each manifest missing the .data field during the sync, of course it won't catch all the manifests in the system.

@dralley
Copy link
Copy Markdown
Contributor

dralley commented Jun 2, 2026

Do we want this in the "official" 2.26 branch? Will it negatively impact any other consumers?

Should we backport to any other branches for consistency?

self.style.WARNING("Found %d broken manifests. PKs:" % len(self._broken_manifests))
)
for manifest in self._broken_manifests:
self.stdout.write(self.style.WARNING(" %s" % manifest.pk))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth also printing the manifest digest and/or any other metadata about them (e.g. associated images)?

Maybe which repository they are in, if any, or whether it's an orphan?

)
if manifest.data is None:
manifest.data = raw_text_data
await manifest.asave(update_fields=["data"])
Copy link
Copy Markdown
Contributor

@dralley dralley Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider this a low risk compare to the existing issues, but in theory since we are mutating content, it could potentially deadlock between two parallel syncs.

Not a blocker, just a note.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well hopefully after running the command, this piece won't be executed often. Also since manifests are per image and each image gets its own repo, it's unlikely to have parallel syncs of the same two images going at the same time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

# if artifact is not available (due to reclaim space) we will download it again
else:
content_data, manifest = await self._download_and_instantiate_manifest(
content_data, new_manifest = await self._download_and_instantiate_manifest(
Copy link
Copy Markdown
Contributor

@dralley dralley Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So before, we were taking the returned manifest value directly (which AFAICT is an unsaved model object) and throwing away the previous saved manifest. Presumably later on the QueryExistingContents stage would swap the model back, unless it's actually meaningfully different. And so substantively it's only doing a download of content_data

And in the new version, we are taking an existing manifest from above, overwriting the data field, and then re-saving. And so it's still mostly about the download, but instead of the manifest getting swapped with the original later we're just updating the original now and passing it along.

Right? This is subtle, not sure if I have it correct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's right, we don't have the artifact so we need to download the data and update the manifest.

dralley
dralley previously approved these changes Jun 2, 2026
@gerrod3 gerrod3 enabled auto-merge (rebase) June 2, 2026 17:50
@gerrod3 gerrod3 merged commit e017f5d into pulp:2.26 Jun 2, 2026
24 of 27 checks passed
@gerrod3 gerrod3 deleted the ff branch June 2, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants