Skip to content
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

Handle data corruption error in replication #3895

Merged
merged 6 commits into from
Jan 14, 2021
Merged

Handle data corruption error in replication #3895

merged 6 commits into from
Jan 14, 2021

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Jan 14, 2021

What changed?
Update some internal service error to internal data inconsistency error and handle data corruption error in replication.

Why?
Those data inconsistency error could block the replication stack.

How did you test it?
Added unit tests.

Potential risks

@yux0 yux0 requested review from yycptt and a team January 14, 2021 00:21
@@ -176,11 +176,11 @@ func (h *nosqlHistoryManager) ReadHistoryBranch(

switch {
case nodeID < lastNodeID:
return nil, &types.InternalServiceError{
return nil, &types.InternalDataInconsistencyError{
Copy link
Contributor

@yycptt yycptt Jan 14, 2021

Choose a reason for hiding this comment

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

There're some more checks in historyStore.go regarding corrupted history. Can we also return this inconsistency error if those checks fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated those errors in the history store. I think there might be more cases to be converted. I don't plan to convert all of them in this change. We can continue with other changes.

Copy link
Contributor

@yycptt yycptt Jan 14, 2021

Choose a reason for hiding this comment

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

Sure thing. I mentioned those in historyStore because I saw them a lot in production logs. We can gradually convert the rest.

@yux0 yux0 merged commit 68c9cdf into master Jan 14, 2021
@yux0 yux0 deleted the data_corruption branch January 14, 2021 19:42
github-actions bot pushed a commit to vytautas-karpavicius/cadence that referenced this pull request Feb 4, 2021
yux0 added a commit to yux0/cadence that referenced this pull request May 4, 2021
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.

2 participants