From d28f6da15aa019b3cd5e03be09082b72f189c1e7 Mon Sep 17 00:00:00 2001 From: Bhumika Saini Date: Thu, 25 Apr 2024 11:00:04 +0530 Subject: [PATCH] Remove redundant null check Signed-off-by: Bhumika Saini --- .../org/opensearch/index/seqno/ReplicationTracker.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java index 2e61385c619ac..6697991aef90b 100644 --- a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java @@ -1108,10 +1108,9 @@ private ReplicationGroup calculateReplicationGroup() { } assert newVersion == 0 || indexSettings.isRemoteTranslogStoreEnabled() // Handle migration cases. Ignore assertion if any of the shard copies in the replication group is assigned to a remote node - || (replicationGroup != null - && replicationGroup.getReplicationTargets() - .stream() - .anyMatch(shardRouting -> isShardOnRemoteEnabledNode.apply(shardRouting.currentNodeId()))) + || replicationGroup.getReplicationTargets() + .stream() + .anyMatch(shardRouting -> isShardOnRemoteEnabledNode.apply(shardRouting.currentNodeId())) || checkpoints.entrySet().stream().filter(e -> e.getValue().tracked).allMatch(e -> e.getValue().replicated) : "In absence of remote translog store, all tracked shards must have replication mode as LOGICAL_REPLICATION";