Skip to content

Clarify duplicate host management in federated reporting docs#3645

Merged
larsewi merged 3 commits into
cfengine:masterfrom
larsewi:federated-reporting-duplicate-hosts
May 13, 2026
Merged

Clarify duplicate host management in federated reporting docs#3645
larsewi merged 3 commits into
cfengine:masterfrom
larsewi:federated-reporting-duplicate-hosts

Conversation

@larsewi
Copy link
Copy Markdown
Contributor

@larsewi larsewi commented May 12, 2026

Summary

  • Reframe the "Duplicate host management" intro around the approach distinction (source-side vs destination-side) rather than treating distributed cleanup and handle-duplicate-hostkeys as if they addressed different lifecycle scenarios. Both mechanisms address the same underlying problem: the same hostkey appearing on multiple feeders.
  • Distributed cleanup is now described as a source-side cleanup (deletes stale records from the feeders via API, before re-import).
  • Handle duplicate hostkeys is described as a destination-side filter (moves older duplicates into a dup schema on the superhub during import).
  • Added a caveat that neither mechanism deduplicates clones reporting to the same feeder, since the feeder's __hosts table is keyed on hostkey (verified against nova/db/schema.sql).
  • Dropped "fail over" from the list of causes — there is no automatic failover for federated reporting agents, only operator-driven re-bootstrap.
  • Updated the distributed_cleanup.py prompts in the bullet list and the example console session to match the current script: separate admin username/password prompts (defaulting to admin), and 2FA prompts when enabled.

Example output

# /opt/cfengine/federation/bin/distributed_cleanup.py
Enter admin username for superhub ip-172-31-12-171 [admin]: larsewi
Enter admin password for superhub ip-172-31-12-171: 
Enter email for fr_distributed_cleanup accounts: larsewi@doofus.com

Enter admin username for ip-172-31-6-8 [admin]: larsewi
Enter admin password for ip-172-31-6-8:

@larsewi larsewi force-pushed the federated-reporting-duplicate-hosts branch from 571c83a to 1d4687e Compare May 12, 2026 13:08
@larsewi larsewi marked this pull request as ready for review May 12, 2026 13:11
Comment thread content/web-ui/federated-reporting.markdown Outdated
@larsewi larsewi force-pushed the federated-reporting-duplicate-hosts branch from 1d4687e to e21408e Compare May 12, 2026 14:19
@larsewi larsewi requested a review from craigcomstock May 12, 2026 14:21
Comment thread content/web-ui/federated-reporting.markdown Outdated
Comment thread content/web-ui/federated-reporting.markdown Outdated
Comment thread content/web-ui/federated-reporting.markdown Outdated
Comment thread content/web-ui/federated-reporting.markdown Outdated
Comment thread content/web-ui/federated-reporting.markdown Outdated
A script on the superhub identifies the feeder with the most recent contact for each hostkey and then calls back into the other feeders to delete the stale records at the source, so they are never re-imported.

There are two options available for handling these situations depending on your environment: Distributed Cleanup or Handle Duplicate Hostkeys.
- [Handle duplicate hostkeys][Federated reporting#Handle duplicate hostkeys] is a _destination-side_ filter.
Copy link
Copy Markdown
Member

@olehermanse olehermanse May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope for this PR, but: Handle sounds a bit vague and might be confusing, especially when there is also distributed cleanup, I guess we could rename this mechanism and section to simply Filter duplicate hostkeys.

@olehermanse olehermanse requested a review from nickanderson May 12, 2026 23:10
Comment thread content/web-ui/federated-reporting.markdown
Comment thread content/web-ui/federated-reporting.markdown
Reframe the "Duplicate host management" intro around the approach
distinction rather than separate lifecycle scenarios: both mechanisms
address the same underlying problem (same hostkey across multiple
feeders), with distributed cleanup as a source-side cleanup and
handle duplicate hostkeys as a destination-side filter. Note that
neither deduplicates clones reporting to the same feeder, since a
feeder's __hosts table is keyed on hostkey.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Ole Herman Schumacher Elgesem <4048546+olehermanse@users.noreply.github.com>
@larsewi larsewi force-pushed the federated-reporting-duplicate-hosts branch from e74e56e to 66fab1f Compare May 13, 2026 11:40
@larsewi larsewi requested a review from olehermanse May 13, 2026 11:41
Comment thread content/web-ui/federated-reporting.markdown Outdated
Copy link
Copy Markdown
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small suggestion.

larsewi and others added 2 commits May 13, 2026 15:47
Reframe the "Duplicate host management" intro around the approach
distinction rather than separate lifecycle scenarios: both mechanisms
address the same underlying problem (same hostkey across multiple
feeders), with distributed cleanup as a source-side cleanup and
handle duplicate hostkeys as a destination-side filter. Note that
neither deduplicates clones reporting to the same feeder, since a
feeder's __hosts table is keyed on hostkey.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Ole Herman Schumacher Elgesem <4048546+olehermanse@users.noreply.github.com>
The script has since been changed to ask for admin username and
password separately (defaulting to admin) and to prompt for a 2FA
code when the admin account has 2FA enabled. Update the bullet list
and the example console session to match the current prompts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@larsewi larsewi force-pushed the federated-reporting-duplicate-hosts branch from 742c8f2 to fa3acd6 Compare May 13, 2026 13:47
@larsewi larsewi requested a review from olehermanse May 13, 2026 13:48
@olehermanse
Copy link
Copy Markdown
Member

@cf-bottom jenkins, please

@cf-bottom
Copy link
Copy Markdown

@larsewi larsewi merged commit 010ee1b into cfengine:master May 13, 2026
2 checks passed
@larsewi larsewi deleted the federated-reporting-duplicate-hosts branch May 13, 2026 14:19
@olehermanse
Copy link
Copy Markdown
Member

Should be cherry-picked to 3.27 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants