Skip to content

fix(cpp): address review notes on the reusable TsBlock change - #1099

Merged
ColinLeeo merged 1 commit into
developfrom
fix/pr1097-review-notes
Nov 13, 2026
Merged

ColinLeeo merged 1 commit into
developfrom
fix/pr1097-review-notes

Conversation

@ColinLeeo

Copy link
Copy Markdown
Contributor

Follow-up to the review comments on #1097, which is already merged. None of
these change behaviour on the hot path; they fix an ordering that would
dereference an unchecked pointer, align a contract comment with the code,
tighten const-correctness, and close two test-coverage gaps.

  • DeviceOrderedTsBlockReader::has_next() called set_reusable_block() on
    the freshly allocated reader before the existing null check.
  • TsFileSeriesScanIterator's factory contract claimed a returned block must
    already be reset; alloc_or_reuse_tsblock() always resets it, so document
    that instead.
  • TsBlockFactory / ReusableTsBlock::acquire() now take the layout as
    const TupleDesc& (the factory only reads it), which needs a const
    TupleDesc::operator[] overload.
  • ReusesTheBlockForTheSameLayout now appends every column of the block, and
    ConsecutiveDeviceScansShareOneBlock reads both value columns back through
    the production bulk_copy_into() path; previously only the first value
    column was asserted.

Testing: full TsFile_Test (1474 tests, 1471 passed, 3 skipped) and
./mvnw -q -P with-cpp spotless:check.

* DeviceOrderedTsBlockReader: call set_reusable_block() after the null
  check of the reader it is invoked on.
* TsFileSeriesScanIterator: the factory contract said a returned block
  must already be reset, while alloc_or_reuse_tsblock() resets it
  unconditionally; document what the code does.
* Pass the layout as `const TupleDesc&` through TsBlockFactory and
  ReusableTsBlock::acquire(), adding the const TupleDesc::operator[]
  overload that needs.
* reusable_tsblock_test: fill every column of the block in the layout
  test, and read both value columns back through the production
  bulk_copy_into() path (the second column was never asserted).
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.54%. Comparing base (10626d0) to head (8e2d883).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1099      +/-   ##
===========================================
- Coverage    66.55%   66.54%   -0.01%     
===========================================
  Files          782      782              
  Lines        56709    56710       +1     
  Branches      9134     9134              
===========================================
- Hits         37743    37739       -4     
- Misses       17304    17309       +5     
  Partials      1662     1662              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ColinLeeo
ColinLeeo merged commit 6393671 into develop Nov 13, 2026
49 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