Skip to content

mariadb: log primary reconcile drift predicates#3214

Draft
weicao wants to merge 1 commit into
helen/mariadb-open-prs-combined-20260715t030336z-r16from
helen/mariadb-r11-primary-drift-diagnostics
Draft

mariadb: log primary reconcile drift predicates#3214
weicao wants to merge 1 commit into
helen/mariadb-open-prs-combined-20260715t030336z-r16from
helen/mariadb-r11-primary-drift-diagnostics

Conversation

@weicao

@weicao weicao commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Fresh focused r11 on addon combined 73d05dcfd2a907b7bbcb292d2f0d8d3de7d7abf1 and syncer 7502b58f45efd4fe8f2b06e5313230d9aec69510 proved an addon-side marker oscillation. After an authoritative primary write commit succeeds, the runtime primary listener reconciler enters primary-role-state-drift and starts repair before the next HA promotion. Repair retracts the authority markers, but the current aggregate log does not identify which of its four predicates first failed.

Evidence:

  • r11 first-red outer SHA256: 5ca8e2cc2a71c74d177ef3b8c4e0dd2633bab90e75a3320964494130ce6f579a
  • r11 first-red manifest SHA256: cf3d4b219a8ad4416b9133b3a615f787a86d30389677bf88fa68c12bd83081fc (14/14)
  • supplemental addon-log outer SHA256: 83aabd76e9612f9291bdefae358f75e2bc4622a5b35955f69ed00299eee69096
  • supplemental manifest SHA256: 234e06383a2362f02bbd2a5fff82cab5a0c27177ec82dd10d7d5aae345a5ee60 (3/3)
  • observed sequence: authority commit/reconcile complete at 03:22:20Z; addon runtime-primary-listener-reconcile-repair-begin at 03:22:24Z; only afterwards does the repair fail closed.

Change

Capture and log the four primary-publish predicates before repair can mutate state:

  • primary_ready
  • remote_root_fence
  • master_info
  • listener_wildcard

The fast-path decision uses that same captured snapshot. This is diagnostic observability only; it does not change the repair policy or claim to fix the oscillation.

TDD and source gates

  • RED: focused ShellSpec 30 examples, 1 failure before production instrumentation
  • GREEN: focused ShellSpec 30 examples, 0 failures
  • full MariaDB ShellSpec: 768 examples, 0 failures, 9 historical pendings
  • bash -n addons/mariadb/scripts/replication-entrypoint.sh
  • shellcheck -S error addons/mariadb/scripts/replication-entrypoint.sh
  • helm lint addons/mariadb
  • default helm template plus rendered predicate-log verification
  • git diff --check

Runtime boundary

The next focused round is diagnostic N=1 only. Its acceptance target is an unambiguous pre-mutation value for all four predicates across the commit-to-repair window. It is not release evidence, and the full suite remains NO-LAUNCH.

@weicao
weicao requested review from a team and leon-ape as code owners July 15, 2026 04:09
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (73d05dc) to head (3e51be9).

Files with missing lines Patch % Lines
...plication_merged_semisync_startup_recovery_spec.sh 0.00% 21 Missing ⚠️
Additional details and impacted files
@@                                 Coverage Diff                                  @@
##           helen/mariadb-open-prs-combined-20260715t030336z-r16   #3214   +/-   ##
====================================================================================
  Coverage                                                  0.00%   0.00%           
====================================================================================
  Files                                                       154     154           
  Lines                                                     24252   24270   +18     
====================================================================================
- Misses                                                    24252   24270   +18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leon-ape
leon-ape marked this pull request as draft July 20, 2026 02:53
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.

2 participants