-
Notifications
You must be signed in to change notification settings - Fork 1
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
Staged Update #79
base: main
Are you sure you want to change the base?
Staged Update #79
Conversation
485ccfb
to
1bd935c
Compare
/cc @airhorns |
if isStaged { | ||
batch.Queue(` | ||
INSERT INTO dl.staged_objects (project, start_version, stop_version, path, hash, mode, size, packed) | ||
VALUES ($1, NULL, $2, $3, NULL, NULL, NULL, NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is setting start_version as NULL a pattern used to distinguish the fact that its staged? I see this here and in DeleteObject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
The main, fairly conservative, decision that I took was to only allow you to commit a version if no updates have happened since you staged it.
I like using this strategy at first -- let's see if we can get away with it.
@scott-rc @MikePresman we've decided to pause this feature as Kyle is working on an alternative that would not require this. You can avoid spending time reviewing this for now. |
Adds the ability to stage an update and then commit it at a later point in time.
You call the existing
Update
endpoint with a new flag, this should be backwards compatible because the flag will default tofalse
, and then instead of writing toobjects
the rows will be written todl.staged_objects
.You can then follow up with a call to a new RPC endpoint
Commit
which will actually make that version the current version for your project.The main, fairly conservative, decision that I took was to only allow you to commit a version if no updates have happened since you staged it.
This means if you:
I think this makes it much easier to reason about, but it could be problematic in practice where multiple systems are trying to update a project at once.
Remaining TODOs:
Add testsEnsure that the GC can't delete objects that are currently staged