Dgraph-io/badger is constantly growing (setting data with ttl)

(Dmitry Vasiliev) #1

Good day to all!
I started using https://github.com/dgraph-io/badger thanks to the developers for the product!
But I have a problem with a growing place.
I insert the data with ttl, but it feels like the place is not being released and is constantly growing.

err = s.DB.Update(func(txn *badger.Txn) error {
            return txn.SetWithTTL([]byte(key), data, time.Duration(ttl)*time.Second)

maybe I’m doing something wrong?
version of badger: v0.0.0-20190307201039-6b97bacb380b

(Manish R Jain) #2

Badger only appends the data to value log. Then later when LSM tree compactions run, they’d discard keys. If you’re running value log GC, then the GC would allow value logs to be deleted.

Badger does not modify data in place because that doesn’t play well with file system consistency and tools like rsync.