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

[Remote Store] Change remote_store setting validation message to make it more clear #4199

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@ public void validate(final Boolean value, final Map<Setting<?>, Object> settings
final Object replicationType = settings.get(INDEX_REPLICATION_TYPE_SETTING);
if (replicationType != ReplicationType.SEGMENT && value == true) {
throw new IllegalArgumentException(
"Settings "
"To enable "
+ INDEX_REMOTE_STORE_ENABLED_SETTING.getKey()
+ " cannot be enabled when "
+ ", "
+ INDEX_REPLICATION_TYPE_SETTING.getKey()
+ " is set to "
+ settings.get(INDEX_REPLICATION_TYPE_SETTING)
+ " should be set to "
+ ReplicationType.SEGMENT
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,7 @@ public void testEnablingRemoteStoreFailsWhenReplicationTypeIsDocument() {
IllegalArgumentException.class,
() -> IndexMetadata.INDEX_REMOTE_STORE_ENABLED_SETTING.get(indexSettings)
);
assertEquals(
"Settings index.remote_store.enabled cannot be enabled when index.replication.type is set to DOCUMENT",
iae.getMessage()
);
assertEquals("To enable index.remote_store.enabled, index.replication.type should be set to SEGMENT", iae.getMessage());
}

public void testEnablingRemoteStoreFailsWhenReplicationTypeIsDefault() {
Expand All @@ -877,9 +874,6 @@ public void testEnablingRemoteStoreFailsWhenReplicationTypeIsDefault() {
IllegalArgumentException.class,
() -> IndexMetadata.INDEX_REMOTE_STORE_ENABLED_SETTING.get(indexSettings)
);
assertEquals(
"Settings index.remote_store.enabled cannot be enabled when index.replication.type is set to DOCUMENT",
iae.getMessage()
);
assertEquals("To enable index.remote_store.enabled, index.replication.type should be set to SEGMENT", iae.getMessage());
}
}