row_cache: Fix memtable reads concurrent with cache update missing writes
row_cache: Fix memtable reads concurrent with cache update missing writes

Introduced in 5b59df376109aa5ecf6b76c90e1f6ea4d78ef13c.

It is incorrect to erase entries from the memtable being moved to
cache if partition update can be preempted because a later memtable
read may create a snapshot in the memtable before memtable writes for
that partition are made visible through cache. As a result the read
may miss some of the writes which were in the memtable. The code was
checking for presence of snapshots when entering the partition, but
this condition may change if update is preempted. The fix is to not
allow erasing if update is preemptible.

This also caused SIGSEGVs because we were assuming that no such
snapshots will be created and hence were not invalidating iterators on
removal of the entries, which results in undefined behavior when such
snapshots are actually created.

Fixes SIGSEGV in dtest: limits_test.py:TestLimits.max_cells_test

Fixes #3532

Message-Id: <18ef13418e059f7de289d29a2fbfd0808dd7b859@scylladb.com>

scylladb/scylla,scylladb/scylla,avikivity/scylla,duarten/scylla,duarten/scylla,avikivity/scylla,scylladb/scylla,avikivity/scylla,duarten/scylla,scylladb/scylla