Skip to content

Commit aca2198

Browse files
Segment Replication stats throwing NPE when shards are unassigned or are in delayed allocation phase
Signed-off-by: Rampreeth Ethiraj <[email protected]>
1 parent bb9819c commit aca2198

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ public ReplicationCheckpoint getLatestReplicationCheckpoint() {
12541254
private boolean isPrimaryRelocation(String allocationId) {
12551255
Optional<ShardRouting> shardRouting = routingTable.shards()
12561256
.stream()
1257+
.filter(routing -> Objects.nonNull(routing.allocationId().getId()))
12571258
.filter(routing -> routing.allocationId().getId().equals(allocationId))
12581259
.findAny();
12591260
return shardRouting.isPresent() && shardRouting.get().primary();

0 commit comments

Comments
 (0)