Repository navigation
fix(postgres): order a PutItem that loses a create race after the winner #388
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bc6a392
test: race PutItem calls that create the same item
yesyayen 6f08081
fix(postgres): order a put that loses a create race after the winner
yesyayen d1d883f
test: check index and stream contents after racing puts
yesyayen 3b73953
test: cover a put whose create race winner is deleted
yesyayen cebbba0
docs: say how a write to a missing item resolves a create race
yesyayen 1d38037
test: run the create race gate tests on a range table too
yesyayen a31108e
test: say that four create race tests delete the winner
yesyayen f5515a3
test: expect the plain-table create races to fail on MongoDB for now
yesyayen 18348d5
fix(postgres): make the create race give-up message true in every case
yesyayen faa624c
test: race a put against a create on an LSI and stream table
yesyayen f9e598a
test: count only an assertion as the expected MongoDB failure
yesyayen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The cap is checked after the fifth lost insert and before the re-read, so if the fifth winner is still present the put gives up rather than overwriting it. That matches UpdateItem exactly and the new boundary test pins it deliberately, so I don't think the behaviour is wrong, but the message "a concurrent writer repeatedly created and deleted the row" is not quite true in that case, since the last winner stayed. Could consider either one final re-read before the error so the message holds, or rewording the message to something like "lost the create race 5 times" so it stays accurate for both cases. Same applies to the hash-only branch at line 334.
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.
Good point, the message wasn't true when the last winner stays. Reworded to "each insert lost the create race to a concurrent writer". I kept the give-up point the same as UpdateItem.