zclllyybb commented on issue #65901: URL: https://github.com/apache/doris/issues/65901#issuecomment-5044130678
Breakwater-GitHub-Analysis-Slot: slot_c3914a919850 This content is generated by AI for reference only. Initial assessment: this looks like a real BE storage scan bug, not a resource issue or an invalid SQL/table-stream usage. The reported stack is consistent with a caller/callee mode contract violation: the outer scan path calls the Block interface while a child rowset iterator has already been initialized for row-reference output. Code-path check on commit `87d57a84729`: - `APPEND_ONLY` table stream is propagated as `TBinlogScanType::APPEND_ONLY`. - `OlapScanner` treats any row-binlog scan as ordered: it sets `read_orderby_key = true` and `force_key_ordered_read = true`. - For a single-version, non-overlapping layout, `TabletReader::ReaderParams::has_single_version()` can make the scan use `direct_mode = true`; `BlockReader::init()` only diverts `MIN_DELTA` and `DETAIL` to row-by-row binlog-specific readers, so `APPEND_ONLY` can still use `_direct_next_block()` and call `VCollectIterator::next(Block*)`. - Independently, `BetaRowsetReader::is_merge_iterator()` returns true when ordered output is required, the rowset has more than one segment, and `force_key_ordered_read` is set. Therefore a multi-segment ROW-binlog rowset can become an inner merge iterator even when its rowset metadata is `NONOVERLAPPING`. - In the non-merge/union setup, a later `Level0Iterator` can be initialized with `get_data_by_ref = true`. If an earlier child is empty and skipped, that by-reference child can become the current child while the parent still uses the Block interface. `VCollectIterator::Level0Iterator::next(Block*)` then hits `CHECK(!_get_data_by_ref)`, which matches the reported abort. So the high-confidence root cause is an inconsistent read-mode contract between `BlockReader`/`VCollectIterator` and the rowset reader under APPEND_ONLY ROW-binlog scans. The fatal check should not be removed; it is protecting against continuing after the storage layer has mixed two incompatible output protocols. Recommended fix direction: - Make the selected output protocol explicit and consistent from `BlockReader` down to every `VCollectIterator::Level0Iterator`. - For an APPEND_ONLY scan that will use the Block interface, prevent every child from entering `_get_data_by_ref` mode, while still preserving the ordered multi-segment row-binlog merge inside `BetaRowsetReader`. - Alternatively, route APPEND_ONLY through a row-reference/materialization path similar in contract to the `MIN_DELTA`/`DETAIL` readers, but without changing APPEND_ONLY semantics. - Add a regression test that creates a ROW-binlog table stream with a multi-segment `NONOVERLAPPING` data rowset, including the empty-initial-rowset plus data-rowset shape if that is the actual failing layout, then queries the APPEND_ONLY stream and verifies both no BE abort and stable ordered output. Useful missing information for a self-contained upstream repro: - Exact base table DDL, binlog/table-stream DDL, and stream query SQL. - The load/insert script or segment-size settings needed to force the failing multi-segment rowset. - Failing tablet rowset metadata: version range, row count, segment count, `segments_overlap`, and whether an empty rowset precedes the data rowset. - FE plan or scan range snippet showing `read_row_binlog=true` and `binlog_scan_type=APPEND_ONLY`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
