-
Notifications
You must be signed in to change notification settings - Fork 663
datastore: add support for truncation #3215
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
Conversation
08b70cf to
813f34c
Compare
cc9ef87 to
a81d360
Compare
a81d360 to
2ed26ea
Compare
Shubham8287
left a comment
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.
If you need to reproduce the bug mentioned in comment, I can help but reasoning seems straight-forward.
|
I am also getting this error while trying to replay from commitlog after module update. With following repo steps:
Not reproducible in master, I also tried with rebasing the PR on master. |
2ed26ea to
f44dcfa
Compare
# Description of Changes Based on,and to fix mentioned issues on #3215 i.e - 1. Mark table for truncation after anaylyzing `TxData::inserts` too. 2. `visit_truncates` can not call `schema_for_tables` for dropped tables as schema info has been deleted from `st_*` tables. Hence, added a field in `ReplayVisitor` to cache table names. This PR decouples truncation info from delete entries, since deletion alone can’t reliably tell about truncation without extra mutations later. Can be reviewed commit wise. # Testing Testing using "Add columns" PR.
Shubham8287
left a comment
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.
Merged https://github.com/clockworklabs/SpacetimeDB/pull/3261/files which fixes the previously mentiond issues.
Description of Changes
Adds support for truncation in the datastore.
The commitlog format already supported it.
A table is considered truncated in a transaction when there are deletes and when the row count post-deletes is 0.
API and ABI breaking changes
None
Expected complexity level and risk
3?
Testing
Some existing datastore tests have been amended to check whether
TxDatacontain truncation or not.