-
Notifications
You must be signed in to change notification settings - Fork 177
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
Reserve sequence range for system tables #1265
Conversation
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.
Some minor stuff.
crates/core/src/db/datastore/locking_tx_datastore/committed_state.rs
Outdated
Show resolved
Hide resolved
Might conflict a bit with #1263, so I'll wait with merging mine. |
Reserves an unreasonably large number of sequence values for use by system tables. This means that user-created tables will draw id values starting from the reserved range + 1, as opposed to number of values taken by system tables + 1. Adding new system tables is thus unlikely to interfere with already-assigned values in existing databases.
/// | ||
/// However unlikely it may seem, it is advisable to check for overflow in the | ||
/// test suite when adding sequences to system tables. | ||
pub(crate) const ST_RESERVED_SEQUENCE_RANGE: u32 = 4096; |
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.
I wonder if this should be equal to SEQUENCE_PREALLOCATION_AMOUNT
(sadly defined in the sats
crate).
I have deliberately used ST_RESERVED_SEQUENCE_RANGE
to set the allocated
value of system sequence, so changing the former should not break anything.
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.
Equal as in ST_RESERVED_SEQUENCE_RANGE = SEQUENCE_PREALLOCATION_AMOUNT
I mean.
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.
I don't think they really should be related tbh, they serve different purposes, even if they are used for similar things.
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.
Looks good ✔️
Reserves an unreasonably large number of sequence values for use by system tables. This means that user-created tables will draw id values starting from the reserved range + 1, as opposed to number of values taken by system tables + 1.
Adding new system tables is thus unlikely to interfere with already-assigned values in existing databases.
API and ABI breaking changes
Breaks existing databases due to id conflicts.
Expected complexity level and risk
1
Testing
Should be covered by smoke tests.