-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[alpha-playtest-3]: [alpha-playtest-3]: Cherrypick WIP PR #1532: Don'…
…t pre-allocate seqs during bootstrap; fix off-by-ones when allocating. Also use `pretty_assertions` in some tests, because I was having trouble debugging small differences in large structures. Notably does not use `pretty_assertions` in our whole test suite, only in the tests broken by the previous commits in this PR. Prior to this commit, we pre-allocated 4096 values for each sequence during bootstrap. For user sequences, these were 0..=4096; for system sequences, they were 4097..=8192. This did not play nicely with restoring after a restart; we would either incorrectly re-use values starting from 4097 after restart, or would spuriously allocate after bootstrap without a restart and begin with values starting from 8193. With this commit, we do not pre-allocate sequence values during bootstrap. Each user table sequence starts with `value: 1, allocation: 0`, and each system sequence with `value: 4097, allocation: 4096`. This means that the first access to a sequence, either after bootstrap or after a restart, will perform an allocation. This is in contrast to previously, where accesses after restart would allocate, but accesses after bootstrap would not. Additionally, the logic for determining whether an allocation was necessary in `MutTxId::get_next_sequence_value` contained an off-by-one value which caused the last value before an allocation to be skipped. This commit fixes that off-by-one error, making it so that yielding value `4096` when `allocation == 4096` is possible, though it does result in a new allocation. Previously, we would yield 4095 without allocation, skip 4096, then allocate and yield 4097.
- Loading branch information
Showing
10 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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 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 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