You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 40762c7
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](binlog) Fix BE crash when APPEND_ONLY row-binlog scan omits key columns
Any row-binlog scan used to force a key-ordered merged read with
read_orderby_key_num_prefix_columns == 0, which makes the merge
comparators (VMergeIteratorContext::compare and VCollectIterator's
LevelIteratorComparator) fall back to comparing the first
num_key_columns block positions, where num_key_columns counts the key
columns of the whole tablet schema.
MIN_DELTA / DETAIL scans satisfy that contract because they widen the
storage projection with the full key prefix. APPEND_ONLY, however, takes
the direct_mode branch and keeps the raw SQL projection, which may omit
some or all key columns. Block::compare_at() only has DCHECK bounds
checks, so in a release build the first heap comparison reads past the
block's column array and crashes the BE with SIGSEGV inside
VMergeIterator::init / std::push_heap.
Fix:
- olap_scanner: only MIN_DELTA / DETAIL force the key-ordered merged
read. APPEND_ONLY does no key grouping, so it now reads unordered like
a plain scan (ORDER BY / TopN pushdowns stay disabled for all binlog
scan types as before).
- VMergeIteratorContext::init and VCollectIterator::Level1Iterator::init
now validate the merge compare contract (compare positions exist in
the block, and the projection starts with the full ordered key prefix
for the default comparison) and return a diagnosable error instead of
performing an out-of-bounds or silently misordered comparison.
- Add BE unit tests for the rejected projections and a regression suite
covering APPEND_ONLY / DETAIL / MIN_DELTA with narrow projections.
Co-Authored-By: Claude Fable 5 <[email protected]>
0 commit comments