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 Jan 28, 2023
1 parent d455c21 commit 105cbc5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ private void scheduleProcess() {
threadpool.schedule(this::process, getBufferInterval(), getBufferRefreshThreadPoolName());
} catch (Exception e) {
getLogger().error("failed to schedule process");
// process scheduling failure
processSchedulingFailure(e);
getPromiseSemaphore().release();
// This is to make sure that any new items that are added to the queue between processSchedulingFailure
Expand Down
15 changes: 7 additions & 8 deletions server/src/main/java/org/opensearch/index/IndexSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public final class IndexSettings {
private final ReplicationType replicationType;
private final boolean isRemoteStoreEnabled;
private final boolean isRemoteTranslogStoreEnabled;
private volatile TimeValue bufferInterval;
private final TimeValue remoteTranslogUploadBufferInterval;
private final String remoteStoreTranslogRepository;
private final String remoteStoreRepository;
private final boolean isRemoteSnapshot;
Expand Down Expand Up @@ -754,7 +754,10 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
isRemoteStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, false);
isRemoteTranslogStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_TRANSLOG_STORE_ENABLED, false);
remoteStoreTranslogRepository = settings.get(IndexMetadata.SETTING_REMOTE_TRANSLOG_STORE_REPOSITORY);
bufferInterval = settings.getAsTime(IndexMetadata.SETTING_REMOTE_TRANSLOG_BUFFER_INTERVAL, TimeValue.timeValueMillis(100));
remoteTranslogUploadBufferInterval = settings.getAsTime(
IndexMetadata.SETTING_REMOTE_TRANSLOG_BUFFER_INTERVAL,
TimeValue.timeValueMillis(100)
);
remoteStoreRepository = settings.get(IndexMetadata.SETTING_REMOTE_STORE_REPOSITORY);
isRemoteSnapshot = IndexModule.Type.REMOTE_SNAPSHOT.match(this.settings);

Expand Down Expand Up @@ -1142,12 +1145,8 @@ public void setTranslogSyncInterval(TimeValue translogSyncInterval) {
* {@code index.translog.durability} is set as {@code request}.
* @return the buffer interval.
*/
public TimeValue getBufferInterval() {
return bufferInterval;
}

public void setBufferInterval(TimeValue bufferInterval) {
this.bufferInterval = bufferInterval;
public TimeValue getRemoteTranslogUploadBufferInterval() {
return remoteTranslogUploadBufferInterval;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public IndexShard(
threadPool,
this::getEngine,
indexSettings.isRemoteTranslogStoreEnabled(),
indexSettings.getBufferInterval()
indexSettings.getRemoteTranslogUploadBufferInterval()
);
this.mapperService = mapperService;
this.indexCache = indexCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ public void testRemoteTranslogExplicitSetting() {
IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY);
assertNull(settings.getRemoteStoreRepository());
assertEquals("tlog-store", settings.getRemoteStoreTranslogRepository());
assertEquals(TimeValue.timeValueMillis(200), settings.getBufferInterval());
assertEquals(TimeValue.timeValueMillis(200), settings.getRemoteTranslogUploadBufferInterval());
}

public void testSetRemoteTranslogRepositoryFailsWhenRemoteTranslogIsNotEnabled() {
Expand Down

0 comments on commit 105cbc5

Please sign in to comment.