So, I’ve built an http server for api requests that use badgerDB… I have an endpoint to call GC:
/gc
Which runs this code:
func handleGC(w http.ResponseWriter, r *http.Request) {
err := db.RunValueLogGC(0.7)
if err != nil {
fmt.Fprintf(w, err.Error())
return
}
fmt.Fprintf(w, "success")
return
}
It responds with:
Value log GC attempt didn’t result in any cleanup.
I have 2 records in the DB with this info:
|---|---|
|cpucount:|4|
|docker0:|172.17.0.1/16|
|ens192:|10.10.36.87/24|
|hostname:|pu-dlrinventorylz-01|
|lo:|127.0.0.1/8|
|memory:|8185937920|
|os:|linux|
|registered_time:|1546877824|
|update_time:|1547047625|
The size of the vlog is 224k with every updated “Set” from the start. Why isn’t /gc cleaning up these entries?