Skip to content

Commit 85b85b1

Browse files
authored
Enhance searchable snapshots to enable a read-only view of older snapshots (#5429)
* Enhance searchable snapshots to enable a read-only view of older snapshots This change removes the guardrails around N-1 backward compatibility and uses Lucene's "expert" APIs to read snapshots (Lucene segments) older than N-1 on a best-effort basis. The functionality is gated by an additional feature flag, separate from the searchable snapshots flag. Note that the Lucene integration is rather inefficient because the necessary "expert" Lucene APIs are still package-private. Signed-off-by: Kartik Ganesh <[email protected]> * Added some unit tests This change also includes a test index ZIP file for the unit tests. The change also introduces a bug fix in the readAnySegmentsInfo method to close the reader before returning the SegmentInfos object - this avoids dangling/open file handles. Signed-off-by: Kartik Ganesh <[email protected]> * Incorporating PR feedback Signed-off-by: Kartik Ganesh <[email protected]> * Incorporate PR comments from andrross Signed-off-by: Kartik Ganesh <[email protected]> * Remove use of IndexSetting for minimum version for snapshots backwards compatibility Signed-off-by: Kartik Ganesh <[email protected]> * Moved ES 6.3.0 test data to a subdirectory This change also includes an update to the file name to clarify that it is an ES index, and changing the associated markdown file name to just README.md. All tests that reference this ZIP file have corresponding changes to the path they reference. Signed-off-by: Kartik Ganesh <[email protected]> * Update unit tests to use try-with-resources Signed-off-by: Kartik Ganesh <[email protected]> * Added FeatureFlagSetter helper class Also refactored unit test classes to use the helper class. Signed-off-by: Kartik Ganesh <[email protected]> * Incorporating PR feedback from @mch2 Signed-off-by: Kartik Ganesh <[email protected]> * Fix IndexSettingsTests Updated the asserts in IndexSettingsTests to account for the new defaulting behavior. Signed-off-by: Kartik Ganesh <[email protected]> Signed-off-by: Kartik Ganesh <[email protected]>
1 parent 53a4cae commit 85b85b1

File tree

28 files changed

+554
-86
lines changed

28 files changed

+554
-86
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1818
- Added experimental support for extensions ([#5347](https://github.com/opensearch-project/OpenSearch/pull/5347)), ([#5518](https://github.com/opensearch-project/OpenSearch/pull/5518)), ([#5597](https://github.com/opensearch-project/OpenSearch/pull/5597)), ([#5615](https://github.com/opensearch-project/OpenSearch/pull/5615)))
1919
- Add CI bundle pattern to distribution download ([#5348](https://github.com/opensearch-project/OpenSearch/pull/5348))
2020
- Added @gbbafna as an OpenSearch maintainer ([#5668](https://github.com/opensearch-project/OpenSearch/pull/5668))
21+
- Experimental support for extended backward compatiblity in searchable snapshots ([#5429](https://github.com/opensearch-project/OpenSearch/pull/5429))
2122

2223
### Dependencies
2324
- Bump bcpg-fips from 1.0.5.1 to 1.0.7.1 ([#5148](https://github.com/opensearch-project/OpenSearch/pull/5148))

server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,7 @@ public Builder addBlocks(IndexMetadata indexMetadata) {
394394
if (IndexMetadata.INDEX_BLOCKS_READ_ONLY_ALLOW_DELETE_SETTING.get(indexMetadata.getSettings())) {
395395
addIndexBlock(indexName, IndexMetadata.INDEX_READ_ONLY_ALLOW_DELETE_BLOCK);
396396
}
397-
if (IndexModule.Type.REMOTE_SNAPSHOT.getSettingsKey()
398-
.equals(indexMetadata.getSettings().get(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()))) {
397+
if (IndexModule.Type.REMOTE_SNAPSHOT.match(indexMetadata.getSettings().get(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()))) {
399398
addIndexBlock(indexName, IndexMetadata.REMOTE_READ_ONLY_ALLOW_DELETE);
400399
}
401400
return this;

server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1825,10 +1825,11 @@ public static IndexMetadata fromXContent(XContentParser parser) throws IOExcepti
18251825
throw new IllegalArgumentException("Unexpected token " + token);
18261826
}
18271827
}
1828-
if (Assertions.ENABLED) {
1828+
// Reference:
1829+
// https://github.com/opensearch-project/OpenSearch/blob/4dde0f2a3b445b2fc61dab29c5a2178967f4a3e3/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java#L1620-L1628
1830+
Version legacyVersion = LegacyESVersion.fromId(6050099);
1831+
if (Assertions.ENABLED && Version.indexCreated(builder.settings).onOrAfter(legacyVersion)) {
18291832
assert mappingVersion : "mapping version should be present for indices";
1830-
}
1831-
if (Assertions.ENABLED) {
18321833
assert settingsVersion : "settings version should be present for indices";
18331834
}
18341835
if (Assertions.ENABLED && Version.indexCreated(builder.settings).onOrAfter(LegacyESVersion.V_7_2_0)) {

server/src/main/java/org/opensearch/cluster/routing/RoutingPool.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static RoutingPool getShardPool(ShardRouting shard, RoutingAllocation all
6161
*/
6262
public static RoutingPool getIndexPool(IndexMetadata indexMetadata) {
6363
Settings indexSettings = indexMetadata.getSettings();
64-
if (IndexModule.Type.REMOTE_SNAPSHOT.getSettingsKey().equals(indexSettings.get(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()))) {
64+
if (IndexModule.Type.REMOTE_SNAPSHOT.match(indexSettings.get(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()))) {
6565
return REMOTE_CAPABLE;
6666
}
6767
return LOCAL_ONLY;

server/src/main/java/org/opensearch/common/lucene/Lucene.java

+20
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import org.apache.lucene.index.SortedDocValues;
6868
import org.apache.lucene.index.SortedNumericDocValues;
6969
import org.apache.lucene.index.SortedSetDocValues;
70+
import org.apache.lucene.index.StandardDirectoryReader;
7071
import org.apache.lucene.index.StoredFieldVisitor;
7172
import org.apache.lucene.index.Terms;
7273
import org.apache.lucene.index.VectorValues;
@@ -162,6 +163,25 @@ public static SegmentInfos readSegmentInfos(Directory directory) throws IOExcept
162163
return SegmentInfos.readLatestCommit(directory);
163164
}
164165

166+
/**
167+
* A variant of {@link #readSegmentInfos(Directory)} that supports reading indices written by
168+
* older major versions of Lucene. The underlying implementation is a workaround since the
169+
* "expert" readLatestCommit API is currently package-private in Lucene. First, all commits in
170+
* the given {@link Directory} are listed - this result includes older Lucene commits. Then,
171+
* the latest index commit is opened via {@link DirectoryReader} by including a minimum supported
172+
* Lucene major version based on the minimum compatibility of the given {@link org.opensearch.Version}.
173+
*/
174+
public static SegmentInfos readSegmentInfosExtendedCompatibility(Directory directory, org.opensearch.Version minimumVersion)
175+
throws IOException {
176+
// This list is sorted from oldest to latest
177+
List<IndexCommit> indexCommits = DirectoryReader.listCommits(directory);
178+
IndexCommit latestCommit = indexCommits.get(indexCommits.size() - 1);
179+
final int minSupportedLuceneMajor = minimumVersion.minimumIndexCompatibilityVersion().luceneVersion.major;
180+
try (StandardDirectoryReader reader = (StandardDirectoryReader) DirectoryReader.open(latestCommit, minSupportedLuceneMajor, null)) {
181+
return reader.getSegmentInfos();
182+
}
183+
}
184+
165185
/**
166186
* Returns an iterable that allows to iterate over all files in this segments info
167187
*/

server/src/main/java/org/opensearch/common/util/FeatureFlags.java

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ public class FeatureFlags {
3737
*/
3838
public static final String SEARCHABLE_SNAPSHOT = "opensearch.experimental.feature.searchable_snapshot.enabled";
3939

40+
/**
41+
* Gates the ability for Searchable Snapshots to read snapshots that are older than the
42+
* guaranteed backward compatibility for OpenSearch (one prior major version) on a best effort basis.
43+
*/
44+
public static final String SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY =
45+
"opensearch.experimental.feature.searchable_snapshot.extended_compatibility.enabled";
46+
4047
/**
4148
* Gates the functionality of extensions.
4249
* Once the feature is ready for production release, this feature flag can be removed.

server/src/main/java/org/opensearch/index/IndexModule.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,19 @@ public boolean match(String setting) {
459459
}
460460

461461
/**
462-
* Convenience method to check whether the given IndexSettings contains
463-
* an {@link #INDEX_STORE_TYPE_SETTING} set to the value of this type.
462+
* Convenience method to check whether the given {@link IndexSettings}
463+
* object contains an {@link #INDEX_STORE_TYPE_SETTING} set to the value of this type.
464464
*/
465465
public boolean match(IndexSettings settings) {
466-
return match(INDEX_STORE_TYPE_SETTING.get(settings.getSettings()));
466+
return match(settings.getSettings());
467+
}
468+
469+
/**
470+
* Convenience method to check whether the given {@link Settings}
471+
* object contains an {@link #INDEX_STORE_TYPE_SETTING} set to the value of this type.
472+
*/
473+
public boolean match(Settings settings) {
474+
return match(INDEX_STORE_TYPE_SETTING.get(settings));
467475
}
468476
}
469477

server/src/main/java/org/opensearch/index/IndexSettings.java

+28
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.opensearch.common.unit.ByteSizeUnit;
4747
import org.opensearch.common.unit.ByteSizeValue;
4848
import org.opensearch.common.unit.TimeValue;
49+
import org.opensearch.common.util.FeatureFlags;
4950
import org.opensearch.index.translog.Translog;
5051
import org.opensearch.indices.replication.common.ReplicationType;
5152
import org.opensearch.ingest.IngestService;
@@ -60,11 +61,13 @@
6061
import java.util.function.Function;
6162
import java.util.function.UnaryOperator;
6263

64+
import static org.opensearch.common.util.FeatureFlags.SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY;
6365
import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_DEPTH_LIMIT_SETTING;
6466
import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING;
6567
import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_NESTED_DOCS_LIMIT_SETTING;
6668
import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING;
6769
import static org.opensearch.index.mapper.MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING;
70+
import static org.opensearch.index.store.remote.directory.RemoteSnapshotDirectory.SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY_MINIMUM_VERSION;
6871

6972
/**
7073
* This class encapsulates all index level settings and handles settings updates.
@@ -585,6 +588,8 @@ public final class IndexSettings {
585588
private final boolean isRemoteStoreEnabled;
586589
private final String remoteStoreRepository;
587590
private final boolean isRemoteTranslogStoreEnabled;
591+
private final boolean isRemoteSnapshot;
592+
private Version extendedCompatibilitySnapshotVersion;
588593
// volatile fields are updated via #updateIndexMetadata(IndexMetadata) under lock
589594
private volatile Settings settings;
590595
private volatile IndexMetadata indexMetadata;
@@ -747,6 +752,13 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
747752
isRemoteStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, false);
748753
remoteStoreRepository = settings.get(IndexMetadata.SETTING_REMOTE_STORE_REPOSITORY);
749754
isRemoteTranslogStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_TRANSLOG_STORE_ENABLED, false);
755+
isRemoteSnapshot = IndexModule.Type.REMOTE_SNAPSHOT.match(this.settings);
756+
757+
if (isRemoteSnapshot && FeatureFlags.isEnabled(SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY)) {
758+
extendedCompatibilitySnapshotVersion = SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY_MINIMUM_VERSION;
759+
} else {
760+
extendedCompatibilitySnapshotVersion = Version.CURRENT.minimumIndexCompatibilityVersion();
761+
}
750762
this.searchThrottled = INDEX_SEARCH_THROTTLED.get(settings);
751763
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);
752764
this.queryStringAnalyzeWildcard = QUERY_STRING_ANALYZE_WILDCARD.get(nodeSettings);
@@ -1012,6 +1024,22 @@ public boolean isRemoteTranslogStoreEnabled() {
10121024
return isRemoteTranslogStoreEnabled;
10131025
}
10141026

1027+
/**
1028+
* Returns true if this is remote/searchable snapshot
1029+
*/
1030+
public boolean isRemoteSnapshot() {
1031+
return isRemoteSnapshot;
1032+
}
1033+
1034+
/**
1035+
* If this is a remote snapshot and the extended compatibility
1036+
* feature flag is enabled, this returns the minimum {@link Version}
1037+
* supported. In all other cases, the return value is null.
1038+
*/
1039+
public Version getExtendedCompatibilitySnapshotVersion() {
1040+
return extendedCompatibilitySnapshotVersion;
1041+
}
1042+
10151043
/**
10161044
* Returns the node settings. The settings returned from {@link #getSettings()} are a merged version of the
10171045
* index settings and the node settings where node settings are overwritten by index settings.

server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java

+19-2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public class ReadOnlyEngine extends Engine {
9393
private final CompletionStatsCache completionStatsCache;
9494
private final boolean requireCompleteHistory;
9595
private final TranslogManager translogManager;
96+
private final Version minimumSupportedVersion;
9697

9798
protected volatile TranslogStats translogStats;
9899

@@ -119,6 +120,8 @@ public ReadOnlyEngine(
119120
) {
120121
super(config);
121122
this.requireCompleteHistory = requireCompleteHistory;
123+
// fetch the minimum Version for extended backward compatibility use-cases
124+
this.minimumSupportedVersion = config.getIndexSettings().getExtendedCompatibilitySnapshotVersion();
122125
try {
123126
Store store = config.getStore();
124127
store.incRef();
@@ -130,7 +133,11 @@ public ReadOnlyEngine(
130133
// we obtain the IW lock even though we never modify the index.
131134
// yet this makes sure nobody else does. including some testing tools that try to be messy
132135
indexWriterLock = obtainLock ? directory.obtainLock(IndexWriter.WRITE_LOCK_NAME) : null;
133-
this.lastCommittedSegmentInfos = Lucene.readSegmentInfos(directory);
136+
if (isExtendedCompatibility()) {
137+
this.lastCommittedSegmentInfos = Lucene.readSegmentInfosExtendedCompatibility(directory, this.minimumSupportedVersion);
138+
} else {
139+
this.lastCommittedSegmentInfos = Lucene.readSegmentInfos(directory);
140+
}
134141
if (seqNoStats == null) {
135142
seqNoStats = buildSeqNoStats(config, lastCommittedSegmentInfos);
136143
ensureMaxSeqNoEqualsToGlobalCheckpoint(seqNoStats);
@@ -223,7 +230,17 @@ protected final OpenSearchDirectoryReader wrapReader(
223230

224231
protected DirectoryReader open(IndexCommit commit) throws IOException {
225232
assert Transports.assertNotTransportThread("opening index commit of a read-only engine");
226-
return new SoftDeletesDirectoryReaderWrapper(DirectoryReader.open(commit), Lucene.SOFT_DELETES_FIELD);
233+
DirectoryReader reader;
234+
if (isExtendedCompatibility()) {
235+
reader = DirectoryReader.open(commit, this.minimumSupportedVersion.luceneVersion.major, null);
236+
} else {
237+
reader = DirectoryReader.open(commit);
238+
}
239+
return new SoftDeletesDirectoryReaderWrapper(reader, Lucene.SOFT_DELETES_FIELD);
240+
}
241+
242+
private boolean isExtendedCompatibility() {
243+
return Version.CURRENT.minimumIndexCompatibilityVersion().onOrAfter(this.minimumSupportedVersion);
227244
}
228245

229246
@Override

server/src/main/java/org/opensearch/index/shard/IndexShard.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ public void openEngineAndRecoverFromTranslog() throws IOException {
19841984
};
19851985

19861986
// Do not load the global checkpoint if this is a remote snapshot index
1987-
if (IndexModule.Type.REMOTE_SNAPSHOT.match(indexSettings) == false) {
1987+
if (indexSettings.isRemoteSnapshot() == false) {
19881988
loadGlobalCheckpointToReplicationTracker();
19891989
}
19901990

@@ -2039,7 +2039,7 @@ private void innerOpenEngineAndTranslog(LongSupplier globalCheckpointSupplier) t
20392039
}
20402040

20412041
private boolean assertSequenceNumbersInCommit() throws IOException {
2042-
final Map<String, String> userData = SegmentInfos.readLatestCommit(store.directory()).getUserData();
2042+
final Map<String, String> userData = fetchUserData();
20432043
assert userData.containsKey(SequenceNumbers.LOCAL_CHECKPOINT_KEY) : "commit point doesn't contains a local checkpoint";
20442044
assert userData.containsKey(MAX_SEQ_NO) : "commit point doesn't contains a maximum sequence number";
20452045
assert userData.containsKey(Engine.HISTORY_UUID_KEY) : "commit point doesn't contains a history uuid";
@@ -2054,6 +2054,16 @@ private boolean assertSequenceNumbersInCommit() throws IOException {
20542054
return true;
20552055
}
20562056

2057+
private Map<String, String> fetchUserData() throws IOException {
2058+
if (indexSettings.isRemoteSnapshot() && indexSettings.getExtendedCompatibilitySnapshotVersion() != null) {
2059+
// Inefficient method to support reading old Lucene indexes
2060+
return Lucene.readSegmentInfosExtendedCompatibility(store.directory(), indexSettings.getExtendedCompatibilitySnapshotVersion())
2061+
.getUserData();
2062+
} else {
2063+
return SegmentInfos.readLatestCommit(store.directory()).getUserData();
2064+
}
2065+
}
2066+
20572067
private void onNewEngine(Engine newEngine) {
20582068
assert Thread.holdsLock(engineMutex);
20592069
refreshListeners.setCurrentRefreshLocationSupplier(newEngine::getTranslogLastWriteLocation);

server/src/main/java/org/opensearch/index/store/Store.java

+28-2
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,21 @@ public Directory directory() {
221221
public SegmentInfos readLastCommittedSegmentsInfo() throws IOException {
222222
failIfCorrupted();
223223
try {
224-
return readSegmentsInfo(null, directory());
224+
if (indexSettings.isRemoteSnapshot() && indexSettings.getExtendedCompatibilitySnapshotVersion() != null) {
225+
return readSegmentInfosExtendedCompatibility(directory(), indexSettings.getExtendedCompatibilitySnapshotVersion());
226+
} else {
227+
return readSegmentsInfo(null, directory());
228+
}
225229
} catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException ex) {
226230
markStoreCorrupted(ex);
227231
throw ex;
228232
}
229233
}
230234

231235
/**
232-
* Returns the segments info for the given commit or for the latest commit if the given commit is <code>null</code>
236+
* Returns the segments info for the given commit or for the latest commit if the given commit is <code>null</code>.
237+
* This method will throw an exception if the index is older than the standard backwards compatibility
238+
* policy ( current major - 1). See also {@link #readSegmentInfosExtendedCompatibility(Directory, org.opensearch.Version)}.
233239
*
234240
* @throws IOException if the index is corrupted or the segments file is not present
235241
*/
@@ -245,7 +251,27 @@ private static SegmentInfos readSegmentsInfo(IndexCommit commit, Directory direc
245251
} catch (Exception ex) {
246252
throw new CorruptIndexException("Hit unexpected exception while reading segment infos", "commit(" + commit + ")", ex);
247253
}
254+
}
248255

256+
/**
257+
* Returns the segments info for the latest commit in the given directory. Unlike
258+
* {@link #readSegmentsInfo(IndexCommit, Directory)}, this method supports reading
259+
* older Lucene indices on a best-effort basis.
260+
*
261+
* @throws IOException if the index is corrupted or the segments file is not present
262+
*/
263+
private static SegmentInfos readSegmentInfosExtendedCompatibility(Directory directory, org.opensearch.Version minimumVersion)
264+
throws IOException {
265+
try {
266+
return Lucene.readSegmentInfosExtendedCompatibility(directory, minimumVersion);
267+
} catch (EOFException eof) {
268+
// TODO this should be caught by lucene - EOF is almost certainly an index corruption
269+
throw new CorruptIndexException("Read past EOF while reading segment infos", "<latest-commit>", eof);
270+
} catch (IOException exception) {
271+
throw exception; // IOExceptions like too many open files are not necessarily a corruption - just bubble it up
272+
} catch (Exception ex) {
273+
throw new CorruptIndexException("Hit unexpected exception while reading segment infos", "<latest-commit>", ex);
274+
}
249275
}
250276

251277
final void ensureOpen() {

server/src/main/java/org/opensearch/index/store/remote/directory/RemoteSnapshotDirectory.java

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.apache.lucene.store.IndexOutput;
2323
import org.apache.lucene.store.Lock;
2424
import org.apache.lucene.store.NoLockFactory;
25+
import org.opensearch.LegacyESVersion;
26+
import org.opensearch.Version;
2527
import org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot;
2628
import org.opensearch.index.store.remote.file.OnDemandBlockSnapshotIndexInput;
2729
import org.opensearch.index.store.remote.file.OnDemandVirtualFileSnapshotIndexInput;
@@ -35,6 +37,9 @@
3537
* @opensearch.internal
3638
*/
3739
public final class RemoteSnapshotDirectory extends Directory {
40+
41+
public static final Version SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY_MINIMUM_VERSION = LegacyESVersion.fromId(6000099);
42+
3843
private static final String VIRTUAL_FILE_PREFIX = BlobStoreRepository.VIRTUAL_DATA_BLOB_PREFIX;
3944

4045
private final Map<String, BlobStoreIndexShardSnapshot.FileInfo> fileInfoMap;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ private EngineFactory getEngineFactory(final IndexSettings idxSettings) {
887887
if (idxSettings.isSegRepEnabled()) {
888888
return new NRTReplicationEngineFactory();
889889
}
890-
if (IndexModule.Type.REMOTE_SNAPSHOT.match(idxSettings)) {
890+
if (idxSettings.isRemoteSnapshot()) {
891891
return config -> new ReadOnlyEngine(config, new SeqNoStats(0, 0, 0), new TranslogStats(), true, Function.identity(), false);
892892
}
893893
return new InternalEngineFactory();

0 commit comments

Comments
 (0)