Skip to content

Add automation config snapshot debugging feature#890

Draft
nammn wants to merge 2 commits intovm-migration-feature-branchfrom
ac-following
Draft

Add automation config snapshot debugging feature#890
nammn wants to merge 2 commits intovm-migration-feature-branchfrom
ac-following

Conversation

@nammn
Copy link
Collaborator

@nammn nammn commented Mar 11, 2026

Summary

Add debug-only automation config snapshot feature to track AC changes step-by-step. When MDB_AC_SNAPSHOT=true is set on the operator pod, each PUT to the automationConfig endpoint is captured as a numbered diff in a <resource-name>-ac-snapshot ConfigMap.

Why: Debugging complex AC change sequences (like auth migrations) requires visibility into what changed between each reconcile step. Current logging doesn't preserve the full change history.

What:

  • Add HTTP client hook to capture successful PUT requests
  • Compute diffs between consecutive AC versions using r3labs/diff
  • Filter out auto-managed fields (mongodbVersions, builds, etc.)
  • Store numbered steps in ConfigMap for inspection

Proof of Work

ConfigMap created with step-by-step diffs showing X.509 → SCRAM-256 migration:

  • step-001: Initial AC structure created
  • step-002: Auth made authoritative
  • step-003: X.509 auth enabled
  • step-004: Replica set and processes added
  • step-005: SCRAM-256 added to deployment auth mechanisms
  • step-006: TLS mode relaxed to OPTIONAL
  • step-007: Auth disabled
  • step-008: Switched to SCRAM-256 (removed X.509, added autoPwd)

Full ConfigMap output validates the feature works end-to-end.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@nammn nammn changed the title ac hook Add automation config snapshot debugging feature Mar 11, 2026
@nammn nammn added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant