Skip to content

badgerengine doesn't release disk space since badger gc doesn't work. #454

@crazycs520

Description

@crazycs520

What version of Genji are you using?

$ genji version
v0.14.1

What did you do?

Related issue: https://discuss.dgraph.io/t/badgerdb-consume-too-much-disk-space/17070/2

This problem is caused when Transaction Commit, the Transaction doesn't call tx.Discard() then cause badger gc doesn't work. Since the badger API said:

// When you create a new transaction, it is absolutely essential to call
// Discard(). This should be done irrespective of what the update param is set
// to. Commit API internally runs Discard, but running it twice wouldn't cause
// any issues.
//
//  txn := db.NewTransaction(false)
//  defer txn.Discard()
//  // Call various APIs.
func (db *DB) NewTransaction(update bool) *Txn {
	return db.newTransaction(update, false)
}

But badgerengine doesn't call txn.Discard() before txn.Commit

image

What did you expect to see?

Release disk space after I delete data and badger gc finish.

What did you see instead?

genjidb with badgerdb consume too much disk space and badger gc doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions