-
Notifications
You must be signed in to change notification settings - Fork 537
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
Potential eventual consistency issues with SharedDirectory subdirectory deletion/creation #6069
Comments
DDS implementations are essentially OT algorithms, and thus the complexity is square of number of operations that are supported (actual types of OPs). Two generic questions:
|
This bug tracks making subdirectory creation/deletion eventually consistent, regardless of whether events are added. I'd prefer to track separately as the former is a data corruption bug whereas the latter is a feature ask to expand scenario support, so it's not obvious to me that we'd prioritize both equally or fix both in a single PR. I've noted in #8823 that its prerequisite is this bug. |
That's fine, but I think then #8823 should not start with consistency issue description and all such discussions should move here. Maybe other way to put it - if we are afraid to add events in current state, then we should remove ability to learn if sub-directory exists or not :) I.e., there should be no createSubDirectory() / getSubDirectory() / deleteSubDirectory() APIs, there should be only getOrCreateSubDirectory(): IDirectory, and no events (no way to observe existence of the tree structure, only leaf nodes). That's basically a map, with some sugar coating. |
My understanding is that longer-term, the Tree DDS may become the recommendation for most or all of the scenarios that sound Directory-like, at which point we may want to consider dropping Directory in order to present a clear Map/Tree choice for customers. I have no particular attachment to Directory, my priority is to ensure customers who say "I have hierarchical data that I want to collaborate on" have a clear best choice available. |
Assume a subdirectory
/foo
and supposing two users do the following:User1: Sets key
"bar"
to value"baz"
inside subdirectory "/foo"User2: Deletes subdirectory
/foo
User2: Creates a new subdirectory
/foo
// At this point, User1 sees 1 key in
/foo
and User2 sees 0 keys, which is OK since the messages have not been ordered/transmitted yet.Messages for the above are ordered and transmitted
// At this point, User1 sees 0 keys in
/foo
and User2 sees 1 key, which is not OK. Expected is that both see 0 keys.The issue being that User2 doesn't realize that they saw the
"bar"
set before they saw the ack of their subdirectory delete, and so will happily apply the set operation to the new subdirectory they just created rather than tossing it out as applying to the already-deleted subdirectory.Note that this could happen in other variations too:
/foo/bar/baz/woz
and User2 deletes/recreates the full chain ofbar/baz/woz
while User1 sets a key inwoz
./foo/bar
while User2 is deleting/recreating/foo
.Discovered by code inspection while looking at #6015.
The text was updated successfully, but these errors were encountered: