github-actions[bot] commented on code in PR #60944:
URL: https://github.com/apache/doris/pull/60944#discussion_r3323378946
##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java:
##########
@@ -216,6 +217,16 @@ public long getClusterPrimaryBackendId(String clusterId) {
return primaryClusterToBackend.getOrDefault(clusterId, -1L);
}
+ // For proc display only. In cloud mode a replica is hashed to a different
BE in
+ // each compute group, so expose the whole clusterId -> backendId cache.
The proc
+ // display builds a separate bucket sequence per compute group from this
map so the
+ // sequence is consistent within each group. Do not collapse this into a
single BE
+ // (e.g. the first one): backends differ across compute groups and would
not match.
+ @Override
+ public Map<String, Long> getClusterToBackendForProcDisplay() {
Review Comment:
This accessor returns only `primaryClusterToBackend`, but colocated cloud
replicas do not use that cache for their placement.
`getClusterPrimaryBackendId()` immediately branches to
`getColocatedBeId(clusterId)` when `isColocated()` is true, and
`getBackendIdImpl()` has the same early colocated path, so a real cloud
colocate table can have valid placement while this map remains empty. Then
`ColocationGroupProcDir` sees no scope keys and returns an empty backend
sequence, which is exactly the legacy-metadata fallback this PR is trying to
repair. Please handle the colocated path explicitly, for example by
snapshotting replicas under the table lock and resolving per-compute-group
colocated placement after releasing it, and add a test where
`CloudReplica.isColocated()` is true and `primaryClusterToBackend` is empty.
--
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]