-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Add ElasticsearchIndexDeletionPolicy and EngineConfig policy wrapper #130442
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
base: main
Are you sure you want to change the base?
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.
Awesome work. Some early comments.
server/src/main/java/org/elasticsearch/index/engine/ElasticsearchIndexDeletionPolicy.java
Outdated
Show resolved
Hide resolved
|
||
public abstract boolean hasUnreferencedCommits(); | ||
|
||
public interface CommitsListener { |
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 was thinking about getting rid of this interface since we don't use it anymore, wdyt @kingherc? we can do in a follow-up once all the pieces are in place.
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.
Hi @fcofdez . Yes I believe it can be removed.
Separately, we were discussing whether IndexModule#setIndexCommitListener()
could be removed in this thread with @tlrx , feel free to read to see as well. I had a question whether someone, e.g., externally, like a plugin writer user, might have been using it, but we think no. So that may also be considered for removal. However, maybe an optional follow-up.
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
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
|
||
public abstract boolean hasUnreferencedCommits(); | ||
|
||
public interface CommitsListener { |
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.
Hi @fcofdez . Yes I believe it can be removed.
Separately, we were discussing whether IndexModule#setIndexCommitListener()
could be removed in this thread with @tlrx , feel free to read to see as well. I had a question whether someone, e.g., externally, like a plugin writer user, might have been using it, but we think no. So that may also be considered for removal. However, maybe an optional follow-up.
@@ -187,7 +180,7 @@ private void deleteCommit(IndexCommit commit) throws IOException { | |||
assert commit.isDeleted() == false : "Index commit [" + commitDescription(commit) + "] is deleted twice"; | |||
logger.debug("Delete index commit [{}]", commitDescription(commit)); | |||
commit.delete(); | |||
assert commit.isDeleted() : "Deletion commit [" + commitDescription(commit) + "] was suppressed"; | |||
// assert commit.isDeleted() : "Deletion commit [" + commitDescription(commit) + "] was suppressed"; |
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.
nit Reminder to remove or adjust (maybe leave the assertion in stateful)
This change adds a new abstract class ElasticsearchIndexDeletionPolicy that allows using different policy implementations for InternalEngine.
It also adds an index deletion policy wrapper to the EngineConfig to allow wrapping the default CombinedDeletionPolicy by inheritors of InternalEngine.
Relates ES-10929