Skip to content

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Mar 21, 2025

Description

In order to handle failures in doc level monitor fanout request construction during upgrades when nodes from old and new versions co-exist we create a dummy request if serde fails.

This situation occurs as new fields have been added without version check in monitor object which causes serde failures when doc level monitor execution starts on a node in older version and fans out to a node on a newer version with different serialization code.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@eirsep eirsep force-pushed the serde_fix branch 2 times, most recently from f0a7d8a to 19a6af8 Compare March 24, 2025 08:38
Signed-off-by: Surya Sashank Nistala <[email protected]>
sbcd90
sbcd90 previously approved these changes Mar 24, 2025
AWSHurneyt
AWSHurneyt previously approved these changes Mar 24, 2025
sin.readBoolean()
} catch (e: Exception) {
log.error("Error parsing boolean in Doc level monitor fanout request", e)
false
Copy link
Collaborator

Choose a reason for hiding this comment

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

How does it affect execution if we end up with the default value for these fields? It seems like we need some way to signal that the fanout should not execute if we encounter a deserialization error like this

Copy link
Member Author

Choose a reason for hiding this comment

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

we are not gonna use these fields. the alerting plugin will look for null check on index execution context opensearch-project/alerting#1815

Copy link
Member Author

Choose a reason for hiding this comment

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

added a flag to indicate serialization failed if any of the safeRead*() methods fail

riysaxen-amzn
riysaxen-amzn previously approved these changes Mar 24, 2025
@eirsep eirsep dismissed stale reviews from riysaxen-amzn, AWSHurneyt, and sbcd90 via d30dac5 March 25, 2025 00:13
engechas
engechas previously approved these changes Mar 25, 2025
concreteIndicesSeenSoFar: List<String>,
workflowRunContext: WorkflowRunContext?
workflowRunContext: WorkflowRunContext?,
hasSerializationFailed: Boolean? = null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be passable via a constructor?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will update

}
}
return indexExecutionContext
} catch (e: EOFException) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we set serializationFailedFlag = true in this catch as well?

sbcd90
sbcd90 previously approved these changes Mar 25, 2025
Signed-off-by: Surya Sashank Nistala <[email protected]>
@eirsep eirsep dismissed stale reviews from sbcd90 and engechas via d87d83e March 25, 2025 07:13
AWSHurneyt
AWSHurneyt previously approved these changes Mar 25, 2025
…t for Doc Level monitor fanout request

Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
// read and discard bytes until stream is entirely consumed
try {
sin.readByte()
} catch (_: EOFException) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we log here as well?

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.

5 participants