Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Mar 24, 2025

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

…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
Copy link
Collaborator

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) {
Copy link
Collaborator

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +17 to +18
if (candidateNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null &&
coordinatorNodeAttributes.containsKey("di_number") && candidateNodeAttributes["di_number"] != null
Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup going with ==

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants