Collection-wide manual compaction

Collection-wide manual compaction #

Reclaiming disk no longer means waiting for the background cadence or poking shards one by one. One request runs a merge pass on every started primary copy of the collection, cluster-wide:

curl -X POST http://127.0.0.1:28000/my-collection/_compact \
  -H 'Authorization: Bearer pz_bootstrap_key'

The response reports the queued batch job per hosting node — job id plus how many local primary passes it covers — so a node-level failure fails the row, not the request:

{
  "collection": "default:my-collection",
  "nodes": [ { "node_id": "...", "job_id": "...", "queued": 3 } ],
  "queued": 3,
  "failed": 0
}

The request returns as soon as the jobs are queued: a merge pass can run for minutes, so nothing waits for it. Progress (per-shard job state, live merge phase and per-mille) and cancellation live server-side in each node’s GET /_node/_local/tasks — which also means the console’s view survives a page refresh. The console’s collection page carries a matching Compaction card that queues the jobs and streams both feeds.

See Compact a collection for the full contract.

Calendar September 29, 2026
Edit Edit this page