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

Implement history node validation & trimming logic #1449

Merged
merged 4 commits into from Apr 14, 2021

Conversation

wxing1292
Copy link
Contributor

@wxing1292 wxing1292 commented Apr 9, 2021

What changed?

  • Implement TrimHistoryBranch API trimming stale history node
  • Add dedicated E2E UT for history events store

Why?
In case of mutable state inconsistency, either due to our bug or DB returning stale data, new (and invalid) history node with higher transaction ID will shadow the valid history node. Although update of mutable state is protected by CAS, the new (and invalid) history is still present in DB. TrimHistoryBranch API is introduced for to trim this kind of invalid history nodes.

How did you test it?
New tests

Potential risks
Core functionality modification, tested by new tests.

Is hotfix candidate?
No

* Add dedicated E2E UT for history events store
@wxing1292 wxing1292 marked this pull request as ready for review April 13, 2021 23:57
@wxing1292 wxing1292 requested a review from a team April 13, 2021 23:57
@wxing1292 wxing1292 enabled auto-merge (squash) April 13, 2021 23:58
common/persistence/history_node_util.go Outdated Show resolved Hide resolved
common/persistence/history_node_util.go Show resolved Hide resolved
return nodesToTrim, nil
}

func indexNodeIDToNode(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func indexNodeIDToNode(
func indexNodeIDToNodesMetadata(

common/persistence/history_node_util.go Outdated Show resolved Hide resolved
@alexshtin alexshtin disabled auto-merge April 14, 2021 05:09
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.

None yet

2 participants