Skip to content

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Sep 2, 2025

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 TxData contain truncation or not.

@Centril Centril changed the base branch from master to centril/clear-table-and-fix-drop-table September 2, 2025 07:51
@bfops bfops added the release-any To be landed in any release window label Sep 3, 2025
@Centril Centril force-pushed the centril/clear-table-and-fix-drop-table branch from 08b70cf to 813f34c Compare September 8, 2025 12:15
@@ -345,19 +345,35 @@ impl CommittedState {
Ok(())
}

pub(super) fn replay_truncate(&mut self, table_id: TableId) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visit_delete happens before visit_truncate, which removes rows from st_* tables, hence schema_for_table fails inside visit_truncate. I think we have to avoid calling that method.

Copy link
Contributor

@Shubham8287 Shubham8287 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants