Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache reads may return incorrect data after eviction from entries with memtable snapshots #3215

Closed
tgrabiec opened this Issue Feb 15, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@tgrabiec
Copy link
Contributor

tgrabiec commented Feb 15, 2018

Installation details
Scylla version: 2.1 (b98d5b3)

Commit 6ccd317 introduced a bug in partition_entry::evict() where a partition entry may be partially evicted if there are non-evictable snapshots in it. Partially evicting some of the versions may violate
consistency of a snapshot which includes evicted versions. For one, continuity flags are interpreted relative to the merged view, not within a version, so evicting from some of the versions may mark
ranges as continuous when before they were discontinuous. Also, the snapshot view on range tombtsones is calculated as the sum from all versions, so we can't partially evict some of them without marking all affected ranges as discontinuous.

@tgrabiec tgrabiec self-assigned this Feb 15, 2018

@tzach tzach added the showstopper label Feb 15, 2018

@pdziepak pdziepak closed this in b0b57b8 Feb 15, 2018

pdziepak added a commit that referenced this issue Feb 15, 2018

tests: row_cache: Improve test for snapshot consistency on eviction
Reproduces #3215.
Message-Id: <1518710592-21925-1-git-send-email-tgrabiec@scylladb.com>

tgrabiec added a commit that referenced this issue Feb 16, 2018

mvcc: Do not move unevictable snapshots to cache
Commit 6ccd317 introduced a bug in partition_entry::evict() where a
partition entry may be partially evicted if there are non-evictable
snapshots in it. Partially evicting some of the versions may violate
consistency of a snapshot which includes evicted versions. For one,
continuity flags are interpreted realtive to the merged view, not
within a version, so evicting from some of the versions may mark
reanges as continuous when before they were discontinuous. Also, range
tombtsones of the snapshot are taken from all versions, so we can't
partially evict some of them without marking all affected ranges as
discontinuous.

The fix is to revert back to full eviciton, and avoid moving
non-evictable snapshots to cache. When moving whole partition entry to
cache, we first create a neutral empty partition entry and then merge
the memtable entry into it just like we would if the entry already
existed.

Fixes #3215.

Tests: unit (release)
Message-Id: <1518710592-21925-2-git-send-email-tgrabiec@scylladb.com>
(cherry picked from commit b0b57b8)

tgrabiec added a commit that referenced this issue Feb 16, 2018

tests: row_cache: Improve test for snapshot consistency on eviction
Reproduces #3215.
Message-Id: <1518710592-21925-1-git-send-email-tgrabiec@scylladb.com>

(cherry picked from commit 9c3e56f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.