gavinchou commented on code in PR #62661: URL: https://github.com/apache/doris/pull/62661#discussion_r3505033025
########## be/src/load/channel/adaptive_random_bucket_state.cpp: ########## @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "load/channel/adaptive_random_bucket_state.h" + +#include <glog/logging.h> + +#include <utility> + +namespace doris { + +void AdaptiveRandomBucketState::init_partition(int64_t partition_id, + const std::vector<int64_t>& tablets, + const std::vector<int32_t>& bucket_seqs, + int32_t start_tablet_idx) { + if (partition_id < 0 || tablets.empty()) { + return; + } + std::lock_guard<std::mutex> lock(_mutex); + if (_partition_states.contains(partition_id)) { Review Comment: The assignment/state granularity still looks ambiguous here. FE computes adaptive assignments keyed by sink backend, but the receiver stores only one state per partition and ignores subsequent init for the same partition. If multiple senders route the same partition to the same receiver BE with different ordered bucket lists, the later sender will use the first sender's current tablet/sequence instead of its FE assignment. Could we either scope the receiver state by sender+partition, or explicitly prove/enforce that every open for the same receiver partition carries the same sequence? A regression with multiple sink instances/senders landing on the same receiver BE would also make the intended contract much clearer. -- 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]
