-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 ClusterSearchShardsResponseTests#testSerialization #100557
Fix ClusterSearchShardsResponseTests#testSerialization #100557
Conversation
Pinging @elastic/es-search (Team:Search) |
Version nodeVersion = VersionUtils.randomVersion(random()); | ||
DiscoveryNodeUtils.Builder node = DiscoveryNodeUtils.builder(shardRouting.currentNodeId()) | ||
.address(new TransportAddress(TransportAddress.META_ADDRESS, randomInt(0xFFFF))) | ||
.version(nodeVersion, IndexVersion.getMinimumCompatibleIndexVersion(nodeVersion.id), IndexVersion.fromId(nodeVersion.id)); |
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.
For nodeVersion > 8.10, I fear that fromId could give you back a IndexVersion you are expecting.
I would use IndexVersionUtils.randomVersion()
if you want to introduce additional randomness, or IndexVersionUtils.current()
if you want something that covers all.
Nit: I would consider using IndexVersion.ZERO or IndexVersion.MINIMUM_COMPATIBLE for min.
CC @thecoop as he is the expert in this area.
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.
Yeah, you can't go from version -> indexversion. Using IndexVersion.MINIMUM_COMPATIBLE
and IndexVersion.current()
is the best bet here
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 serialization random versioning.
closes: #100289