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: Public reconciliation of a concurrent write and remove (of independent paths) #432

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

matheus23
Copy link
Member

This is an edge case I came across while implementing private conflict reconciliation.

Essentially we have this setup:

  • Both replicas share the same state of a single file, e.g. at "public/a/b.txt".
  • Then one replica deletes that file
  • The other replica does an unrelated write, e.g. it adds "public/file.txt"
  • Both replicas merge again

What happened previously was:

  • We detected that two independent writes were done on the root directory
  • We run a deep merge on both directories. The b.txt file gets re-introduced (the remove gets "overwritten"), because we don't re-check the causal relationship of the "a" directories.

We now check the causal relationship between directories on every level (recursively).

I also removed the merge function, as otherwise it'd be hard to disentangle the recursion, but that'd be needed to not duplicate the whole reconcile_helper and merge_helper functions.

Also: Add better debug impls for `PublicFile`, `PublicFile`, `PublicLink`, etc.
@matheus23 matheus23 self-assigned this Apr 25, 2024
@matheus23 matheus23 requested a review from a team as a code owner April 25, 2024 15:01
@matheus23 matheus23 enabled auto-merge (squash) April 25, 2024 15:02
@matheus23 matheus23 merged commit e265c94 into main Apr 25, 2024
12 checks passed
@matheus23 matheus23 deleted the matheus23/fix-public-reconciliation-case branch April 25, 2024 15:08
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.

1 participant