google / google/leveldb

The Last Level's Problem

Open
#932 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.4k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

I searched a lot of leveldb-related information, and I currently have a question, whether the size of the last level is unlimited, if not unlimited, where did the final data go?
Let me describe this scenario roughly. There is a piece of data that was inserted a long time ago, but no one has modified it. As time goes by, it will go down more and more and sink to level 6.
Then suddenly someone started to manipulate this piece of data. He changed the value corresponding to this key, and a new modification record was inserted into the memory, and then went down over time, right, suppose it reached level 2, this At that time, the entire database actually has the old and new data corresponding to this key in both levels.
So now, I decided to delete the record corresponding to this key, I inserted a new record that deleted this key, went to level 2, and found an old record with the same key, then I physically deleted it, but marked this The record whose key has been deleted cannot be deleted. When this deleted record reaches level 6, will the deleted record still be stored on the disk? Or is there some sort of boundary judgment to physically delete it?

And there are two other small problems:
First, is there a size limit for the last level == level 6?
Second, is there an interface to manually trigger compaction?

I very much hope that the official can give me an answer, thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.