-
Notifications
You must be signed in to change notification settings - Fork 61
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
Validate that soft delete settings is enabled at leader #84
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if (!leaderSettings.getAsBoolean(IndexSettings.INDEX_SOFT_DELETES_SETTING.key, true)) { | ||
throw IllegalArgumentException("Cannot Replicate an index where the setting ${IndexSettings.INDEX_SOFT_DELETES_SETTING.key} is disabled") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like other static index settings this can be changed by closing and reopening index.
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html
Can we also validate this in resume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And add a corresponding integ test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting cannot be updated even after closing index. I have verified the same. Getting this on trying to add the setting: final my-index setting [index.soft_deletes.enabled], not updateable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for validating.
Signed-off-by: Sooraj Sinha <[email protected]>
Description
Replication should occur only when the setting
index.soft_deletes.enabled
is enabled for the leader index. It is enabled by default and can be set only at index creation. Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index-modules.htmlAdding validation to ensure that this setting is enabled for leader index before starting replication.
Tested by setting this to true while creating index. Got below exception:
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.