Company
Date Published
Author
Erik Grinaker
Word count
2997
Language
English
Hacker News points
12

Summary

CockroachDB has introduced MVCC range tombstones to efficiently manage large-scale data deletions while preserving the Multi-Version Concurrency Control (MVCC) history, which is crucial for functionalities like transaction isolation and cluster replication. Traditional methods of writing individual point tombstones for each deletion were cumbersome and space-intensive, particularly for bulk deletions such as table drops. MVCC range tombstones allow marking an entire range of data as deleted with a single operation, avoiding the need for numerous individual tombstones. This development required significant changes to the MVCC and storage layers and builds on previous work with Pebble's LSM range tombstones. While MVCC range tombstones are not yet supported within transactions due to the complexity of required changes, they eliminate the need for direct data removal "cheats" in the storage engine, ensuring a consistent MVCC history. The implementation of MVCC range tombstones, inspired by Pebble's approach, includes a new generalized MVCC range key concept, allowing for storing arbitrary values over key spans at specific timestamps. Though currently disabled by default due to its complexity, MVCC range tombstones are expected to be gradually rolled out, enhancing data management efficiency in future CockroachDB releases.