Malachi v0.29.1
Six fixes to acknowledgements, rebalancing, healing and segment recovery, each one found by a test, a chaos drill or a review of a promise the code made.

Malachi v0.29.1 is a patch release. It adds no feature and changes no configuration. It carries six fixes, and most of them were found the same way: a chaos drill or a careful reading of what a module promised turned up a case where the code did something else. This post walks through what each fix changes for someone running a cluster.
An acknowledgement now includes the primary
With replication group commit turned on (MALACHI_REPLICATION_GROUP_COMMIT, off by default), a write could be acknowledged once a majority of followers had flushed it to disk, before the primary's own flush. For a short window the primary could not serve a record it had just acknowledged. The reply now also waits for the primary's own durable write, as the documentation already said it did. A failed flush on the primary still answers the waiting batches with the storage error, and that error is now documented as indeterminate: the write may or may not have landed.
Rebalancing respects quorum and the lease
Two fixes touch how a rebalance moves the members of a vnode between nodes.
A new member is now started before it is announced to the group. Before, a replacement that failed to start still counted toward the vnode's quorum, so with one node already down the vnode could stop committing. A multinode test over real ra reproduces that case and shows the vnode keeps committing.
Each member change is also bounded by the rebalance lease now. Only the lease holder commits a rebalancing plan, but a change it started just before losing the lease could keep adding and removing members after another node had taken the lease and started its own plan. Every step now has a deadline derived from the lease and checks the lease again before it runs, so a holder that lost it stops.
Healing follows the topic's placement
When a node is lost, healing places new replicas of its segments elsewhere. It used to place them by the cluster-wide spread rule alone, ignoring the topic's own placement policy. It now uses the same policy as initial placement, and refills only the vacated slots around the surviving replicas, so applying the policy never drops a live replica or leaves an orphaned copy. In steady state, healing also stops making membership calls on every pass.
The heal coordinator's periodic tick also survives a slow answer from the log membership server now. The rolling upgrade drill had reported it as a crash on a node under load.
A segment that already exists
A rare crash in the chaos certification had been open since September: the replication server stopped with {:error, :already_exists} while creating a segment. The cause took three steps. A node died after creating an empty segment file and before its first write. On restart that empty file became the active segment, a seal then rolled it while the log still pointed at it, and the next write tried to create the same file again. Now a segment that holds no record is cut to zero bytes instead of sealed, and the next write takes the empty file over. A file that does hold records is refused with what the disk holds, so the copy fails with a reason instead of a crash. Tests at the Malachi.Log level and through the replication server fail before the fix and pass after it.
Upgrading
This release has no upgrade notes and no configuration changes.
Changes
Fixes
- heal honors topic placement policy (#414)
- cluster: start a rebalanced vnode member before announcing it (#412)
- grouped reply waits for primary durability (#411)
- segment already exists on ensure active (#416)
- fence rebalance member changes (#419)
- heal tick survives membership timeout (#418)
Dependencies
- deps: bump yaml_elixir to 2.13.0
Other
- release branch flow (#408)
Comments
Join the discussionNo comments yet. Be the first to comment.

