attic-labs / noms

The versioned, forkable, syncable database
Apache License 2.0
7.44k stars 266 forks source link

Sequence chunker should avoid eagerly persisting root chunk #3645

Closed ghost closed 7 years ago

ghost commented 7 years ago

Now that prolly trees are eagerly written on creation, the sequence chunker chunker should avoid persisting the root chunk (which is returned). This is important, because the root chunk may not be directly addressable in the resulting value (i.e. if it is embedded into another value).

kalman commented 7 years ago

Started looking at this. It isn't trivial when you consider all of the special cases listed at https://github.com/attic-labs/noms/blob/759cf4fe589dd8a0af4e08983637c8b10cff29cc/go/types/sequence_chunker.go#L204 namely that we don't really know what the root chunk is until Done is called.

Oh well, here goes...