Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo depot: add generation numbers for the desired TUF repo state #7399

Open
iliana opened this issue Jan 24, 2025 · 0 comments
Open

repo depot: add generation numbers for the desired TUF repo state #7399

iliana opened this issue Jan 24, 2025 · 0 comments
Assignees

Comments

@iliana
Copy link
Contributor

iliana commented Jan 24, 2025

Currently the TUF artifact replication task checks the desired state of tasks in the database, then does a bunch of work. If an operator uploads or deletes a TUF repo from the system while a task is running, undesirable operations might take place.

It's unclear how real this risk is; see discussion at #7129 (comment). But without writing some sort of proof that undesirable operation will not occur, we should assume it will.

The planned solution here is to add a single-row table to store a generation number for the current state of the tuf_repo table. When a repository is added or removed, the generation number will be incremented. These steps then change:

  • Sled Agent stores a generation number on the "update" dataset on the M.2 devices, where artifacts are stored.
  • Before Nexus fetches the artifact list from the database, it fetches the generation number from the database.
  • Sled Agent includes the highest generation number it's aware of in "list artifacts" responses. If this generation number is higher than the one Nexus is aware of, task execution terminates early. (Unclear if this step is necessary.)
  • Put/copy/delete requests include the generation number Nexus is aware of. During each request Sled Agent checks the generation numbers on disk; if any are higher than the one provided by Nexus, it responds with 409 Conflict. If the number provided by Nexus is higher, that generation number is written to disk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant