Skip to content

[FEATURE] Add manual compaction API (level/key-range) #88

@feichai0017

Description

@feichai0017

🚀 Is your feature request related to a problem?

Compaction is currently background-driven only. Operators and experiments lack explicit controls for forcing compaction at specific levels/ranges.

💡 Proposed Solution

Add a manual compaction API and CLI entrypoint.

Examples:

  • compact a full level,
  • compact a key range,
  • trigger with optional wait/status output.

🎨 Alternatives Considered

  1. Keep only automatic compaction scheduler.
  2. Use offline tools/scripts touching internal files.

Manual API is safer and more operable.

📝 Technical Details / Implementation Plan

  • Define internal compaction job request (level/range/options).
  • Expose API in DB and command entry in cmd/nokv.
  • Add tests for correctness, idempotence, and interaction with running background compactions.

🧐 Additional Context

Manual compaction is useful for benchmarking, incident mitigation, and maintenance windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions