Flush a collection

Flush a collection #

Queue a flush of every live shard copy of the collection, cluster-wide — primaries and started replicas. A flush seals the shard’s mutable state into the WAL and builds a new immutable .fire segment from the WAL tail, turning in-memory writes into durable segment storage so the WAL can be purged afterwards.

Unlike Compact a collection — which merges existing segments synchronously — a flush is asynchronous: each node holding copies of the collection starts a node-local flush job and the request returns immediately. Track or cancel the jobs on the node’s task list (GET /_node/_local/tasks, flush_jobs lane). Only one flush job runs per node at a time — a node already running one answers 409 in its row.

Examples #

The following request queues a forced flush of the collection called my-collection:

POST /my-collection/_flush

The API returns the following result:

{
  "collection": "default:my-collection",
  "force": true,
  "nodes": [
    {
      "node_id": "cc139a188e0642819003",
      "job_id": "79982f4a058b4ef7b5cb",
      "queued": 8
    }
  ],
  "queued": 8,
  "failed": 0
}

To flush only what is currently due (respect the WAL and memtable thresholds instead of forcing a seal), pass force=false:

POST /my-collection/_flush?force=false

Request #

POST /[<namespace>:]<name>/_flush

Path Parameters #

  • <namespace>
    (Optional, string) The namespace which the collection belongs to.
  • <name>
    (Required, string) Name of the collection to flush.

Query Parameters #

  • force
    (Optional, boolean, default true) true seals the mutable state and builds a .fire segment even when no threshold is due — the operator asked for a flush now. false flushes only shard copies with pending work. Also accepts 0/no.

Response #

  • nodes — one row per node holding live copies of the collection: node_id plus job_id and queued (how many shard copies that node’s job covers) on success, or an error string when the node did not answer or refused (already running a flush job).
  • queued — the total number of shard-copy flushes queued across nodes.
  • failed — how many node rows carry an error.

A collection with no started shard copies answers 409 — there is nothing to flush.

Calendar September 29, 2026
Edit Edit this page