Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance searchable snapshots to enable a read-only view of older snapshots #5429

Merged
merged 10 commits into from
Jan 5, 2023
Prev Previous commit
Next Next commit
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 <gkart@amazon.com>
  • Loading branch information
kartg committed Jan 4, 2023
commit 440b06651e7f409d846516b42b829103f2145ab6
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,8 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
isRemoteTranslogStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_TRANSLOG_STORE_ENABLED, false);
isRemoteSnapshot = IndexModule.Type.REMOTE_SNAPSHOT.match(this.settings);

if (isRemoteSnapshot) {
if (FeatureFlags.isEnabled(SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY)) {
extendedCompatibilitySnapshotVersion = SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY_MINIMUM_VERSION;
}
if (isRemoteSnapshot && FeatureFlags.isEnabled(SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY)) {
extendedCompatibilitySnapshotVersion = SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY_MINIMUM_VERSION;
}
this.searchThrottled = INDEX_SEARCH_THROTTLED.get(settings);
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ public void testNumDocs() throws IOException {

/**
* Tests whether old segments are readable and queryable based on the data documented
* in the README <a href="file:../../../../../resources/indices/bwc/testIndex-6.3.0.md">here</a>.
* in the README <a href="file:../../../../../resources/indices/bwc/es-6.3.0/README.md">here</a>.
*
* @throws IOException
*/
public void testReadSegmentInfosExtendedCompatibility() throws IOException {
final String pathToTestIndex = "/indices/bwc/testIndex-6.3.0.zip";
final String pathToTestIndex = "/indices/bwc/es-6.3.0/testIndex-es-6.3.0.zip";
final Version minVersion = LegacyESVersion.fromId(6000099);
Path tmp = createTempDir();
TestUtil.unzip(getClass().getResourceAsStream(pathToTestIndex), tmp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void testReadOldIndices() throws IOException {
IOUtils.close(engine, store);
// The index has one document in it, so the checkpoint cannot be NO_OPS_PERFORMED
final AtomicLong globalCheckpoint = new AtomicLong(0);
final String pathToTestIndex = "/indices/bwc/testIndex-6.3.0.zip";
final String pathToTestIndex = "/indices/bwc/es-6.3.0/testIndex-es-6.3.0.zip";
Path tmp = createTempDir();
TestUtil.unzip(getClass().getResourceAsStream(pathToTestIndex), tmp);
Store store = createStore(newFSDirectory(tmp));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ public void testSegmentReplicationDiff() {
@SuppressForbidden(reason = "sets the SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY feature flag")
public void testReadSegmentsFromOldIndices() throws IOException {
int expectedIndexCreatedVersionMajor = SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY_MINIMUM_VERSION.luceneVersion.major;
final String pathToTestIndex = "/indices/bwc/testIndex-6.3.0.zip";
final String pathToTestIndex = "/indices/bwc/es-6.3.0/testIndex-es-6.3.0.zip";
Path tmp = createTempDir();
TestUtil.unzip(getClass().getResourceAsStream(pathToTestIndex), tmp);
final ShardId shardId = new ShardId("index", "_na_", 1);
Expand Down Expand Up @@ -1295,7 +1295,7 @@ public void testReadSegmentsFromOldIndices() throws IOException {
}

public void testReadSegmentsFromOldIndicesFailure() throws IOException {
final String pathToTestIndex = "/indices/bwc/testIndex-6.3.0.zip";
final String pathToTestIndex = "/indices/bwc/es-6.3.0/testIndex-es-6.3.0.zip";
final ShardId shardId = new ShardId("index", "_na_", 1);
Path tmp = createTempDir();
TestUtil.unzip(getClass().getResourceAsStream(pathToTestIndex), tmp);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# README for _testIndex-6.3.0.zip_
# README for _testIndex-es-6.3.0.zip_

This zip file holds a Lucene index created using ElasticSearch 6.3.0.
It was created by running the underlying commands against a single-node cluster,
Expand Down