Skip to content

Commit 5c6edd1

Browse files
author
Kamal Nayan
committed
Disabled the remote segment Upload decoupled flag
Signed-off-by: Kamal Nayan <askkamal@amazon.com>
1 parent 73f116a commit 5c6edd1

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

server/src/main/java/org/opensearch/indices/RemoteStoreSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public class RemoteStoreSettings {
101101
@ExperimentalApi
102102
public static final Setting<Boolean> CLUSTER_REMOTE_STORE_REFRESH_SEGMENT_UPLOAD_DECOUPLE = Setting.boolSetting(
103103
"cluster.remote_store.index.refresh.segment_upload_decouple",
104-
true,
104+
false,
105105
Property.NodeScope,
106106
Property.Dynamic
107107
);

server/src/test/java/org/opensearch/index/shard/RemoteIndexShardTests.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,20 @@ public void testReplicaCommitsInfosBytesOnRecovery() throws Exception {
231231
RemoteSegmentStoreDirectory remoteSegmentStoreDirectory =
232232
(RemoteSegmentStoreDirectory) ((FilterDirectory) ((FilterDirectory) primary.remoteStore().directory()).getDelegate())
233233
.getDelegate();
234-
assertEquals(
235-
"Latest remote commit contains expected segment files",
236-
Set.of("_0.cfe", "_0.si", "_0.cfs"),
237-
remoteSegmentStoreDirectory.readLatestMetadataFile().getMetadata().keySet()
238-
);
234+
235+
if (primary.isRefreshSegmentUploadDecouplingEnabled()) {
236+
assertEquals(
237+
"Latest remote commit contains expected segment files",
238+
Set.of("_0.cfe", "_0.si", "_0.cfs"),
239+
remoteSegmentStoreDirectory.readLatestMetadataFile().getMetadata().keySet()
240+
);
241+
} else {
242+
assertEquals(
243+
"Latest remote commit contains expected segment files",
244+
Set.of("_0.cfe", "_0.si", "_0.cfs", "segments_3"),
245+
remoteSegmentStoreDirectory.readLatestMetadataFile().getMetadata().keySet()
246+
);
247+
}
239248

240249
try (final GatedCloseable<SegmentInfos> segmentInfosSnapshot = primaryEngine.getSegmentInfosSnapshot()) {
241250
MatcherAssert.assertThat(

server/src/test/java/org/opensearch/index/shard/ReplicaRecoveryWithRemoteTranslogOnPrimaryTests.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ public void testNoTranslogHistoryTransferred() throws Exception {
126126
primary.awaitRemoteStoreSync();
127127
List<DocIdSeqNoAndSource> docIdAndSeqNosAfterFlush = getDocIdAndSeqNos(primary);
128128
int moreDocs = shards.indexDocs(randomIntBetween(20, 100));
129-
assertEquals(moreDocs, getTranslog(primary).totalOperations());
129+
130+
if (primary.isRefreshSegmentUploadDecouplingEnabled()) {
131+
assertEquals(moreDocs, getTranslog(primary).totalOperations());
132+
} else {
133+
assertEquals(moreDocs + numDocs, getTranslog(primary).totalOperations());
134+
}
130135

131136
// Step 2 - Start replica, recovery happens, check docs recovered till last flush
132137
final IndexShard replica = shards.addReplica(remoteDir);

0 commit comments

Comments
 (0)