-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix testAutoExpandIndicesDuringRollingUpgrade #50427
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
Fix testAutoExpandIndicesDuringRollingUpgrade #50427
Conversation
Pinging @elastic/es-distributed (:Distributed/Allocation) |
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 left a question
assertBusy(() -> { | ||
final int numberOfReplicas = Integer.parseInt( | ||
getIndexSettingsAsMap(indexName).get(IndexMetaData.SETTING_NUMBER_OF_REPLICAS).toString()); | ||
if (minimumNodeVersion.onOrAfter(Version.V_7_6_0)) { |
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.
Do we need the assertBusy()
if minimumNodeVersion.onOrAfter(Version.V_7_6_0)
or can we ensureGreen()
in that case?
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.
Thanks for the question. We actually don't need assertBusy at all (#30423 was already introduced in 6.4, I misremembered this).
The ensureGreen
is mostly for cosmetics. I've added it for the case where we are on 7.6.0+
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
Fixes the muted test "testAutoExpandIndicesDuringRollingUpgrade". We can't wait in the test for the index to be green, as we have put a filter exclusion into place that prevents all shards from being allocated after a node rejoins. Instead we check whether the correct auto-expansion has taken place. We need to do this in an assertBusy, as older versions of ES are not auto-expanding indices while a node is joining, but only doing this as a follow-up step.
Closes #50426