Title: A replica whose link hasn't connected is promoted over a writable primary (S-019-14) · Issue #440 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: A replica whose link hasn't connected is promoted over a writable primary (S-019-14) · Issue #440 · cloudfall-dev/cloudfall
X Title: A replica whose link hasn't connected is promoted over a writable primary (S-019-14) · Issue #440 · cloudfall-dev/cloudfall
Description: Found in the review of #437 (MariaDB replication, S-019-14), which landed with this open. The gap When a replica is declared primary (or standalone), the role finds its current source by the Master_Server_Id that SHOW SLAVE STATUS report...
Open Graph Description: Found in the review of #437 (MariaDB replication, S-019-14), which landed with this open. The gap When a replica is declared primary (or standalone), the role finds its current source by the Master...
X Description: Found in the review of #437 (MariaDB replication, S-019-14), which landed with this open. The gap When a replica is declared primary (or standalone), the role finds its current source by the Master...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/issues/440
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"A replica whose link hasn't connected is promoted over a writable primary (S-019-14)","articleBody":"Found in the review of #437 (MariaDB replication, S-019-14), which landed with this open.\n\n## The gap\n\nWhen a replica is declared `primary` (or standalone), the role finds its current source by the `Master_Server_Id` that `SHOW SLAVE STATUS` reports, matched against the declared services' `serverId` (`engine/ansible/roles/cloudfall_mariadb/tasks/replication_check.yml`, \"Name the other server of the pair\"). If nothing matches, `_promotion` in `engine/ansible/roles/cloudfall_mariadb/filter_plugins/mariadb_replication.py` refuses only while `Slave_IO_Running` is `Yes`; otherwise it promotes with \"its source can not be reached\", without reading the source.\n\n`Master_Server_Id` is learned when the IO thread connects. A replica that restarted and whose IO thread is still `Connecting` (the primary unreachable from the replica, a firewall change, or just not connected yet) is expected to report `0` (unverified on a live server). Then no peer matches, `Slave_IO_Running` is `Connecting`, and the replica is promoted while its old primary may still be running and writable: both servers take writes, which S-019-14 says must be refused.\n\nReproduced in the filter alone: `cloudfall_mariadb_replication_plan` with a link row of `Master_Server_Id: 0`, `Slave_IO_Running: Connecting`, a declared role of `primary`, and the old primary declared in the project returns `{'action': 'promote', 'reason': 'its source can not be reached'}`.\n\n## Expected\n\nThe source is found by `Master_Host` and `Master_Port` too (both are in the link row before the IO thread connects), matched against the declared services' rendered addresses, so the promotion reads the old primary and refuses while it is reachable and writable. A link whose source matches no declared service by either key, and whose IO thread isn't `Yes`, is still refused unless the source can't be reached from the controller.\n\n## Touches\n\n- `engine/ansible/roles/cloudfall_mariadb/tasks/replication_check.yml`\n- `engine/ansible/roles/cloudfall_mariadb/filter_plugins/mariadb_replication.py`\n- the rendered pair (`peers` needs each service's host and port)\n- `engine/tests/test_s019_mariadb_replication_role.py`, `engine/tests/mariadb_pair.py` (the stand-in should report `Master_Server_Id: 0` until its IO thread connects)\n\n\u003c!-- shipmill:agent -->\n","author":{"url":"https://github.com/apps/shipmill-romamo","@type":"Person","name":"shipmill-romamo"},"datePublished":"2026-11-16T17:45:38Z","url":"https://github.com/cloudfall-dev/cloudfall/issues/440"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:35469e1a-afa4-9794-ef87-b1a7912f860f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7B0:E0CE1:24E0706:30B3D5B:6B0558A5 |
| html-safe-nonce | 7cd7b3bdcee93cf9350e2e5a27ccc8320d15da791f9d283c643bdebdaa743f12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0IwOkUwQ0UxOjI0RTA3MDY6MzBCM0Q1Qjo2QjA1NThBNSIsInZpc2l0b3JfaWQiOiIzNzI2NjIzNjY0MzE0MzQxNTQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 81f3af6d023547b421c47bd5e76b7081d509a50ef25b4ffd16fc159d260d0e0d |
| hovercard-subject-tag | issue:6427165221 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/cloudfall-dev/cloudfall/440/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94c78ac8c7019343cccce13899aa989b8cdc535f7601be13033d9e1fa5394cb5/cloudfall-dev/cloudfall/issues/440 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94c78ac8c7019343cccce13899aa989b8cdc535f7601be13033d9e1fa5394cb5/cloudfall-dev/cloudfall/issues/440 |
| og:image:alt | Found in the review of #437 (MariaDB replication, S-019-14), which landed with this open. The gap When a replica is declared primary (or standalone), the role finds its current source by the Master... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shipmill-romamo[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | a79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width