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


##########
fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java:
##########
@@ -366,8 +366,16 @@ private Long getCachedBackend(String cluster, long 
tableId) {
             if (pressure == null) {
                 return null;
             } else if (pressure.get() < table.getGroupCommitDataBytes()) {
-                Backend backend = 
Env.getCurrentSystemInfo().getBackend(backendId);
-                if (isBackendAvailable(backend, cluster)) {
+                Backend backend;
+                if (Config.isCloudMode()) {
+                    // The cloud service resolves a cluster or VCG to its 
current active backend pool.
+                    // Look up the cached backend in that pool to validate 
membership after topology changes.
+                    backend = ((CloudSystemInfoService) 
Env.getCurrentSystemInfo())

Review Comment:
   [P2] Avoid copying the whole physical pool on every cache hit
   
   For a physical compute group, the old cache-hit path used the O(1) global 
`getBackend(backendId)` lookup and the physical-name membership check passed. 
This now calls `getCloudIdToBackend(cluster).get(backendId)` on every cached 
group-commit request; that helper loops over the entire pool into a `HashMap` 
and then copies it again into an `ImmutableMap`, only for this caller to 
extract one ID. Group commit is the high-frequency small-load path, so an 
otherwise valid cache hit becomes O(pool size) allocation/work under the 
topology read lock. Please add/use a direct scoped membership lookup (or 
immutable membership view/generation) that validates this one backend without 
materializing the full pool.
   



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