Title: Promote over an undeclared MariaDB source only when it refuses the controller (S-019-14) by shipmill-romamo[bot] · Pull Request #454 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: Promote over an undeclared MariaDB source only when it refuses the controller (S-019-14) by shipmill-romamo[bot] · Pull Request #454 · cloudfall-dev/cloudfall
X Title: Promote over an undeclared MariaDB source only when it refuses the controller (S-019-14) by shipmill-romamo[bot] · Pull Request #454 · cloudfall-dev/cloudfall
Description: Plan Serves: quality bar (Q-1) Files: 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/test_s019_mariadb_replication_role.py, sdk/src/cloudfall/mariadb_replication.py (docstring only), changelog.d/446-promotion-unreachable-source.md Order: first the failing tests in engine/tests/test_s019_mariadb_replication_role.py (a replica declared primary whose undeclared source times out, can't be resolved, or answers its link with an auth or TLS error is promoted today); then the plan reads the replica's Last_IO_Errno before anything else, the controller's probe classifies its outcome by the socket error (refused, timeout, no route, unresolved) in place of wait_for, which reports every failure as a timeout, and only a refusal promotes; then the host fallback's comments say what the code does (any server_id that matches no peer, not only 0); then the changelog fragment Proof: S-019-14 role stand-in runs for each outcome (refused promotes; timeout or no route, an unresolvable name, an auth error and a TLS error each stop with PRECONDITION service_mariadb_promotion_unsafe and change nothing), the plan's table for each probe outcome and IO error, the probe's classifier for each socket error, and link_peer matching by host and port when the reported server_id is no peer's Summary A replica declared primary whose link's source is no declared service was promoted whenever the controller's wait_for probe of the source's port failed. wait_for swallows every connect error and reports one Timeout when waiting for host:port (checked in ansible-core 2.22's wait_for.py), so a source alive but unreachable from the controller was promoted over and both servers took writes (S-019-14). The plan reads the replica's own Last_IO_Errno first: an error only a running source sends (1045 access denied, 1129/1130 host blocked or not allowed, 1251 auth method, 2026 TLS, 1236 the source's binlog error) refuses with PRECONDITION service_mariadb_promotion_unsafe wait_for is replaced by a filter, cloudfall_mariadb_source_probe, run on the controller, that classifies the socket error by type and errno: open, refused, timeout, no-route, unresolved, failed. Only refused promotes; the others refuse, naming what the controller couldn't read, with a way out (let the controller reach the port, or remove the stopped source's link with RESET SLAVE ALL) A promotion over a refused source now says its source refuses connections on host:port instead of its source can not be reached link_peer's host fallback already ran for any server_id that matches no peer, not only 0; I kept that behaviour (it reads the server at a peer's address rather than treat it as a source Cloudfall can't read, which is what #442 meant) and fixed the comments in the filter, replication_check.yml and the SDK docstring to match The declared-source path is unchanged Test plan uv run pytest engine/tests/test_s019_mariadb_replication_role.py: 50 passed. The new role stand-in test test_s019_14_an_undeclared_source_is_promoted_over_only_when_it_refuses failed on main in 5 of 5 cases (the four refusal cases promoted, and the refused case had the old reason) uv run pytest sdk/tests/test_s019_mariadb_replication.py: passed uv run ruff check ., uv run mypy, ANSIBLE_CONFIG=engine/ansible/ansible.cfg uv run ansible-lint engine/ansible: pass Full suite left to CI Not verified on live servers: the Last_IO_Errno values MariaDB reports for an auth or TLS failure (from MariaDB's error codes, not seen on a live replica), and the timeout case in the stand-in reaches a documentation address (203.0.113.11), which reads as a timeout or no route depending on the network Fixes #446 🤖 Generated with Claude Code
Open Graph Description: Plan Serves: quality bar (Q-1) Files: engine/ansible/roles/cloudfall_mariadb/filter_plugins/mariadb_replication.py, engine/ansible/roles/cloudfall_mariadb/tasks/replication_check.yml, engine/ansib...
X Description: Plan Serves: quality bar (Q-1) Files: engine/ansible/roles/cloudfall_mariadb/filter_plugins/mariadb_replication.py, engine/ansible/roles/cloudfall_mariadb/tasks/replication_check.yml, engine/ansib...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/pull/454
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:64265ae9-945c-a1f9-094d-1863e7544f13 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AFF8:5028D:19DA11C:21EFBF6:6B055800 |
| html-safe-nonce | 6c0d973622c3ec43b840e04ad3bbf12e512a23ed46fd8e461c9131384ad4ccbd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkY4OjUwMjhEOjE5REExMUM6MjFFRkJGNjo2QjA1NTgwMCIsInZpc2l0b3JfaWQiOiI0ODI3NDY1NDY0OTM2NzQ5MDU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 534450b104fb0a85ada07f5cd1431b50a0e032c8197831f2bfd84778a8a6181d |
| hovercard-subject-tag | pull_request:5345499676 |
| 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/454/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 | Plan Serves: quality bar (Q-1) Files: engine/ansible/roles/cloudfall_mariadb/filter_plugins/mariadb_replication.py, engine/ansible/roles/cloudfall_mariadb/tasks/replication_check.yml, engine/ansib... |
| 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