Skip to content

Fix aligned flush values after time deletion - #18634

Merged
jt2594838 merged 1 commit into
masterfrom
fix/aligned-flush-time-deletion
Sep 15, 2026
Merged

jt2594838 merged 1 commit into
masterfrom
fix/aligned-flush-time-deletion

Conversation

@jt2594838

Copy link
Copy Markdown
Contributor

Summary

Fixes aligned table data flush after deleting a timestamp. Deleted timestamps are now filtered from both time and value pages, preventing values from shifting onto later timestamps.

Adds unit coverage for standard and remapped value-column paths, plus an end-to-end table-model integration test based on case1.

Validation

  • MemTableFlushTaskTest: 2 new tests passed
  • IoTDBDeletionTableIT#testDeleteFromWhereAttributeAndTimeAfterFlush: passed
  • Maven verify: BUILD SUCCESS

alignedWorkingListForFlush.getValueIndex(sortedRowIndex))) {
continue;
}
// Keep value pages aligned with the time page when an entire timestamp is deleted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skip time-deleted rows while encoding aligned value pages so value positions remain aligned with the time page. This fixes the reproduced flush regression where later values shifted after DELETE plus FLUSH.


@Test
public void testAlignedFlushKeepsValuesAlignedAfterTimeDeletion() throws IOException {
// Deleted rows must be omitted from both time and value pages, including after sorting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These tests cover both aligned flush encoding paths and page/chunk boundaries, proving deleted timestamps do not shift values and column-remapping remains correct.

* effective after the affected data is flushed from the memtable.
*/
@Test
public void testDeleteFromWhereAttributeAndTimeAfterFlush() throws SQLException {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This integration test reproduces the case1 SQL sequence and verifies row counts and exact values before and after FLUSH, guarding the user-visible regression.

@jt2594838
jt2594838 merged commit a05c63e into master Sep 15, 2026
37 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants