github-actions[bot] commented on code in PR #69554:
URL: https://github.com/apache/doris/pull/69554#discussion_r4371266373


##########
be/src/exec/sink/load_stream_map_pool.cpp:
##########
@@ -99,6 +99,34 @@ void LoadStreamMap::save_tablets_to_commit(int64_t dst_id,
     }
 }
 
+Status LoadStreamMap::merge_tablet_replica_info(int64_t tablet_id,
+                                                const TabletReplicaInfo& 
replica_info) {
+    std::lock_guard<std::mutex> lock(_mutex);
+    auto [it, inserted] = _tablet_replica_infos.emplace(tablet_id, 
replica_info);
+    if (!inserted) {
+        auto& existing = it->second;
+        if (existing.total_replicas_num != replica_info.total_replicas_num ||
+            existing.load_required_replicas_num != 
replica_info.load_required_replicas_num ||

Review Comment:
   [P2] Reconcile refreshed replica requirements across local writers
   
   These counts can legitimately differ between replies for the same load. 
`snapshotPartitionResult()` recomputes `getLoadRequiredReplicaNum()` for every 
`createPartition` RPC, including cache hits, while `AutoPartitionCacheManager` 
caches only locations and the tablet index. With a three-replica automatic 
table and no table-level minimum override, let local V2 writer W1 discover A 
while dynamic `Config.min_load_replica_num` is 2. If the operator lowers it to 
1 before W2 independently discovers A, both replies contain the same three 
healthy destinations but required counts 2 and 1. W2 reaches this comparison 
through `_register_tablet_replica_info()`, gets `conflicting replica 
information`, and aborts the load even though either policy has a healthy 
quorum. The previous per-writer policies did not impose this equality 
requirement.
   
   Pin the requirement in the same transaction snapshot as the locations, or 
reconcile compatible policy refreshes in the shared map, and cover a dynamic 
minimum update between two local partition requests.



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