Skip to content

Commit

Permalink
Addressed comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ankit Kala <ankikala@amazon.com>
  • Loading branch information
ankitkala committed Jun 26, 2023
1 parent f5ce3cd commit 8931b93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ private synchronized void syncSegments(boolean isRetry) {
return;
}
ReplicationCheckpoint checkpoint = indexShard.getLatestReplicationCheckpoint();
if (indexShard.indexSettings().isSegRepWithRemoteEnabled()) {
indexShard.onCheckpointPublished(checkpoint);
}
indexShard.onCheckpointPublished(checkpoint);
beforeSegmentsSync(isRetry);
long refreshTimeMs = segmentTracker.getLocalRefreshTimeMs(), refreshClockTimeMs = segmentTracker.getLocalRefreshClockTimeMs();
long refreshSeqNo = segmentTracker.getLocalRefreshSeqNo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public SegmentReplicationCheckpointPublisher(PublishAction publishAction) {

public void publish(IndexShard indexShard, ReplicationCheckpoint checkpoint) {
publishAction.publish(indexShard, checkpoint);
if (indexShard.indexSettings().isSegRepWithRemoteEnabled() == false) {
indexShard.onCheckpointPublished(checkpoint);
}
indexShard.onCheckpointPublished(checkpoint);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ public class RemoteStoreRefreshListenerTests extends IndexShardTestCase {
public void setup(boolean primary, int numberOfDocs) throws IOException {
indexShard = newStartedShard(
primary,
Settings.builder().put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true).build(),
Settings.builder()
.put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true)
.put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT)
.build(),
new InternalEngineFactory()
);

indexDocs(1, numberOfDocs);
indexShard.refresh("test");
if (primary) {
indexDocs(1, numberOfDocs);
indexShard.refresh("test");
}

clusterService = new ClusterService(
Settings.EMPTY,
Expand Down

0 comments on commit 8931b93

Please sign in to comment.