Skip to content

Commit

Permalink
fix backend pick index out range
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Dec 21, 2024
1 parent 93585ac commit bcd1c7a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ public List<Column> fetch() {
}
// pick 2 random coordinator
Collections.shuffle(coordinatorBackend);
coordinatorBackend = coordinatorBackend.subList(0, 2);
if (!coordinatorBackend.isEmpty()) {
coordinatorBackend = coordinatorBackend.subList(0, Math.min(2, coordinatorBackend.size()));
LOG.debug("pick coordinator backend {}", coordinatorBackend.get(0));
}
PFetchRemoteSchemaRequest.Builder requestBuilder = PFetchRemoteSchemaRequest.newBuilder()
.addAllTabletLocation(locations)
.setIsCoordinator(true);
Expand Down

0 comments on commit bcd1c7a

Please sign in to comment.