Skip to content

Commit 83f8851

Browse files
Docs(tree): updates and clarifications in detached trees doc (#22756)
1 parent e02cc90 commit 83f8851

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/dds/tree/docs/main/detached-trees.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This keeps the contents of the removed subtree in the forest instead of erasing
1414

1515
Keeping all detached trees forever would lead to unbounded memory growth in clients,
1616
and would run the risk of seriously bloating the document's snapshot size.
17-
In order to avoid that, detached trees will be garbage collected (though this is not yet implemented as of April 2024).
17+
In order to avoid that, detached trees are garbage collected.
1818
How this happens is covered further down,
1919
but the key idea is that most of our systems are allowed to ignore the existence of this garbage collection scheme,
2020
thereby making those systems' contracts and implementations simpler.
@@ -42,7 +42,7 @@ See the [V1 Undo](./v1-undo.md) for more details.
4242
When a client needs to edit the document, it can do so in a transaction.
4343
Transactions are allowed to return a special value to communicate that the transaction should be aborted.
4444
When that happens, any edits that the transaction had already applied to the document state need to be rolled back.
45-
If some of those edits removed nodes, then those nodes need to be reintroduced into the document tree.
45+
If some of those edits happened to remove some nodes, then those nodes need to be reintroduced into the document tree.
4646

4747
### After Rebasing a Local Branch
4848

@@ -103,10 +103,10 @@ This seems bad from a performance point of view because it adds a cost common op
103103
Another alternative would be to keep all detached trees forever
104104
(i.e., without garbage-collecting them).
105105
As mentioned above, this would be bad for memory usage.
106-
This memory concern could be addressed for client by using local disk storage,
106+
This memory concern could be alleviated for clients by allowing them to use local disk storage,
107107
but it would still affect the size of snapshots.
108108

109-
This approach seems like a decent tradeoff between these two.
109+
Our current approach seems like a decent tradeoff between these two.
110110
More importantly, it paves the way to allowing us to more precisely control that tradeoff though the concept of [undo window](undo.md).
111111

112112
See also [Collecting Usage Data](#collecting-usage-data).
@@ -166,7 +166,7 @@ What scheme we use varies depending on the layer.
166166
One key requirement for identifying detached trees in changesets
167167
is that peers need to use a globally consistent identification scheme:
168168
if there are multiple detached trees,
169-
we need to ensure that one peer can communicate to the other precisely which of them it needs to edit.
169+
we need to ensure that one peer can communicate to the other peers precisely which of the detached trees it intends to edit.
170170
Additionally, if multiple peers attempt to concurrently detach the same tree,
171171
then we need to ensure that all peers eventually end up with a consistent way of referring to the tree.
172172

@@ -363,7 +363,7 @@ a refresher is a copy of a detached tree that is included by a peer on a commit
363363
to the sequencing service.
364364
Note that this excludes commits that are internal to the peer, i.e., commits on its branches.
365365
This means the inclusion of refresher can be confined to the logic that (re)submits commits to the sequencing service.
366-
(See `SharedTeeCore`'s usage of its `CommitEnricher`.)
366+
(See `SharedTeeCore`'s usage of its `BranchCommitEnricher`.)
367367

368368
##### Including Refreshers
369369

@@ -374,7 +374,7 @@ and whose detach operation was known to the peer\*.
374374
We make this happen by adding refreshers to commits as needed immediately before they are submitted to the sequencing service.
375375
Note that commits sometimes need to go through a resubmission phase,
376376
so we need to ensure that the set of refreshers on such commits is updated before these commits are resubmitted.
377-
(See the logic in `SharedTeeCore` and `DefaultCommitEnricher`).
377+
(See the logic in `SharedTeeCore` and `ResubmitMachine`).
378378

379379
\* Strictly speaking,
380380
a client could omit the refresher for trees for which _both_ of the following are true:
@@ -477,4 +477,4 @@ This last option should enable us to assess the value of implementing the undo w
477477
and if so, what might be a good K value for it.
478478

479479
We should also measure how those costs would change
480-
if we omitted them refreshers in the scenario described at the bottom of the [Including Refreshers](#including-refreshers) section.
480+
if we omitted the refreshers in the scenario described at the bottom of the [Including Refreshers](#including-refreshers) section.

0 commit comments

Comments
 (0)