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

docs(tree): Update undo and detach trees docs #20754

Merged
merged 13 commits into from
May 15, 2024

Conversation

yann-achard-MS
Copy link
Contributor

@yann-achard-MS yann-achard-MS commented Apr 19, 2024

Description

Retire "repair data" terminology, and adopt "detached trees" instead.
Update the docs to match the current design.

Breaking Changes

None

Reviewer Guidance

I highly recommend ignoring the diff for v1-undo.md. Just read the whole file.

Future Work

Update undo.md to extend the concept of undo window to detached trees.
Add a user-facing document on undo semantics.

@yann-achard-MS yann-achard-MS marked this pull request as ready for review April 19, 2024 16:49
@yann-achard-MS yann-achard-MS requested a review from a team as a code owner April 19, 2024 16:49
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree base: main PRs targeted against main branch labels Apr 19, 2024

Keeping all detached trees forever would lead to unbounded memory growth in clients,
and would run the risk of seriously bloating the document's snapshot size.
In order to avoid that, we intend to
Copy link
Contributor

Choose a reason for hiding this comment

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

"In order to avoid that, detached trees will be garbage collected (though this is not yet implemented as of May 2024)."

become relevant again.
There are four scenarios where this can happen:

- Updating the view after reverting a commit
Copy link
Contributor

Choose a reason for hiding this comment

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

What does "updating the view" mean here? Why is it relevant? Don't we want to update the forest for a checkout during rebases, etc. regardless of whether or not the "view" is updating?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, "view" mean TreeCheckout to me because I experience our system at a lower level. Fixed.

- New trees can be created
- Trees are never deleted, but clients are allowed to forget their existence/contents
- Clients can refresh one-another on the existence and contents of trees
- One that is concerned with the location of nodes with respect to one-another:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand this paradigm. I think I sort of see the conceptual difference, but aren't the two concerns still quite interelated? For example, if a tree "moves" - allegedly the concern of the second DDS - but it is moved underneath another tree, then now it is part of that tree and no longer exists as a detached root (right?) and therefore the first DDS would want to remove it, so it's also a concern of the first DDS. I am probably missing something; I didn't gain any clarity from thinking about it as these two different concerns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps it would be more accurate to say that both DDSes deal with nodes. Moving a node does not remove it in the eyes of the first DDS.

The `Forest`, `AnchorSet`, and `DeltaVisitor` abstractions do not feature the concept of detached tree.
At this layer, we identify detached trees using a path that starts in a detached field.
(The same kind of field as the one that contains the root of the document.)
We may decide to force these abstractions to adopt the concept detached tree in the future if we see a benefit.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
We may decide to force these abstractions to adopt the concept detached tree in the future if we see a benefit.
We may decide to force these abstractions to adopt the concept of a detached tree in the future if we see a benefit.


While this would work, it has the following drawbacks:

1. The overhear per detached tree may be prohibitive in scenarios (like text editing)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. The overhear per detached tree may be prohibitive in scenarios (like text editing)
1. The overhead per detached tree may be prohibitive in scenarios (like text editing)

This is not currently an issue because we do have that ability,
but it is possible we will want to allow `Forest`s to have their own (more efficient) scheme for identifying them.
This point is weak on its own, but it provides an incentive to pick an approach that,
on top of addressing point 1, also addresses it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
on top of addressing point 1, also addresses it.
on top of addressing point 1, also addresses this concern.

@yann-achard-MS yann-achard-MS merged commit 617ef08 into microsoft:main May 15, 2024
30 checks passed
@yann-achard-MS yann-achard-MS deleted the update-undo-docs branch May 15, 2024 01:05
kekachmar pushed a commit to kekachmar/FluidFramework that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants