attic-labs / noms

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

sequenceChunker writes canonical root chunk if tree has multiple roots #3703

Open kalman opened 6 years ago

kalman commented 6 years ago

I just submitted https://github.com/attic-labs/noms/pull/3699 which makes sequenceChunker not write the root chunk of ptrees (since they might be used inline). See https://github.com/attic-labs/noms/issues/3645.

The problem, as noted here:

https://github.com/attic-labs/noms/blob/26eb9e37137efc79d2074e929a94905f54f51258/go/types/sequence_chunker.go#L188

Is that in reality it writes everything but the ptree root and if the tree has multiple roots:

https://github.com/attic-labs/noms/blob/26eb9e37137efc79d2074e929a94905f54f51258/go/types/sequence_chunker.go#L252

then it will still unnecessarily write the canonical root.

kalman commented 6 years ago

CC @rafael-atticlabs