Flush

Flush a collection

/ Flush, / 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.

Both a flush and a Compact a collection request queue node-local jobs that run asynchronously — the request returns as soon as the jobs are queued. Track or cancel them on the node’s task list (GET /_node/_local/tasks): flush jobs under flush_jobs, compaction under compaction_tasks[]. Only one flush job runs per node at a time — a node already running one answers 409 in its row. The difference is what the job does: compaction merges existing immutable segments, a flush seals the mutable tail into a new one.

...