-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Introduce Hybrid vector clock #786
Conversation
70ba504
to
3f54faa
Compare
1. Add synced vector map in document. 2. Add self vector clock in Change 3. Modify gc to work with min synced vector
1. Old actor id does't convert to new in syncedVectorMap 2. Change the gc criteria to RemovedAt
1. replace text edit's latestCreatedAtMapByActor with vector clock. 2. Fix gc timing in gc_test.go, because gc changed to use vectorclock 3. Because it is used in text edit, context includes current vector.
1. Fix MinSyncedVector and add relevant test. 2. Fix duplicate vectorClock updates due to pre `context` update commit. 3. Modify gc_test.go to fit hybrid vector clock, except detach test.
1. server store synced vector map in snapshot_info. 2. The client also receives vector clock when pulling pack from the snapshot, and replace it's vector map with pulled vector map.
df3d4d4
to
80f8987
Compare
Related to #789 |
1. Calculate minimum vector only when garbage is present. 2. Copy depth when inserting vector clocks into Change.
1. Now Change has detach flag. It used to delete vectorclock of detached Actor.
1. Now snapshot save latest vector clock not SVM. 2. Clients build their own SVM using the latest VectorClock in snapshots. - So client's SVM is not latest state, it doesn't know peer's vector clock. It need more check - This is due to the overhead of storing and transferring SVMs. #789
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #786 +/- ##
==========================================
- Coverage 50.71% 50.35% -0.37%
==========================================
Files 70 71 +1
Lines 10213 10397 +184
==========================================
+ Hits 5180 5235 +55
- Misses 4512 4632 +120
- Partials 521 530 +9 ☔ View full report in Codecov by Sentry. |
This approach is silly. - slow and behave like client. - Server track all logs of clients, so we don't need calculate min synced vector every time.
Terminology - change's vector clock -> vector clock - change's latest vector clock -> version vector - each document's vector clock -> version vector - min synced vector clock -> synced version vector - snapshot's vector clock -> latest version vector
This continues at #800. |
About Min Value and LCA: |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Address #723
Special notes for your reviewer:
https://hackmd.io/kfaV_ZAgSX-REVyKRnoU1Q?view
https://hackmd.io/ogc6dOGkRW-At6O8SmiDrg?both#3-vector-clock%EC%9D%98-%ED%95%84%EC%9A%94%EC%84%B1
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist: