mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-23 18:58:50 -06:00
ValueStore caches Values that are read out of it, but it doesn't do the same for Values that are written. This is because we expect that reading Values shortly after writing them is an uncommon usage pattern, and because the Chunks that make up novel Values are generally efficiently retrievable from the BatchStore that backs a ValueStore. The problem discovered in issue #2802 is that ValueStore caches non-existence as well as existence of read Values. So, reading a Value that doesn't exist in the DB would result in the ValueStore permanently returning nil for that Value -- even if you then go and write it to the DB. This patch drops the cache entry for a Value whenever it's written. Fixes #2802