Skip to content

docs-v1.1.0 (ruby): document Blue/Green blue-connection invalidation and MySQL timeout failover - #59

Merged
aaron-congo merged 4 commits into
ruby/1.1.0from
docs/ruby-1.1.0-bg-failover-fixes
Nov 5, 2026
Merged

aaron-congo merged 4 commits into
ruby/1.1.0from
docs/ruby-1.1.0-bg-failover-fixes

Conversation

@aaron-congo

Copy link
Copy Markdown
Contributor

Description

Documents three Ruby wrapper changes shipping in 1.1.0.

Blue/Green: invalidating blue connections after a switchover (aws/aws-advanced-ruby-driver-wrapper#223)

  • Adds the new bg_drop_blue_connections parameter (Boolean, default true) to the Blue/Green plugin page. Its description covers:
    • when connections are invalidated: from the Post phase on, and only if the plugin saw the switchover in progress. Nothing is invalidated on rollback, or if bg_switchover_timeout_sec runs out before Post.
    • what the next use of an invalidated connection raises, with and without the failover plugin. Without failover, ActiveRecord may reconnect and retry a retryable query.
  • Adds the invalidation step to the "After the switchover" phase bullet and to the phase diagram.
  • Adds a note to the planned-maintenance scenario. Pooled blue connections now raise FailoverSuccessError (or TransactionStateUnknownError) on their next use when failover is listed alongside bg, so applications should handle that the way they handle a failover.

Enhanced failover: MySQL timeouts and idle connections (aws/aws-advanced-ruby-driver-wrapper#234)

  • Adds a "Timeouts and idle connections on MySQL" section. It lists what now triggers failover on mysql2 and trilogy:
    • a read_timeout;
    • a connection the server closed after wait_timeout (error 4031 on MySQL 8.0.24 and later);
    • a lost connection.
  • The section also covers:
    • what the application sees, and that ActiveRecord doesn't retry it;
    • how to avoid failovers caused by slow queries or idle pooled connections (read_timeout, wait_timeout, ActiveRecord's idle_timeout);
    • that lock wait timeouts (error 1205) don't fail over.
  • A "Changed in 1.1.0" note describes the previous behavior for anyone upgrading.
  • Adds aws_trilogy to the ActiveRecord adapter lists on the failover page.
  • The scenario builder's ActiveRecord retry hint now says that FailoverSuccessError and TransactionStateUnknownError are not retried.

Development guide: storage service (aws/aws-advanced-ruby-driver-wrapper#226)

  • Storage service reads now publish a DataAccessEvent only when called with register_access: true. The Storage Service and Event Publisher entries are updated to match.

Which docs are affected?

Ruby Blue/Green Deployment plugin page, Enhanced Failover page, Set up by Scenario builder (Blue/Green and ActiveRecord retry notes), and the Development Guide's Service Container page.

Checklist

  • I read CONTRIBUTING.md.
  • This change is to the docs, not to a wrapper's source (those go in the wrapper's own repo).
  • I built the site locally and the affected pages render correctly.
  • Links I added or changed resolve, including the wrapper-switched variants where relevant.
  • No security-sensitive information is included (see SECURITY.md).

…and MySQL timeout failover

- Blue/Green: add bg_drop_blue_connections to the parameters, the phase
  list, and the planned-maintenance scenario note.
- Enhanced failover: document that mysql2 and trilogy fail over on
  read_timeout, wait_timeout disconnects (4031), and lost connections,
  with guidance on read_timeout and idle pooled connections.
- Development guide: storage service reads publish a DataAccessEvent
  only with register_access: true.
- Correct how error 2055 surfaced under aws_mysql2 before 1.1.0
  (StatementInvalid, not ConnectionFailed).
- Say the failover plugin must be listed alongside bg rather than
  calling it on by default, and note the cost of opting out.
- Move blue-connection invalidation into the After the switchover
  phase, add it to the phase diagram, and cover the ActiveRecord
  retry and switchover-timeout cases in bg_drop_blue_connections.
- Add aws_trilogy to the ActiveRecord adapter lists on the failover
  page, and qualify the idle-connection and MySQL version wording.
- Note that ActiveRecord's query retries skip FailoverSuccessError.
- Update the remaining dev-guide references to register_access.
@aaron-congo
aaron-congo requested a review from a team as a code owner November 5, 2026 17:17
Comment thread content/failover.yaml Resolved
Comment thread content/plugins.yaml Resolved
…aise

With the failover plugin, reusing an invalidated blue connection can
still fail to reconnect and raise FailoverFailedError, so name all
three failover errors and link to them instead of implying the
reconnect always succeeds.
@aaron-congo
aaron-congo merged commit 96272db into ruby/1.1.0 Nov 5, 2026
2 checks passed
@aaron-congo
aaron-congo deleted the docs/ruby-1.1.0-bg-failover-fixes branch November 5, 2026 18:57
sophia-bq added a commit that referenced this pull request Nov 5, 2026
* docs-v1.1.0 (ruby): document custom endpoint credentials and host selection strategy validation (#40)

* docs: federated auth (#44)

* Merge main into ruby/1.1.0 (#58)

* docs-v1.1.0 (ruby): document Blue/Green blue-connection invalidation and MySQL timeout failover (#59)

* docs-v1.1.0 (ruby): document trilogy support (#60)

* docs: trilogy support

* fix: include recommended driver properties when iam is selected

* docs: telemetry (#61)

* fix: include trilogy in notes

* fix: swap tables for fiddle warning

---------

Co-authored-by: Aaron <69273634+aaron-congo@users.noreply.github.com>
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