Skip to content

Commit

Permalink
Segment Replication stats throwing NPE when shards are unassigned or …
Browse files Browse the repository at this point in the history
…are in delayed allocation phase

Signed-off-by: Rampreeth Ethiraj <[email protected]>
  • Loading branch information
rampreeth-ethiraj authored and rampreeth committed Jun 27, 2024
1 parent bb9819c commit 0603be3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,7 @@ public ReplicationCheckpoint getLatestReplicationCheckpoint() {
private boolean isPrimaryRelocation(String allocationId) {
Optional<ShardRouting> shardRouting = routingTable.shards()
.stream()
.filter(routing -> Objects.nonNull(routing.allocationId().getId()))
.filter(routing -> routing.allocationId().getId().equals(allocationId))
.findAny();
return shardRouting.isPresent() && shardRouting.get().primary();
Expand Down

0 comments on commit 0603be3

Please sign in to comment.