fix(ns-ha): move HA rsync staging to tmpfs, sync every 10 minutes#1772
Draft
gsanchietti wants to merge 1 commit into
Draft
fix(ns-ha): move HA rsync staging to tmpfs, sync every 10 minutes#1772gsanchietti wants to merge 1 commit into
gsanchietti wants to merge 1 commit into
Conversation
gsanchietti
commented
Jul 7, 2026
Prevent HA config file corruption (null bytes) on slave failover caused by concurrent rsync writes to the persistent overlayfs. Move the rsync staging area from /usr/share/keepalived/rsync to /tmp/ns-ha (tmpfs) and reduce the sync interval from 60s to 600s. Fix the sender mkdir so the tmpfs staging dir is recreated on each run, since tmpfs is emptied at reboot. Add a uci-defaults migration that updates interval and sync_dir on both nodes for existing installs and drops the legacy staging directory. Refs #1771 Assisted-by: Claude Code:claude-opus-4-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1771
Prevents HA config corruption (null bytes) on failover.
/usr/share/keepalived/rsync(overlayfs) to/tmp/ns-ha(tmpfs)mkdirso tmpfs staging dir is recreated each run (survives reboot)Testing
Tested on a live 2-node cluster (primary
192.168.100.238, backup192.168.100.239, VIP192.168.100.240), configured vians-ha-configper the ns-ha README.interval=600,sync_dir=/tmp/ns-ha,keepalived.confvrrpinterval 600on both nodes/usr/share/keepalived/rsyncpresent anywhereLast Sync Status: Successful, staging lands in/tmp/ns-ha(159 files in restore_list)/tmp/ns-hais on tmpfs; staged configs have zero null bytes (no corruption)sync_listmarker file)/tmp/ns-hawiped by tmpfs → next sync recreates it successfully (validates themkdir "$sync_dir"fix)