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

Fix inconsistency after InstallSnapshot #128

Merged
merged 32 commits into from
Mar 15, 2022

Conversation

negokaz
Copy link
Contributor

@negokaz negokaz commented Feb 16, 2022

Closes #127

Overview

  • Introduce new event SnapshotCopied that SnapshotSyncManager saves after copying snapshots
    • This event contains entityIds that indicate that the snapshot that was copied
    • Tags this event with EntitySnapshotsUpdatedTag(CompactionCompletedTag)
    • This tagging allows that follower's SnapshotSyncManager reads SnapshotCopieds that the leader's SnapshotSyncManager persisted
    • Follower members can know updated snapshots with SnapshotCopied that produced by snapshot synchronization that the leader has executed
  • SnapshotSyncManager reads CompactionCompleted and also SnapshotCopied
    • SnapshotSyncManager can identify all entityIds that should copy snapshots

NOTE

This change does not fix the potential consistency problem.
Systems that already have executed InstallSnapshot may still occur this issue even if applying this change.

Taichi Yamakawa and others added 19 commits February 15, 2022 08:27
The snapshot synchronization should retrieve snapshots installed by another synchronization.
This event indicates that the snapshots has been updated by snapshot synchronization.
The other member which receives InstallSnapshot from this member will read the event.
@negokaz negokaz force-pushed the fix-inconsistency-after-installsnapshot branch from 748c664 to c1ed3d3 Compare February 16, 2022 04:42
@negokaz negokaz marked this pull request as ready for review February 16, 2022 04:43
@xirc xirc self-requested a review February 17, 2022 01:51
Copy link
Contributor

@xirc xirc left a comment

Choose a reason for hiding this comment

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

Great👍

I left some comments. I will review SnapshotSyncManagerSpec and RaftEventJournalTestKitSpec from now.

Taichi Yamakawa and others added 2 commits February 17, 2022 18:47
The override path should be "lerna.akka.entityreplication.raft.election-timeout".
Copy link
Contributor

@xirc xirc left a comment

Choose a reason for hiding this comment

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

Test code RaftEventJournalTestKitSpec and SnapshotSyncManagerSpec LGTM 👍

@negokaz negokaz force-pushed the fix-inconsistency-after-installsnapshot branch from 1f6df99 to ba4a77c Compare February 18, 2022 04:57
xirc
xirc previously approved these changes Feb 18, 2022
Copy link
Contributor

@xirc xirc left a comment

Choose a reason for hiding this comment

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

Excellent! LGTM 👍

@xirc xirc enabled auto-merge February 18, 2022 07:14
Copy link
Contributor

@xirc xirc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@xirc xirc merged commit 71c1cef into master Mar 15, 2022
@xirc xirc deleted the fix-inconsistency-after-installsnapshot branch March 15, 2022 02:36
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.

InstallSnapshot can cause inconsistency (Entity grasp is insufficient)
2 participants