Skip to content

Commit

Permalink
[fix](group commit) fix NPE in group commit select backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mymeiyi committed Nov 11, 2024
1 parent dd18271 commit 34a2c1b
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,11 @@ private Long getCachedBackend(String cluster, long tableId) {
// Another thread gets the same tableId but can not find this tableId.
// So another thread needs to get the random backend.
Long backendId = tableToBeMap.get(encode(cluster, tableId));
Backend backend;
if (backendId != null) {
backend = Env.getCurrentSystemInfo().getBackend(backendId);
} else {
if (backendId == null) {
return null;
}
if (backend.isActive() && !backend.isDecommissioned()) {
Backend backend = Env.getCurrentSystemInfo().getBackend(backendId);
if (backend != null && backend.isActive() && !backend.isDecommissioned()) {
return backend.getId();
} else {
tableToBeMap.remove(encode(cluster, tableId));
Expand Down

0 comments on commit 34a2c1b

Please sign in to comment.