docs: clarify dump/snapshot staging uses TMPDIR#3596
Conversation
…pshot-dir Creating a dump or snapshot first builds an uncompressed staging copy in the directory pointed to by TMPDIR (default /tmp), not in --dump-dir or --snapshot-dir. On instances with a large database and a small /tmp partition this causes "No space left on device" even when the configured output directory has free space. Document the behavior and the TMPDIR fix.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughTwo informational notes are added to ChangesTMPDIR Staging Notes for Dump and Snapshot Options
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
resources/self_hosting/configuration/reference.mdx (1)
128-130: ⚡ Quick winUse consistent terminology across the dump and snapshot notes.
The dump note (L129) describes staging as "uncompressed copy" while the snapshot note (L301) describes it as "full flat copy." Since both describe the same underlying mechanism, use parallel terminology. "Uncompressed copy" is more precise and directly conveys what happens during staging.
📝 Suggested revision for snapshot note (lines 300–302)
<Note> -`--snapshot-dir` only controls where the final `.snapshot` file is written. While creating a snapshot, Meilisearch first copies a full flat copy of your database into a temporary staging directory. This directory is located in the path indicated by the `TMPDIR` environment variable, defaulting to `/tmp` on most systems, and not in `--snapshot-dir`. On instances with a large database and a small `/tmp` partition, this can cause `No space left on device` errors even when `--snapshot-dir` points to a volume with plenty of free space. To avoid this, set `TMPDIR` to a directory on a volume with enough space for a full copy of your database before launching Meilisearch. +`--snapshot-dir` only controls where the final `.snapshot` file is written. While creating a snapshot, Meilisearch first builds an uncompressed copy of your database in a temporary staging directory. This directory is located in the path indicated by the `TMPDIR` environment variable, defaulting to `/tmp` on most systems, and not in `--snapshot-dir`. On instances with a large database and a small `/tmp` partition, this can cause `No space left on device` errors even when `--snapshot-dir` points to a volume with plenty of free space. To avoid this, set `TMPDIR` to a directory on a volume with enough space for an uncompressed copy of your database before launching Meilisearch. </Note>Also applies to: 300-302
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@resources/self_hosting/configuration/reference.mdx` around lines 128 - 130, The documentation uses inconsistent terminology to describe the staging directory behavior in two different notes. At lines 128-130 (dump note), the staging directory is described as an "uncompressed copy" of data, while at lines 300-302 (snapshot note), the same concept is referred to as a "full flat copy." Update the snapshot note at lines 300-302 to replace "full flat copy" with "uncompressed copy" to maintain consistent and precise terminology across both notes, since they both describe the same underlying staging mechanism.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@resources/self_hosting/configuration/reference.mdx`:
- Around line 128-130: The documentation uses inconsistent terminology to
describe the staging directory behavior in two different notes. At lines 128-130
(dump note), the staging directory is described as an "uncompressed copy" of
data, while at lines 300-302 (snapshot note), the same concept is referred to as
a "full flat copy." Update the snapshot note at lines 300-302 to replace "full
flat copy" with "uncompressed copy" to maintain consistent and precise
terminology across both notes, since they both describe the same underlying
staging mechanism.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aa6ff575-d5b2-4f12-875a-ccd352e8d86f
📒 Files selected for processing (1)
resources/self_hosting/configuration/reference.mdx
Description
Creating a dump or snapshot first builds an uncompressed staging copy in the directory pointed to by TMPDIR (default /tmp), not in --dump-dir or --snapshot-dir. On instances with a large database and a small /tmp partition this causes "No space left on device" even when the configured output directory has free space. Document the behavior and the TMPDIR fix.
So i struggled with this one for quite a while until realising the TMPDIR nuance so think it should be part of the docs at least.
I used Claude code for partial investigation of what is happening with TMPDIR.
Checklist
For internal Meilisearch team member only:
For external maintainers
Documentation Clarification: Dump and Snapshot Staging Behavior
This documentation PR clarifies how Meilisearch handles dump and snapshot creation, particularly around where temporary staging files are written.
What Changed
resources/self_hosting/configuration/reference.mdxwith new notes for--dump-dir/MEILI_DUMP_DIRand--snapshot-dir/MEILI_SNAPSHOT_DIR.Key Points
TMPDIR(defaulting to/tmp)./tmpis too small—even if the configured dump/snapshot output directory has sufficient free space.TMPDIRto a filesystem with adequate capacity.Technical Details
resources/self_hosting/configuration/reference.mdx