-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Infer target skip reason from older binlogs #6577
Conversation
Remove an assert that is too aggressive. When reading old binlogs the TargetSkipReason is not known, so TargetSkipReason.None is a valid state. We can do a best effort and infer the skip reason for format version 13. Fixes #6563
@@ -304,6 +304,13 @@ private BuildEventArgs ReadTargetSkippedEventArgs() | |||
condition = ReadOptionalString(); | |||
evaluatedCondition = ReadOptionalString(); | |||
originallySucceeded = ReadBoolean(); | |||
|
|||
// Attempt to infer skip reason from the data we have | |||
skipReason = condition != 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.
This is saying that if the condition was not null, the condition was false, which doesn't sound right.
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.
Yes, if the target was skipped because of the false condition, we store the condition which was false. If it was skipped for other reasons, the condition will be 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.
And if the condition was true, but we skipped it for another reason, condition would still be null instead of true? That's confusing, but ok.
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.
Yes, we only store the Condition if the target was skipped because of false condition ;)
@@ -304,6 +304,13 @@ private BuildEventArgs ReadTargetSkippedEventArgs() | |||
condition = ReadOptionalString(); | |||
evaluatedCondition = ReadOptionalString(); | |||
originallySucceeded = ReadBoolean(); | |||
|
|||
// Attempt to infer skip reason from the data we have | |||
skipReason = condition != 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.
And if the condition was true, but we skipped it for another reason, condition would still be null instead of true? That's confusing, but ok.
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 any way we can add a regression test here? Seems like we should really have tests that validate playing back binlogs of formats in the range [1,N)
but I don't know how we could collect sufficient examples of them.
Co-authored-by: Rainer Sigwald <[email protected]>
I've filed #6587 to track the work of adding tests for playing back binlogs of each version. I've had the same thoughts. |
Remove an assert that is too aggressive. When reading old binlogs the TargetSkipReason is not known, so TargetSkipReason.None is a valid state.
We can do a best effort and infer the skip reason for format version 13.
Fixes #6563