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

Enforce soft deletes #1903

Merged
merged 2 commits into from
Jan 18, 2022
Merged

Conversation

nknize
Copy link
Collaborator

@nknize nknize commented Jan 14, 2022

This PR enforces soft deletes as required in 2.0.0.

relates #1674

This commit enforces soft deletes as required in 2.0.0.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@nknize nknize added enhancement Enhancement or improvement to existing feature or request v2.0.0 Version 2.0.0 labels Jan 14, 2022
@nknize nknize requested a review from a team as a code owner January 14, 2022 05:12
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 7f42949
Log 1917

Reports 1917

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 5f7d3f9
Log 1919

Reports 1919

@dblock dblock requested a review from andrross January 14, 2022 17:35
+ request.index()
+ "]."
if (IndexSettings.INDEX_SOFT_DELETES_SETTING.get(indexSettings) == false
&& IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(indexSettings).onOrAfter(Version.V_2_0_0)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused...this is server code that will run inside a version 2.0.0+ instance of the service. Why is this check necessary? Why can't the check just be

if (!IndexSettings.INDEX_SOFT_DELETES_SETTING.get(indexSettings)) {
    throw ...
}

Taking it a bit further, why can't we just remove the index.soft_deletes.enabled setting all together so that it cannot be specified since the soft delete behavior is not configurable?

Copy link
Collaborator

@reta reta Jan 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrross afaik when migrating from let say 1.x to 2.x, you could still use "old" index from 1.x in 2.x: in this case the version of the index will be 1.x, with all the settings implied. If we drop this check, the "old" indices would behave differently (or fail to load if we throw an exception).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So we'll continue to support the "soft delete disabled behavior" after this change because it is possible to migrate an index from an older version with index.soft_deletes.enabled=false to a 2.0+ version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is my understanding

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. We need to be able to support the parameter through 2.x for bwc purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request v2.0.0 Version 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants