Skip to content

Stop storage nodes replicating as the main server - #2098

Merged
fog-workflows[bot] merged 2 commits into
dev-branchfrom
fix/nodes-claim-web-host-identity
Nov 13, 2026
Merged

fog-workflows[bot] merged 2 commits into
dev-branchfrom
fix/nodes-claim-web-host-identity

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

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 the FOG_WEB_HOST setting 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 until FOG_WEB_HOST was one of the server's own addresses. That never happens on a storage node, or on a main server whose FOG_WEB_HOST is 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.
  • New 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:

  • FOGPingHosts again runs only on the server whose FOG_WEB_HOST resolves to one of its own addresses. Since 2024 it ran on every node. A main server whose FOG_WEB_HOST is 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

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>
@fog-workflows
fog-workflows Bot enabled auto-merge November 13, 2026 15:54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Nov 13, 2026
Merged via the queue into dev-branch with commit 9486b98 Nov 13, 2026
11 checks passed
@fog-workflows
fog-workflows Bot deleted the fix/nodes-claim-web-host-identity branch November 13, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant