Skip to content

Commit

Permalink
Incorporate PR review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <[email protected]>
  • Loading branch information
ashking94 committed Oct 25, 2023
1 parent a5e95ad commit 12ae553
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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();
Expand Down

0 comments on commit 12ae553

Please sign in to comment.