-
Notifications
You must be signed in to change notification settings - Fork 535
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
Fixes to eventual consistency of shared intervals, including significant LocalReference changes #10202
Conversation
Co-authored-by: Tony Murphy <anthony.murphy@microsoft.com>
…mework into slide_on_create
Looked at tests, not too many comments there. Obviously there are still some TODOs, but I'm ok with addressing them in follow-ups. |
What's the rationale for the explicit update of reference offsets on segment removal? I don't think we can come up with an eventually consistent scheme while doing that. If it's just to make sure the observed offset matches the segment's position in the SharedString, there is already logic which handles returning 0 in Here's an explicit fuzz test case (minimized, so pretty readable) which demonstrates why this strategy loses information: [
{
"type": "addText",
"index": 0,
"content": "ABCDEFGHIJ",
"stringId": "B"
},
{
"type": "synchronize"
},
{
"type": "addInterval",
"start": 6,
"end": 8,
"collectionName": "comments",
"stringId": "B",
"id": "7a5d683d-4b3e-44b3-8f91-e8f9d664de5a"
},
{
"type": "addText",
"index": 7,
"content": "XYZ",
"stringId": "B"
},
{
"type": "removeRange",
"start": 2,
"end": 10,
"stringId": "A"
},
{
"type": "synchronize"
}
] A needs to be able to slide the references added by B to the start and end of XYZ, respectively, but it won't know how to do this if it blindly sets both offsets to 0 upon acking them. (side note: I do think we will probably need to either expose a method which gets the offset ignoring segment removals, or push reference comparison + "split" knowledge somehow to the reference itself. There are a couple maintenance things which we do need to make sure we preserve that information) |
Co-authored-by: Abram Sanderson <Abram.sanderson@gmail.com>
Co-authored-by: Abram Sanderson <Abram.sanderson@gmail.com>
⯅ @fluid-example/bundle-size-tests: +6.74 KB
Baseline commit: f01e36f |
Slide to api
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.
REFERENCEPOSITIONS.md could use another once-over, but generally this looks great. Thanks for all your hard work on it :)
Implement new MergeTree LocalReference APIs to fix eventual consistency of SlideOnRemove LocalReferences.
Update SharedIntervals to use new APIs.
For more detailed documentation, see packages/dds/merge-tree/REFERENCEPOSITIONS.md