Skip to content

v5.17.1

Choose a tag to compare

@github-actions github-actions released this 04 Nov 15:46
· 844 commits to main since this release
b7db332

Nuthatch 5.17.1 fixes two things that could make a mirror or a nest's identity unreliable. There is
no storage migration, and no NID, registry hash or sealed segment changes for a nest without spill
files in it.

A filesystem mirror never holds a part-written object

A mirror on a local or network path (target = "/srv/mirror", not s3://) wrote each object in
place: it truncated the key and wrote the new bytes over it. A reader could catch a half-written
object, and a writer killed mid-write left one behind. That reader can be a follower, nuthatch seed,
or a failover standby seeding from the mirror its writer was publishing to when it died (#2662). Each
object is now written to a hidden .partial file beside the key, synced, and renamed over it, so a
reader sees the old object or the new one and never a mix. A writer killed between the write and the
rename leaves its .partial behind; listings skip it, and the next write of that key removes one
older than ten minutes.

Who is affected: anyone publishing to a filesystem path. An s3:// mirror was never affected,
because an object store's put is already whole.

A spill directory is not part of a nest

A query that spills writes to $HOME/.cache/nuthatch/nuthatch-spill-<pid>-<seq>/. When HOME is the
nest directory, as some systemd units set it, that directory sits inside the nest, and every file in
it counted toward the nest's NID (#2663). A NID taken while a query was spilling could therefore
differ from the same nest's NID a moment later. Spill directories are now left out of a nest's inputs,
matched by the exact name spill gives them, so a nest file that only looks like one still counts. The
engine package (nuthatch-engine.js) applies the same rule, so it computes the NID a node does.

Who is affected: a nest run with HOME set to its own directory. The official image is not, since its
HOME is not /nest.

Compatibility and upgrade

Replace the binary and restart. A 5.17.0 store is used as it is. A nest whose directory held spill
files when its NID was taken computes the NID a clean directory has, as 5.17.0's .admin-token
change did.