I deleted a bunch of data from my CockroachDB database, but the disk usage is not reducing.
Why is my CockroachDB disk usage not decreasing?
257 views Asked by Jackson At
1
There are 1 answers
Related Questions in COCKROACHDB
- Issues in Migration of RISCV Test Harness from VCS to Questasim Simulator
- Queue Scenario Help Getting Started
- Writing a simulation program in Python
- Java Card applet EEPROM vs RAM testing
- Simulate the use of a website with a client
- Verilog simulation x's in output
- Time step independence of Molecular Dynamics code
- How to code a arrival generator with a varying intensity rate
- Is it possible to build a heatmap from point data at 60 times per second?
- Verilog Testbench constant exp and pram compilation and simulation errors
Related Questions in COCKROACHCLOUD
- Issues in Migration of RISCV Test Harness from VCS to Questasim Simulator
- Queue Scenario Help Getting Started
- Writing a simulation program in Python
- Java Card applet EEPROM vs RAM testing
- Simulate the use of a website with a client
- Verilog simulation x's in output
- Time step independence of Molecular Dynamics code
- How to code a arrival generator with a varying intensity rate
- Is it possible to build a heatmap from point data at 60 times per second?
- Verilog Testbench constant exp and pram compilation and simulation errors
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
1. The data could be preserved for MVCC history.
CockroachDB implements Multi-Version Concurrency Control (MVCC), which means that it maintains a history of all mutations to a row. This history is used for a wide range of functionality: transaction isolation, historical AS OF SYSTEM TIME queries, incremental backups, changefeeds, cluster replication, and so on. The requirement to preserve history means that Cockroach 'soft' deletes data: The data is marked as deleted by a tombstone record so that Cockroach will no longer surface the deleted rows to queries, but the old data is still present on disk.
The length of history preserved by MVCC is determined by two things: the gc.ttlseconds of the zone that contains the data and whether any protected timestamps exist. You can check the range's stats (eg, in the DB Console) to observe the
key_bytes
,value_bytes
andlive_bytes
. Thelive_bytes
metric reflects data that's not garbage. The value of(key_bytes+value_bytes)-live_bytes
will tell you how much MVCC garbage is resident within a range.When data has been deleted for at least the duration specified by
gc.ttlseconds
, Cockroach will consider it eligible for 'garbage collection.' Asynchronously, Cockroach will perform garbage collection of ranges that contain significant quantities of garbage and delete the garbage. Note that if there are backups or other processes that haven't completed yet but require the data, these processes may prevent garbage collection of old data until these processes have completed by setting a protected timestamp.2. The data could be in the process of being compacted.
When MVCC garbage is deleted by garbage collection, the data is still not yet physically removed from the filesystem. Removing data from the filesystem requires rewriting the files containing the data, which can be expensive. The Cockroach storage engine has heuristics to compact data and remove deleted rows when enough garbage has accumulated to warrant a compaction. The storage engine strives to always restrict the overhead of obsolete data (called the space amplification) to at most 10%. If a lot of data was just deleted, it may take the storage engine some time to compact the files and restore this property.
There's some more information on the Cockroach documentation for MVCC.