Skip to content

Feature Request: add a hook to customize SST compaction #1367

@eloff

Description

@eloff

I keep running into a form of this problem:

I want to expire items in the database based on custom logic. One such use case is when using badger as a disk-based cache, I don't want to expire items on a fixed schedule, but rather when free space gets low I want to start removing the coldest items. This is not very efficient because it requires walking the whole database and deleting items, and then triggering a compaction which will walk the whole database for a second time.

What if the condition (which is probably IsDeletedOrExpired() currently) were changed to a configurable function pointer that defaults to IsDeletedOrExpired(item)? Could something like that make sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureSomething completely new we should consider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions