liaoxin01 commented on code in PR #57198:
URL: https://github.com/apache/doris/pull/57198#discussion_r2563642477
##########
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java:
##########
@@ -3663,7 +3665,25 @@ public TCreatePartitionResult
createPartition(TCreatePartitionRequest request) t
LOG.warn("send create partition error status: {}", result);
return result;
}
-
+ // Cache tablet location only when needed:
+ // 1. From a requirement perspective: Only multi-instance ingestion
may trigger inconsistent replica
+ // distribution issues due to concurrent createPartition RPCs.
+ // 2. From a necessity perspective: For BE-initiated loads (e.g.,
stream load commit/abort from BE),
+ // if a BE crashes, the cache for the related transaction may
remain in memory and cannot be cleaned up.
+ // So we skip caching for them.
+ boolean needUseCache = false;
+ if (request.isSetQueryId()) {
+ Coordinator coordinator =
QeProcessorImpl.INSTANCE.getCoordinator(request.getQueryId());
+ if (coordinator != null) {
+ // Found coordinator, check if it's multi-instance
+ // For single-instance imports (like stream load from FE), we
don't need cache either
+ // Only multi-instance imports need to ensure consistent
tablet replica information
+ int instanceNum = coordinator.getInstanceIds().size();
Review Comment:
Please make sure the instance number calculation is correct.
--
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]