-
Notifications
You must be signed in to change notification settings - Fork 115
change monitor fan out logic to handle empty request and checking node attributes before fanning out #1815
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
…e attributes before fanning out Signed-off-by: Surya Sashank Nistala <[email protected]>
if (candidateNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null && | ||
coordinatorNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null | ||
) { | ||
return candidateNodeAttributes["di_number"] as Int >= coordinatorNodeAttributes["di_number"] as Int |
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.
Is there a downside to keeping the fanout fully within the same DI (==
instead of >=
)? That seems like a safer approach than relying on backwards compatibility in newer DIs
@@ -207,6 +207,22 @@ class TransportDocLevelMonitorFanOutAction | |||
listener: ActionListener<DocLevelMonitorFanOutResponse> | |||
) { | |||
try { | |||
// handle situations where coordinator node is not on the same opensearch version or | |||
// from the same domain instance and return no-op response instead of failing entire fan-out | |||
if (request.indexExecutionContext == null) { |
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.
Checking this specific field for null seems brittle. Is there a more definitive way to see if the deserialization failed?
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.
+1
if (candidateNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null && | ||
coordinatorNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null |
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.
Not blocking:
I think the use of containsKey
and != null
would be redundant in this context.
if (candidateNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null && | ||
coordinatorNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null | ||
) { | ||
return candidateNodeAttributes["di_number"] as Int >= coordinatorNodeAttributes["di_number"] as Int |
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.
Would we want this to instead be an equalTo operator, or are we confident that the coodinator node will always be in the old di?
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.
yup going with ==
change monitor fan out logic to handle empty request and checking node attributes before fanning out
this handles upgrade situation where old version is fanning out to new version and encounters failure in request serialization to silently ignore processing the set of shards assigned