zclllyybb commented on issue #65339:
URL: https://github.com/apache/doris/issues/65339#issuecomment-4904017164

   Breakwater-GitHub-Analysis-Slot: slot_6fe5c9fb8393
   This content is generated by AI for reference only.
   
   Initial assessment:
   
   This should be treated as a real BE crash in the row-binlog/table-stream 
MIN_DELTA read path at commit `49af19213e7`, not as expected SQL behavior. The 
stack stops in `ColumnStr<unsigned int>::insert_from()` while 
`BlockReader::_min_delta_next_block()` is materializing rows for a stream scan.
   
   The most suspicious code-level mechanism is a source/target nullability 
mismatch for BEFORE image columns. FE generates row-binlog BEFORE value columns 
as nullable (`Column.generateBeforeValueColumn()` sets `isAllowNull=true`). In 
BE, the MIN_DELTA UPDATE_BEFORE branch resolves a selected value column to its 
`__BEFORE__...` source column and then directly calls 
`target_columns[target_col_idx]->insert_from(*_stored_data_columns[source_idx], 
0)`. If the selected base column is a non-null `STRING`/`VARCHAR` column such 
as `l_comment`, the target column is `ColumnString`, while the BEFORE source is 
`ColumnNullable(ColumnString)`. `ColumnStr::insert_from()` then casts the 
source as `ColumnStr` and copies from invalid string offsets/chars, which is 
consistent with the reported SIGSEGV in `memcpy`.
   
   This is also worth checking in the DETAIL path because 
`_append_change_row()` uses the same direct `insert_from()` pattern when it 
emits UPDATE_BEFORE rows from BEFORE columns.
   
   Missing information needed to confirm the exact trigger:
   
   1. The DDL for `s_debug_update_type`, especially key type, `binlog.enable`, 
`binlog.format`, `binlog.need_historical_value`, and the nullability/type of 
`l_comment` and `l_quantity`.
   2. The DML sequence for `l_orderkey = 80001` before this query.
   3. The full BE core backtrace with line numbers, plus `be.INFO` around query 
id `4b19b44376794ab9-8b3f9f5ec27b1393`.
   4. The `EXPLAIN`/`EXPLAIN VERBOSE` plan for the query, to verify the scan 
type is MIN_DELTA and the physical scan includes `__DORIS_BINLOG_OP__` plus 
widened BEFORE columns.
   5. Whether the crash disappears if `l_comment` is not selected, or if 
`l_comment` is defined nullable. That would directly validate the 
nullable-BEFORE to non-null-string copy path.
   
   Suggested next steps for maintainers:
   
   1. Add a regression case for a MIN_DELTA table stream over a unique/MOW 
row-binlog table with `binlog.need_historical_value=true`, selecting a non-null 
`VARCHAR` value column after an UPDATE that emits UPDATE_BEFORE/UPDATE_AFTER.
   2. Fix BE stream materialization to handle nullable BEFORE columns safely 
when the output column keeps the base column's non-null type. The 
implementation should not call `ColumnString::insert_from()` with a 
`ColumnNullable` source; it should either align output nullability or 
explicitly append from nullable sources with the correct null/nested-column 
handling.
   3. Audit both `BlockReader::_min_delta_next_block()` and 
`BlockReader::_append_change_row()` for all direct `insert_from()` calls that 
can read from `_resolve_source_column_index(..., true)`.
   


-- 
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]

Reply via email to