Skip to content

db: range keys sometimes omitted during TBI #1895

@erikgrinaker

Description

@erikgrinaker

I'm seeing something that indicates a bug with range key defragmentation and block property filters.

In cockroachdb/cockroach#86256, I'm adding a metamorphic test parameter for TestMVCCHistories which causes Pebble to use very small blocks, and to flush after every write operation. Try running this a few times:

dev test pkg/storage -f 'TestMVCCHistories' --ignore-cache -v --rewrite

Quite often (depending on the metamorphic parameters), this will generate changes in export and range_key_iter_incremental that either truncate range keys (so e.g. [a-k) is truncated to [a-b)), or fragments disappear completely (e.g. [b-c) disappears from a longer chain of connected fragments). This leads me to suspect a bug in Pebble defragmentation, since I don't see any mechanism in CRDB that would truncate range keys like this.

Both of these test cases use MVCCIncrementalIterator, using a TBI paired with a normal iterator. However, it must be the normal iterator that's surfacing these truncated range keys -- it's still a bit unclear what's happening.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions