Title: Find a MariaDB link's source by host and port before a promotion (#440) by shipmill-romamo[bot] · Pull Request #442 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: Find a MariaDB link's source by host and port before a promotion (#440) by shipmill-romamo[bot] · Pull Request #442 · cloudfall-dev/cloudfall
X Title: Find a MariaDB link's source by host and port before a promotion (#440) by shipmill-romamo[bot] · Pull Request #442 · cloudfall-dev/cloudfall
Description: Summary A replica declared primary (or standalone) found its current source only by the Master_Server_Id of SHOW SLAVE STATUS. A link whose IO thread has not connected reports 0, so no declared service matched, and _promotion promoted it over a running, writable primary, which S-019-14 forbids. The rendered pair's peers now carry each service's addresses (the names of its server's MariaDB certificate: hostname, IPv4, an IP address of another family, the remoteAccess and replication listen addresses) and its port A new filter, cloudfall_mariadb_link_peer, finds the source by Master_Server_Id, and when that matches nothing, by Master_Host among a peer's addresses and Master_Port equal to its port. Hosts compare in one form: an IP address canonical (2001:DB8:0::11 is 2001:db8::11), a name lowercase without its trailing dot; a name is never resolved The matched server is read as before, so a promotion over it refuses with PRECONDITION while it is writable and names both positions A link to no declared service whose IO thread isn't Yes is now refused too, unless the controller can't reach Master_Host:Master_Port (wait_for, cloudfall_mariadb_source_probe_seconds, default 10); before, it was promoted The stand-in in engine/tests/mariadb_pair.py reports Master_Server_Id: 0 while its IO thread isn't connected Why addresses rather than only the listen address: after a role swap the old primary is declared a replica and has no listenAddress, while the new primary's link still names the address it connected to; a replica verifies its primary's certificate against that host, so it is one of the certificate's names. Plan Serves: quality bar Files: sdk/src/cloudfall/mariadb_replication.py, engine/ansible/roles/cloudfall_mariadb/filter_plugins/mariadb_replication.py, engine/ansible/roles/cloudfall_mariadb/tasks/replication_check.yml, engine/ansible/roles/cloudfall_mariadb/defaults/main.yml, engine/tests/mariadb_pair.py, engine/tests/test_s019_mariadb_replication_role.py, changelog.d/440-promote-unconnected-link.md Order: make the stand-in report Master_Server_Id: 0 while its IO thread is not connected, and add the failing S-019-14 test (a replica that can't reach its running, writable primary, declared primary, is promoted today); render each peer's addresses and port; find the source by Master_Host and Master_Port when the server id matches no peer; refuse an unmatched source whose IO thread isn't Yes unless the controller can't reach it Proof: test_s019_14_* (the new one fails on main), S-019-15 and S-019-16 unchanged and passing, the filter's table test, S-019-2's byte-identical render Test plan New: test_s019_14_an_unconnected_link_is_not_promoted_over_a_writable_primary (the role replayed on the two stand-ins: h2 cut off from h1, Connecting, server id 0, declared primary: refused with both positions, still a read-only replica that follows once it connects). It failed on main (h2 was promoted) New: test_s019_14_a_link_is_matched_to_its_source_by_server_id_or_host_and_port (id first, listen address, IPv6 forms, hostname case and root dot, a former primary by its server's address, another port, an unknown name) and test_s019_14_a_link_reporting_server_id_0_is_not_promoted_over_its_source (the issue's repro in the filter) The promotion table gained the reachable/unreachable cases for an undeclared source uv run pytest engine/tests/test_s019_mariadb_replication_role.py (27 passed, S-019-14's stopped-primary path, S-019-15 both orders and S-019-16 included), engine/tests/test_s019_mariadb_render.py (S-019-2 byte-identical), sdk/tests/test_s019_mariadb_replication.py, engine/tests/test_s019_mariadb_role.py, engine/tests/test_s019_mariadb_engine.py uv run ruff check ., uv run mypy, uv run ansible-lint engine/ansible (with ANSIBLE_CONFIG=engine/ansible/ansible.cfg, as CI) pass The full suite is left to CI Unverified: whether a live replica reports Master_Server_Id: 0 while its IO thread connects; the proving run #441 checks it Fixes #440 🤖 Generated with Claude Code
Open Graph Description: Summary A replica declared primary (or standalone) found its current source only by the Master_Server_Id of SHOW SLAVE STATUS. A link whose IO thread has not connected reports 0, so no declared ser...
X Description: Summary A replica declared primary (or standalone) found its current source only by the Master_Server_Id of SHOW SLAVE STATUS. A link whose IO thread has not connected reports 0, so no declared ser...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/pull/442
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b6ea0e47-13f1-78fd-23d1-bd1309a1f632 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D790:21890A:19BA1AC:21C63A0:6B05594A |
| html-safe-nonce | a10151ddc7ab0c058db7b2580e52173840da7ade10e2ab08382f9d86dc0c4328 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzkwOjIxODkwQToxOUJBMUFDOjIxQzYzQTA6NkIwNTU5NEEiLCJ2aXNpdG9yX2lkIjoiNDkzMzI0MDY4NTgyNjc2ODEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e30bacb3480b76dacdadd94a3c331e2bb48b0871889382ecfed2279346939655 |
| hovercard-subject-tag | pull_request:5342926546 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/cloudfall-dev/cloudfall/pull/442/files |
| twitter:image | https://avatars.githubusercontent.com/u/5600783?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5600783?s=400&v=4 |
| og:image:alt | Summary A replica declared primary (or standalone) found its current source only by the Master_Server_Id of SHOW SLAVE STATUS. A link whose IO thread has not connected reports 0, so no declared ser... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git |
| octolytics-dimension-user_id | 339512759 |
| octolytics-dimension-user_login | cloudfall-dev |
| octolytics-dimension-repository_id | 1360999777 |
| octolytics-dimension-repository_nwo | cloudfall-dev/cloudfall |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1360999777 |
| octolytics-dimension-repository_network_root_nwo | cloudfall-dev/cloudfall |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10dff83edfd4f3617a7792a152d44991587b434c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width