From aec11ff713f6fde328e5b4bec9dcba97a067c3d1 Mon Sep 17 00:00:00 2001 From: Seebs Date: Mon, 14 Sep 2020 15:40:19 -0500 Subject: [PATCH] Update cache entries when setting a row even in shards with no new data The logic assumes that the lack of a corresponding rowSegment means that there's no changes, but that's not true -- we just deleted all the existing data! Update to match clearRow behavior better. Also, add a corresponding test case for this. Also, change references to 'defaultSnapshotQueue' to use [fragment].holder.SnapshotQueue, because defaultSnapshotQueue was the queueless queue, but holders were getting a snapshot queue, meaning that "awaiting" a snapshot could result in moving on and closing the holder before the actual snapshot queue finished snapshotting. --- fragment.go | 36 +++++++++++++++++++----------------- fragment_internal_test.go | 29 +++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/fragment.go b/fragment.go index 122688ec5..33d0f3bfd 100644 --- a/fragment.go +++ b/fragment.go @@ -798,26 +798,28 @@ func (f *fragment) unprotectedSetRow(tx Tx, row *Row, rowID uint64) (changed boo // From the given row, get the rowSegment for this shard. seg := row.segment(f.shard) - if seg == nil { - return changed, nil - } - - // Put each container from rowSegment to fragment storage. - citer, _ := seg.data.Containers.Iterator(f.shard << shardVsContainerExponent) - for citer.Next() { - k, c := citer.Value() - if err := tx.PutContainer(f.index, f.field, f.view, f.shard, headContainerKey+(k%(1<