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
  • Loading branch information
rampreeth-ethiraj committed Jun 27, 2024
1 parent bb9819c commit ec6091b
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 ec6091b

Please sign in to comment.