fix(deps): update module github.com/go-crdt/crdt to v0.35.0 - #10
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.31.0→v0.35.0Release Notes
go-crdt/crdt (github.com/go-crdt/crdt)
v0.35.0Compare Source
Doc.CollectandList.Collect, shipped in v0.33.0, are withdrawn. They lefttwo replicas holding different documents.
What was wrong
They re-pointed a survivor that named a collected run at the nearest character
still alive before it. Still alive is relative to what a replica happens to
hold: two replicas collecting against the same version hold different characters
above it, re-point the same survivor at different anchors, and disagree from
then on about what it was inserted after.
A chaos harness diverged them on every seed, and narrowed it: collecting the
maps alone is green on every seed; collecting the text alone, or the list alone,
diverges on every seed. The maps are the parts that re-point nothing.
Re-pointing at the dead run's own origin instead is agreed by every replica and
cannot be written down — it makes the survivor sort earlier than it does in the
live document, so
Loadrefuses the snapshot. Both anchors were tried.Breaking, and un-breaking
TextAt,LenAt,ChangesSince,List.ValuesAt,List.LenAtandOpsSincego back to their v0.32.0 signatures, along with
Floor,CanReplayandErrCollected, which existed only for the withdrawn feature. If you are onv0.32.0 or earlier, nothing changes for you. If you took v0.33.0 or v0.34.0, the
error returns go away again.
What stays
Map.Collectwith its clock guard,Composite.Collect(maps only),Diagram.Sweep,Diagram.Collect, andRewritten.Snapshot formats are unchanged — a text at version 6, a list at version 2 — and
now refuse a snapshot whose collection tables are not empty, because nothing
sound could have written one.
What a next attempt should build
Yjs's shape, read from
Item.gc: replace a deleted item in place withGC(id, length)— same identity, same length, contents discarded — so nothingis re-pointed and no causal stability is needed, because an operation that names
it finds it. Measured here at 16.2% of a real document's snapshot against
the 59.4% the wrong answer promised. Smaller, and sound.
The chaos harness that found this ships with it.
v0.34.0Compare Source
OpsSincerefuses a difference below the collection floor.Below
Floor()it used to hand back a difference with holes in its sequencenumbers, which a peer applying it could only park — silently, because every
operation in the batch is well-formed and the one that would let the rest
through is never coming.
Breaking
Doc.OpsSince(v) []Op([]Op, error)List.OpsSince(v) []ListOp([]ListOp, error)Composite.OpsSince(v) []PartOps([]PartOps, error)Map.OpsSinceis unchanged: a map gives back a sequence number without itsoperation as a matter of course, so the span that stands in for a collected
tombstone is one a peer already knew how to apply.
The eight
structuredtypes that delegate toComposite.OpsSince—Blobs,Blocks,Diagram,Document,Ink,Proposals,RichText,Sheet—change with it. The six backed by a map do not.
Migrating
A replica that never collects never refuses, so the common migration is
mechanical:
If you do collect, ask
CanReplay(v)first and send a snapshot when it says no:a peer below the floor has to be re-seeded, not caught up.
Also
Proposals.DraftandProposals.Previewnow refuse on a document that hascollected. A proposal is that document's history replayed, and what collection
dropped is not in it.
v0.33.0Compare Source
Replicas can give back what nobody can be confused by any more.
Doc,ListandMapcollect the tombstones every replica has seen thedeletion of, and
Compositecollects the parts a caller vouches for. On theautomerge paper 87% of a text's tombstones go and the snapshot falls from
478 474 to 194 203 bytes. A collected replica still merges with the replicas
it came from, which is the whole difference between this and
Rewritten.A diagram takes two deliberate steps:
Diagram.Sweepturns the records ofremoved nodes into tombstones,
Diagram.Collectgives them back — 2.0x on adiagram of two hundred nodes half of which were tried and removed.
Breaking
Five readers now return an error, and give
ErrCollectedbelowFloor()rather than a past with characters missing from it:
Doc.TextAt(v) string(string, error)Doc.LenAt(v) int(int, error)Doc.ChangesSince(v) []Change([]Change, error)List.ValuesAt(v) [][]byte([][]byte, error)List.LenAt(v) int(int, error)A document that never collects has an empty floor and never refuses, so the
migration is to take the error and treat it as impossible — or to handle it, if
you collect.
Snapshot formats
Text 6, list 2, map 2. Every older version still loads, and re-encoding
writes the current one.
v0.32.0Compare Source
Apply can say what it absorbed
ApplyAbsorbedonDoc,List,MapandComposite, beside theApplythatis unchanged. It reports the operations a call actually integrated — including
any that had been parked waiting for them, which were in no batch anybody sent.
Anything that passes operations on needs exactly that set. More, and two
replicas following each other talk for ever. Less, and a peer ends up missing an
operation nobody will send it again, because everybody else has it by then.
Working the set out afterwards does not do: asking what a replica holds that a
version does not walks the document — 383µs on sixty thousand operations against
90ns for a version that is current — and inferring it from a counter fails in
both directions, since the number waiting cannot see a release that coincides
with a park and the size of the gain cannot see past duplicates.
The replica knows without looking, and collecting what it integrates costs an
append. A replica nobody is asking carries nothing for the question: the
collector is a parameter, not a field, so
Docis the 168 bytes it always was.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.