Been playing with Badger for our solution. I have have added in a worker to handle the GC
db.RunValueLogGC(0.001)
And have this for my options
cfg := badger.DefaultOptions(badgerPath).WithValueLogFileSize(5000000).WithLoggingLevel(badger.DEBUG)
So I changed the file size to be about 5M and have the ratio set to .001 just to try and see if I can force more GC to happen.
And I send through several items, and delete them. But I see this in my badger db directory
$ ls -latrh
total 86M
-rw------- 1 sgs sgs 16 Jul 28 21:28 MANIFEST
-rw-r--r-- 1 sgs sgs 2 Jul 28 21:28 LOCK
-rw------- 1 sgs sgs 28 Jul 28 21:28 KEYREGISTRY
-rw-r--r-- 1 sgs sgs 1.0M Jul 28 21:28 DISCARD
drwxrwxrwt 1 root root 33 Jul 28 21:28 ..
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 21:39 000001.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 21:42 000002.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 21:44 000003.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 22:52 000004.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 22:55 000005.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 22:58 000006.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:00 000007.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:02 000008.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:04 000009.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:06 000010.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:07 000011.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:09 000012.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:10 000013.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:12 000014.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:15 000015.vlog
-rw-r--r-- 1 sgs sgs 4.8M Jul 28 23:19 000016.vlog
drwx------ 2 sgs sgs 4.0K Jul 28 23:19 .
-rw-r--r-- 1 sgs sgs 9.5M Jul 28 23:26 000017.vlog
-rw-r--r-- 1 sgs sgs 128.0M Jul 28 23:26 00001.mem
As you can see I am getting several .vlog files. But notice the DISCARD file never gets updated. This makes me feel like maybe compaction is not happening.
And I see this Debug message
DEBUG: No file with discard stats
Which makes sense since I don’t see any updates to the DISCARD file.
Any help in explaining to me what I am missing would be appreciated. Also I am using Badger v3