From 12ae55376eef2937faa560958c80a7fe24337922 Mon Sep 17 00:00:00 2001 From: Ashish Singh Date: Wed, 25 Oct 2023 22:54:27 +0530 Subject: [PATCH] Incorporate PR review feedback Signed-off-by: Ashish Singh --- .../opensearch/index/shard/RemoteStoreRefreshListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/shard/RemoteStoreRefreshListener.java b/server/src/main/java/org/opensearch/index/shard/RemoteStoreRefreshListener.java index 0b6f006c67128..464adc88ae16f 100644 --- a/server/src/main/java/org/opensearch/index/shard/RemoteStoreRefreshListener.java +++ b/server/src/main/java/org/opensearch/index/shard/RemoteStoreRefreshListener.java @@ -161,10 +161,10 @@ protected boolean performAfterRefreshWithPermit(boolean didRefresh) { * This checks if there is a sync required to remote. * * @param didRefresh if the readers changed. - * @param avoidPrimaryTermChange consider change in primary term or not for should sync + * @param skipPrimaryTermCheck consider change in primary term or not for should sync * @return true if sync is needed */ - private boolean shouldSync(boolean didRefresh, boolean avoidPrimaryTermChange) { + private boolean shouldSync(boolean didRefresh, boolean skipPrimaryTermCheck) { boolean shouldSync = didRefresh // If the readers change, didRefresh is always true. // The third condition exists for uploading the zero state segments where the refresh has not changed the reader // reference, but it is important to upload the zero state segments so that the restore does not break. @@ -173,7 +173,7 @@ private boolean shouldSync(boolean didRefresh, boolean avoidPrimaryTermChange) { // we update the primary term and the same condition would not evaluate to true again in syncSegments. // Below check ensures that if there is commit, then that gets picked up by both 1st and 2nd shouldSync call. || isRefreshAfterCommitSafe(); - if (shouldSync || avoidPrimaryTermChange) { + if (shouldSync || skipPrimaryTermCheck) { return shouldSync; } return this.primaryTerm != indexShard.getOperationPrimaryTerm();