[fix](load) fix quorum success invalid in move-memtable-on-sink load path#60681
[fix](load) fix quorum success invalid in move-memtable-on-sink load path#60681dataroaring merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 30175 ms |
ClickBench: Total hot run time: 28.36 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
6cbd3bf to
4904e66
Compare
|
run buildall |
TPC-H: Total hot run time: 30899 ms |
ClickBench: Total hot run time: 28.27 s |
|
run buildall |
TPC-H: Total hot run time: 29037 ms |
TPC-DS: Total hot run time: 183418 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
1 similar comment
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-H: Total hot run time: 28791 ms |
TPC-DS: Total hot run time: 184521 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…path (#60681) ## Description In `VTabletWriterV2`, the `_quorum_success()` function always returns `false` even when all streams have finished successfully, making the quorum success write feature effectively non-functional. ## Root Cause In both `_build_tablet_node_mapping()` and `_incremental_open_streams()`, `_tablets_by_node[node].emplace(tablet_id)` is guarded by the `known_indexes` check: ```cpp if (known_indexes.contains(index.index_id)) [[likely]] { continue; } _indexes_from_node[node].emplace_back(tablet); _tablets_by_node[node].emplace(tablet_id); known_indexes.insert(index.index_id); ``` The known_indexes set is shared across all partitions, tablets, and nodes. Once an index_id is inserted after processing the first tablet's first node, all subsequent tablets (and all other nodes of the same tablet) with the same index_id skip the _tablets_by_node update. For example, with 1 index, 3 tablets [T1, T2, T3], and 3 replicas [N1, N2, N3]: Only _tablets_by_node[N1] = {T1} gets populated T1 on N2/N3, and T2/T3 on all nodes are skipped This causes _quorum_success() to compute finished_tablets_replica incorrectly: finished_tablets_replica[T1] = 1 (only counted from N1) finished_tablets_replica[T2] = 0, finished_tablets_replica[T3] = 0 With a quorum requirement of 2 (for 3 replicas), the check always fails. The known_indexes optimization was intended only for _indexes_from_node (to avoid sending duplicate schema info per index), but it incorrectly also blocked the _tablets_by_node population. Note: vtablet_writer.cpp does NOT have this issue — its _tablets_by_channel is populated without the known_indexes guard. ## Fix Move _tablets_by_node[node].emplace(tablet_id) before the known_indexes check in both _build_tablet_node_mapping() and _incremental_open_streams(), so that every tablet on every node is correctly recorded.
…n-sink load path apache#60681 (apache#60820) Cherry-picked from apache#60681 Co-authored-by: hui lai <laihui@selectdb.com>
Description
In
VTabletWriterV2, the_quorum_success()function always returnsfalseeven whenall streams have finished successfully, making the quorum success write feature effectively
non-functional.
Root Cause
In both
_build_tablet_node_mapping()and_incremental_open_streams(),_tablets_by_node[node].emplace(tablet_id)is guarded by theknown_indexescheck:The known_indexes set is shared across all partitions, tablets, and nodes. Once an
index_id is inserted after processing the first tablet's first node, all subsequent
tablets (and all other nodes of the same tablet) with the same index_id skip the
_tablets_by_node update.
For example, with 1 index, 3 tablets [T1, T2, T3], and 3 replicas [N1, N2, N3]:
Only _tablets_by_node[N1] = {T1} gets populated
T1 on N2/N3, and T2/T3 on all nodes are skipped
This causes _quorum_success() to compute finished_tablets_replica incorrectly:
finished_tablets_replica[T1] = 1 (only counted from N1)
finished_tablets_replica[T2] = 0, finished_tablets_replica[T3] = 0
With a quorum requirement of 2 (for 3 replicas), the check always fails.
The known_indexes optimization was intended only for _indexes_from_node (to avoid
sending duplicate schema info per index), but it incorrectly also blocked the
_tablets_by_node population.
Note: vtablet_writer.cpp does NOT have this issue — its _tablets_by_channel is
populated without the known_indexes guard.
Fix
Move _tablets_by_node[node].emplace(tablet_id) before the known_indexes check in
both _build_tablet_node_mapping() and _incremental_open_streams(), so that every
tablet on every node is correctly recorded.