Skip to content

Fix/aligned tv page seal#734

Open
hongzhi-gao wants to merge 15 commits intoapache:developfrom
hongzhi-gao:fix/aligned_tv_page_seal
Open

Fix/aligned tv page seal#734
hongzhi-gao wants to merge 15 commits intoapache:developfrom
hongzhi-gao:fix/aligned_tv_page_seal

Conversation

@hongzhi-gao
Copy link
Copy Markdown
Contributor

@hongzhi-gao hongzhi-gao commented Mar 2, 2026

Summary

Implement aligned-model synchronized page sealing (matching Java semantics) and fix null-handling bugs in both writer and reader paths.

Changes

  1. Aligned seal sync: When any aligned page hits its capacity threshold (point count or memory), seal all time/value pages together (tsfile_writer.cc).
  2. All-null value pages: Allow zero-sized value buffers in ValuePageData::init; fix end_encode_chunk to correctly handle pre-sealed pages and avoid writing redundant all-null pages in the table model (value_page_writer.cc, value_chunk_writer.cc, time_chunk_writer.cc).
  3. Table-model seal guard: Use get_point_numer() > 0 instead of has_current_page_data() in the table write loop to prevent excessive sealing of all-null pages, which caused heap corruption (0xC0000374) in TestNullInTable4.
  4. Reader null handling: Use null-aware read() in QDSWithoutTimeGenerator::next() to avoid reading past the value buffer for null rows.

Testing

  • New tests: AlignedSealSync_PointCountWithNulls, AlignedSealSync_TimeMemoryFirst, AlignedSealSync_ValueMemoryFirst.
  • Full TsFile_Test passes in both Release and Debug.

In non-strict mode, disable per-write auto page sealing and seal value pages at time-page boundaries to reduce overhead while preserving aligned page semantics.
@hongzhi-gao hongzhi-gao force-pushed the fix/aligned_tv_page_seal branch from d64ab9a to 660f041 Compare March 26, 2026 08:03
…age_seal

# Conflicts:
#	cpp/src/reader/qds_without_timegenerator.cc
@hongzhi-gao
Copy link
Copy Markdown
Contributor Author

hongzhi-gao commented Mar 26, 2026

Force-pushed to clean up an incorrect commit in the previous version.
No functional changes intended — only removed an unintended commit and rebased onto latest upstream.

@hongzhi-gao hongzhi-gao force-pushed the fix/aligned_tv_page_seal branch from d64ab9a to 660f041
21 minutes ago

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