In this article
Publish one validated immutable-revision pointer atomically, and pin it once per load so independently opened shards cannot mix revisions.
A model directory is updated shard by shard while workers open files through a stable path. Every individual file replacement can be atomic and readers can still assemble a mixed revision. Publish a single validated revision pointer only after the referenced immutable set is ready. Then make each reader pin the revision identity it will use for the entire load.
Define the publication unit
Choose a small manifest or pointer whose replacement selects one complete revision. The referenced file set must already be validated and available under immutable identities. Renaming several shard paths separately is not a transaction across those paths. A worker that opens the first shard before publication and the next afterward can otherwise observe individually valid files from incompatible revisions.
Prepare beside the destination
Stage the new pointer on the same mounted filesystem as the final name and validate its complete contents before replacement. Linux rename provides atomic name-replacement semantics under its documented conditions. Check the operation result and filesystem scope. The existence of a convenient move command does not prove that it performed that atomic primitive rather than copying between storage boundaries.
Preserve old-reader semantics
An open file descriptor refers to its underlying open file description rather than repeatedly resolving the current pathname. Replacing the published name therefore does not force existing readers to switch contents. This can support orderly revision transition, but the application must account for old readers retaining old files. The renamed pointer is not an instruction that every live worker immediately remap its weights.
Pin one revision per load
Read and validate the pointer once for the intended loading operation, then resolve all artifacts using that selected immutable revision. Reopening a mutable pointer independently for each shard recreates the mixing problem. Preserve the accepted revision identity in worker state and diagnostics. Garbage collection must wait until no supported reader still requires the old referenced set under the application’s lifecycle contract.
Separate visibility and persistence
If publication also promises crash survival, apply the appropriate file and directory synchronization protocol. Atomic runtime visibility alone does not provide that stronger contract. Test concurrent old and new readers in an isolated equivalent and verify which complete revision each loads. A useful result prevents mixed publication at this boundary; it does not establish artifact trust, semantic model compatibility or safe in-place replacement of mapped weights.
Primary references
Linux Atomic Rename and Filesystem Boundaries.
Linux Open File Descriptions and Directory Handles.
Linux File and Directory Synchronization.
Related reading: Keep tokenizer vocabulary, special tokens and chat templates in one release; Init container downloads an artifact again: making preparation idempotent.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.