Skip to content

feat(merge-tree): initial implementation of obliterate#12578

Merged
connorskees merged 134 commits into
microsoft:nextfrom
connorskees:feat/obliterate
Nov 22, 2023
Merged

feat(merge-tree): initial implementation of obliterate#12578
connorskees merged 134 commits into
microsoft:nextfrom
connorskees:feat/obliterate

Conversation

@connorskees
Copy link
Copy Markdown
Contributor

@connorskees connorskees commented Oct 19, 2022

Description

Implements the obliterate op.

ado 2115

@github-actions github-actions Bot added area: dds Issues related to distributed data structures area: dds: sharedstring area: tests Tests to add, test infrastructure improvements, etc public api change Changes to a public API base: main PRs targeted against main branch labels Oct 19, 2022
@connorskees connorskees requested a review from Abe27342 October 19, 2022 13:20
Copy link
Copy Markdown
Contributor

@Abe27342 Abe27342 left a comment

Choose a reason for hiding this comment

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

overall this looks really solid, I have a lot of mostly superficial feedback. I think continuing to chug through fuzz tests on eventual consistency is the right path.

Comment thread api-report/sequence.api.md Outdated
Comment thread packages/dds/merge-tree/src/client.ts Outdated
Comment thread packages/dds/merge-tree/src/client.ts Outdated
Comment thread packages/dds/merge-tree/src/client.ts Outdated
Comment thread packages/dds/merge-tree/src/client.ts Outdated
Comment thread packages/dds/merge-tree/src/mergeTree.ts Outdated
Comment thread packages/dds/merge-tree/src/mergeTree.ts Outdated
Comment thread packages/dds/merge-tree/src/mergeTree.ts Outdated
Comment thread packages/dds/merge-tree/src/mergeTree.ts Outdated
Comment thread packages/dds/merge-tree/src/partialLengths.ts Outdated
@github-actions github-actions Bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct and removed area: tests Tests to add, test infrastructure improvements, etc labels Oct 21, 2022
@connorskees connorskees force-pushed the feat/obliterate branch 3 times, most recently from 871dd3a to 350f42c Compare November 29, 2022 18:48
Copy link
Copy Markdown
Contributor

@Abe27342 Abe27342 left a comment

Choose a reason for hiding this comment

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

have got through everything except partial lengths. so far all looks good, only nits (would be OK with addressing all current comments in follow-up PR, and that might be simpler given how awful github UI is with long-running PRs)

});

// todo: a failing obliterate reconnect test. when rebasing the op,
// the character "C" has been concurrently obliterated, so the reconnect
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the test setup seems reasonable and like something that's easy to get wrong, but I don't follow the comment here. It looks like we should be rebasing the obliterate op itself, so I'm not sure what's meant by "reconnect position of 'B'" or why it should be 0 or 1.

I would have expected something like:

while rebasing obliterate(0, 2), we:

  • rebase position 0 in original context to wherever it is now (still 0)
  • rebase position 2 in original context to wherever it is now (will be 3)

of course this is done with segment groups which is a bit different, so i'm not sure I'd write it like that in the code. My point is I'm not sure where the "computed to be 0, rather than 1" comes from.

Comment thread packages/dds/merge-tree/api-report/merge-tree.api.md
export const removeRange: TestOperation = (client: TestClient, opStart: number, opEnd: number) =>
client.removeRangeLocal(opStart, opEnd);

export const obliterateRange: TestOperation = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there some followup work tracking adding this to some of the merge-tree farms?

(this needs to be referenced by the operations field of IMergeTreeOperationRunnerConfig)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The farms largely fall under AB#3714 (reconnect) and AB#3715 (local references)

Comment thread packages/dds/merge-tree/src/snapshotV1.ts Outdated

if (minSeq > this.collabWindow.minSeq) {
this.collabWindow.minSeq = minSeq;
const firstMoveSeqIdx = this.moveSeqs.findIndex((seq) => seq >= minSeq);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you document on this.moveSeqs that this array is sorted? Otherwise this implementation doesn't work.

You could shortcut the iteration here too, but not really a big deal (the tradeoff for smaller code size might actually be worth it).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm I'm not sure what iteration you mean. findIndex would exit early as soon as it finds a seq gte minSeq, no? I do think this should probably be binary search at some point.

Comment thread packages/dds/merge-tree/src/mergeTree.ts Outdated
Comment thread packages/dds/merge-tree/src/mergeTree.ts Outdated
Comment thread packages/dds/merge-tree/src/partialLengths.ts
Comment thread packages/dds/merge-tree/src/partialLengths.ts
Comment thread packages/dds/merge-tree/src/partialLengths.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dds: sharedstring area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: next PRs targeted against next branch dependencies Pull requests that update a dependency file public api change Changes to a public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants