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

Always use soft-deletes in InternalEngine #50415

Merged
merged 10 commits into from
Dec 26, 2019

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Dec 20, 2019

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).

@dnhatn dnhatn added >enhancement :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0 labels Dec 20, 2019
@dnhatn dnhatn requested a review from ywelsch December 20, 2019 05:38
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Engine)

Copy link
Contributor

@ywelsch ywelsch left a 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!

@dnhatn dnhatn requested a review from ywelsch December 20, 2019 16:51
Copy link
Contributor

@ywelsch ywelsch left a 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.

@dnhatn
Copy link
Member Author

dnhatn commented Dec 20, 2019

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 isSoftDeleteEnabled() more.

@dnhatn dnhatn requested a review from ywelsch December 24, 2019 14:10
Copy link
Contributor

@ywelsch ywelsch left a 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.

@dnhatn
Copy link
Member Author

dnhatn commented Dec 26, 2019

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 :).

@dnhatn dnhatn merged commit 424ed93 into elastic:master Dec 26, 2019
@dnhatn dnhatn deleted the enable-soft-deletes branch December 26, 2019 14:02
dnhatn added a commit that referenced this pull request Dec 27, 2019
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
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Dec 29, 2019
dnhatn added a commit that referenced this pull request Dec 29, 2019
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
@dnhatn dnhatn mentioned this pull request Jan 9, 2020
14 tasks
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
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.
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
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
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants