CompactRange does not remove old values?

89 views
Skip to first unread message

Aman Gupta

unread,
Mar 1, 2017, 10:56:21 AM3/1/17
to leveldb
I have a leveldb database that I regularly add and remove keys from. Occasionally, I run `CompactRange()` to reclaim space, but I've noticed that even after a full manual compaction, `leveldbutil dump` shows old values for keys still exist..

So for instance, after a `CompactRange(NULL, NULL)`, I see in the LOG:

compacted to: files[ 0 0 0 125 0 0 0 ]

But then leveldbutil shows:

'b1488250800' @ 23057457 : del => ''
'b1488250800' @ 169587 : val => ......
'b1488250800' @ 23116237 : del => ''
'b1488250800' @ 202418 : val => ......

Is this a bug in the compaction logic, or am I misunderstanding how compaction is supposed to work?

Aman Gupta

unread,
Mar 1, 2017, 12:47:38 PM3/1/17
to Dhruba Borthakur, lev...@googlegroups.com


On Wed, Mar 1, 2017 at 9:22 AM, Dhruba Borthakur <dhr...@gmail.com> wrote:
You have seven Levels but your data has filled upto L3 only.

1. The delete markers cannot be deleted if there are keys in lower levels.
2. The delete markers cannot be deleted if there are active snapshots that makes some of these keys visible in the snapshot

are u using snapshots?

I am, and it appears I may not have been releasing them correctly. I'll see if I can recreate the issue when no snapshots are active.

Thanks for the pointer in the right direction.
 


--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages