-
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
Fix index removal and additions + add smoketest #1444
Conversation
1. Add constraints when adding an index. 2. Make indexes more transactional. 3. Make replay behave wrt. schema changes.
1645e6f
to
44df346
Compare
// NOTE: Also add all the rows in the already committed table to the index. | ||
// FIXME: Is this correct? Index scan iterators (incl. the existing `Locking` versions) | ||
// appear to assume that a table's index refers only to rows within that table, | ||
// and does not handle the case where a `TxState` index refers to `CommittedState` rows. | ||
if let Some(committed_table) = commit_table { | ||
insert_index.build_from_rows(&index.columns, committed_table.scan_rows(commit_blob_store))?; | ||
} |
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.
This seems wrong to me, but currently a pre-commit test fails without it.
The logic is pre-existing and should ostensibly be replaced by doing some on-merge logic, rendering merges fallible.
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.
AFAICT, the idea here is that the same TX that creates the index may use it, even though it hasn't been added to the committed state yet, so the transient version in the insert state needs to also contain the committed state's rows. There are other, better ways we could accomplish the same thing, or we could just disallow doing create_index
in arbitrary TXes, but that's the impetus behind the current behavior.
4f87b14
to
61e2fe0
Compare
61e2fe0
to
f799f30
Compare
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
(Modulo the preservation of oddness, which I trust will be fixed soon).
Description of Changes
Fixes #1438.
API and ABI breaking changes
None
Expected complexity level and risk
2
Testing
call
/ WARN test still works