github-actions[bot] commented on code in PR #62661:
URL: https://github.com/apache/doris/pull/62661#discussion_r3370738089
##########
be/src/exec/sink/writer/vtablet_writer.cpp:
##########
@@ -657,6 +670,20 @@ void VNodeChannel::_open_internal(bool is_incremental) {
request->set_txn_expiration(_parent->_txn_expiration);
request->set_write_file_cache(_parent->_write_file_cache);
+ if (_parent->_tablet_finder->is_adaptive_random_bucket()) {
+ std::unordered_map<int64_t, std::vector<int64_t>>
partition_to_ordered_tablets;
+ for (const auto& tablet : _all_tablets) {
+
partition_to_ordered_tablets[tablet.partition_id].push_back(tablet.tablet_id);
+ }
Review Comment:
This receiver-side open path drops the FE-selected bucket sequence.
`computeAdaptiveRandomBucketAssignments()` sets `load_tablet_idx` and
`local_bucket_seqs`, and `IndexChannel::init()` uses only `bucket_be_id` to
choose the target channel. But here the open request sends every tablet
accumulated on that BE channel, and
`BaseTabletsChannel::_init_receiver_side_random_bucket_state()` initializes the
rotation from position `0` over the whole `ordered_tablet_ids` list. In a
multi-replica partition where the chosen BE has replicas for buckets
`[0,1,2,3,4,5]` but FE selected `local_bucket_seqs=[2,5]` with start bucket
`2`, the receiver will start at bucket `0` and rotate through all six buckets
after flushes. That routes rows to buckets that were not assigned to this sink
and defeats the adaptive bucket selection. Please build `ordered_tablet_ids`
from the partition's selected `local_bucket_seqs` in that order, and preserve
the selected start bucket instead of implicitly starting at ze
ro.
--
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]