243: NOT_ENOUGH_SPACE (code 243)
The server could not reserve disk space for a new part, merge or mutation; the disk under the data path is out of room.
- Код ошибки
243- Имя
NOT_ENOUGH_SPACE- Категория
- Resource limits
Что это значит
NOT_ENOUGH_SPACE (243) is raised before any bytes are written: ClickHouse reserves space for each new part, merge and mutation on the target disk, and the reservation failed. df can still show free space, because parallel reservations, keep_free_space_bytes and the merge rule of keeping free space for the merge's input parts all shrink what the server may use.
Распространённые причины
- The disk or volume under the data path is genuinely full, often by ClickHouse's own log tables.
- Free space exists but is reserved by concurrent merges, mutations and inserts.
- The filesystem ran out of inodes, which looks exactly like a full disk.
Find the cause
`system.disks` for free and unreserved space, `system.parts` for the biggest tables, `df -i` for inodes, and the server log names the task whose reservation failed: insert, merge or mutation.
Как исправить
-
Compare what the OS sees with what the server sees.
SELECT name, path, free_space, total_space, unreserved_space, keep_free_space FROM system.disks;
-
Find the biggest consumers and drop or add TTL to what you can.
SELECT database, table, formatReadableSize(sum(bytes_on_disk)) AS size FROM system.parts WHERE active GROUP BY database, table ORDER BY sum(bytes_on_disk) DESC LIMIT 10;
-
On a full disk, DROP TABLE ... SYNC returns space at once; a plain DROP waits out the cleanup delay.
DROP TABLE old_log_table SYNC;
Other ways to handle it
SYSTEM STOP MERGES pauses merge reservations while you free space, but new inserts still need room. A TTL ... DELETE policy shrinks log tables without manual drops.
Безопасное воспроизведение
Use a throwaway container or a loopback filesystem sized in megabytes; never a disk holding real data.
Point a test container's data path at a tiny loopback filesystem, fill it, and any INSERT raises 243. Never test this on a data disk that matters.
Вопросы
df shows free space. Why 243?
Merges reserve free space for their source parts before writing, and other queries hold reservations too. Check unreserved_space in system.disks, not just free_space.
What does the size in the message mean?
The size is the number of bytes the server tried to reserve for the insert, merge or mutation, formatted for humans, for example Cannot reserve 1.00 MiB, not enough space.
Связанные ошибки
More resource limits errors
252TOO_MANY_PARTS (code 252)159TIMEOUT_EXCEEDED (code 159)202TOO_MANY_SIMULTANEOUS_QUERIES (code 202)
Код и текст сообщения взяты из ClickHouse documentation (system.errors). Смотрите весь ClickHouse error list или поиск по всем ошибкам баз данных.
Work on ClickHouse in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for ClickHouse and the other databases you use.
Текст и данные на этой странице: CC BY 4.0, с указанием SQLly (sqlly.app). Код и фрагменты SQL: MIT. Подробнее о лицензии Цитируемый текст сообщений об ошибках принадлежит производителю СУБД.