Repository navigation
Stop storage nodes replicating as the main server - #2098
Merged
fog-workflows[bot] merged 2 commits intoNov 13, 2026
Merged
Conversation
getIPAddress() appended the FOG_WEB_HOST setting to the server's own address list. That setting is the main server's address, and every storage node reads the same database, so every node listed the main server's address as its own. checkIfNodeMaster() then matched the main server's storage node row on each node, and each node replicated as the main server. A node holding short copies pushed them over the full files on the other storage groups every cycle (forum 18313). The append was there so waitInterfaceReady() could finish: it waited for FOG_WEB_HOST to be a local address, which never happens on a storage node, or on a main server whose FOG_WEB_HOST is a name or an address on no interface. The wait now needs only a storage node address to be up, as in 1.5.10. The wait message names those node addresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On a FOG server with storage nodes, every storage node replicated images as if it were the main server. One node holding short copies of large files pushed them over the full files on the other storage groups every hour, and the main server then copied the full files back. The files never stayed complete (forum topic 18313). The node's own log shows it:
We are node ID: 1. We are node name: TV-Fog-Main.Cause
FOGBase::getIPAddress()added theFOG_WEB_HOSTsetting to the server's own address list. That setting is the main server's address, and every node reads the same database. So on every node,FOGService::checkIfNodeMaster()matched the main server's storage node row as "this machine".The line came in with cf4b237 (2024-07-05). At that time
waitInterfaceReady()held each daemon untilFOG_WEB_HOSTwas one of the server's own addresses. That never happens on a storage node, or on a main server whoseFOG_WEB_HOSTis a name other than its reverse-DNS name. Adding the setting to the list made that check always pass.Change
getIPAddress()returns only this machine's addresses, plus the two loopback addresses, as 1.5.10 does.waitInterfaceReady()waits only for a storage node address to be up, as 1.5.10 does. Its wait message now names those addresses.tests/self-ips-exclude-web-host.test.php. It fails on the current dev-branch for both halves of the change, and passes with the fix.Behavior that changes
These checks now match only the server's real addresses, as in 1.5.10:
FOGPingHostsagain runs only on the server whoseFOG_WEB_HOSTresolves to one of its own addresses. Since 2024 it ran on every node. A main server whoseFOG_WEB_HOSTis an address on none of its interfaces (NAT) stops pinging hosts, as on 1.5.10.isTrustedNodeIp()no longer gives a storage node the main server's group's trusted ranges. A caller that only falls inside such a range must now sign its request or come from a registered storage node address.🤖 Generated with Claude Code