-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Make clean up files step configurable for peer-recovery of replicas #92490
Make clean up files step configurable for peer-recovery of replicas #92490
Conversation
Hi @tlrx, I've created a changelog YAML for you. |
Pinging @elastic/es-distributed (Team:Distributed) |
@@ -495,7 +495,9 @@ public void cleanFiles( | |||
final Store store = store(); | |||
store.incRef(); | |||
try { | |||
store.cleanupAndVerify("recovery CleanFilesRequestHandler", sourceMetadata); | |||
if (DiscoveryNode.isStateless(indexShard.indexSettings().getSettings()) == false || indexShard.routingEntry().primary()) { |
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 think we need to pass in the node settings, not the index settings to use that 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.
Documentation of IndexSettings#getSettings
mentions:
Returns the settings for this index. These settings contain the node and index level settings where
settings that are specified on both index and node level are overwritten by the index settings.
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.
So I think we're good here: I verified and it does contain the node settings.
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.
Sure, it will work, but seems more intuitive to use indexShard.indexSettings().getNodeSettings()
?
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.
Oh sorry, I misunderstood your previous comment. Sure, getNodeSettings
is more appropriate, thanks for pointing this.
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.
Skip the "clean up and verify" step at the end of files based peer-recovery for replicas.