-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Always use soft-deletes in InternalEngine #50415
Conversation
Pinging @elastic/es-distributed (:Distributed/Engine) |
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.
Looking good. Thanks @dnhatn!
server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java
Outdated
Show resolved
Hide resolved
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.
I also wonder how the changes here impacts ReadOnlyEngine
which has a special wrapper for soft-deleted indices.
Good call. Wrapping a hard-deletes reader in a soft-deletes reader is safe and trivial. We should always do it. I think I need to go through the usage of the method |
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.
Can you follow this up with a test that checks migration of frozen indices (i.e. full-cluster-upgrade test) from soft-deletes disabled to enabled? Just to be sure that ReadOnlyEngine
works correctly after upgrading from non-soft-deleted indices.
Sure, will do. Thank you for reviewing :). |
The InternalEngine always enables soft deletes in 8.0 regardless of the setting. We need to wait for the global checkpoint and peer recovery retention leases to be synced in these tests. Relates #50415
The test "testRecoverFromHardDeletesIndex" failed because the "min_retained_seqno" commit tag exists after we index using a hard-deletes engine. A hard-deletes engine must not create this commit tag; hence we need to remove it in the test. Relates #50415
Peer recoveries become faster and use less storage (i.e., no more extra translog) with soft-deletes. Soft-deletes has been enabled by default since 7.0. We should make it mandatory in 8.0, so we can simplify the logic in the engine, recoveries, and other components. With this change, InternalEngine will always use soft-deletes regardless of the soft_deletes settings.
The InternalEngine always enables soft deletes in 8.0 regardless of the setting. We need to wait for the global checkpoint and peer recovery retention leases to be synced in these tests. Relates elastic#50415
The test "testRecoverFromHardDeletesIndex" failed because the "min_retained_seqno" commit tag exists after we index using a hard-deletes engine. A hard-deletes engine must not create this commit tag; hence we need to remove it in the test. Relates elastic#50415
Peer recoveries become faster and use less storage (i.e., no more extra translog) with soft-deletes. Soft-deletes has been enabled by default since 7.0. We should make it mandatory in 8.0, so we can simplify the logic in the engine, recoveries, and other components.
With this change, InternalEngine will always use soft-deletes regardless of the soft_deletes settings.
This PR will go to 8.0 only. I will open another PR to deprecate the soft_deletes setting (and adapt this change in other components).