mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-09 10:38:10 -06:00
LocalDatabase generally uses a BatchStoreAdaptor, which is a kinda dumb wrapper around ChunkStore. During a Pull(), though, this would cause Chunks to be Put in a top-down fashion, meaning that Chunks wound up in the backing store _before_ other Chunks that they reference. This means that LocalDatabases were transiently invalid, and that cancelling an in-progress pull could lead to an invalid DB. Now, calling validatingBatchStore() on a LocalDatabase returns a BatchStore that uses the same strategy as RemoteDatabaseClient, caching chunks as the come in and putting them into the backing store bottom-up when Flush() is called. Fixes #1915