GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Backport #4765 to 8.0.x: Fail over to a recovered database when the active one is inoperable by ggivo · Pull Request #4774 · redis/jedis

Conversation

@ggivo

@ggivo ggivo commented Oct 5, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Cherry-pick of c0c3c5da4 (#4765) onto 8.x.

After the active database became inoperable, MultiDbClient could stay on it even when a lower-weight database had recovered. Failover is now also attempted when a non-active database turns healthy, and when a command finds the active database unusable and another one usable.

Fixes #4764 for the 8.0.x line.

Backport notes

  • Applies without conflicts, including the docs/failover.md hunk (needs Backport #4745 to 8.0.x: Update failover.md and some javadoc #4772, merged).
  • MultiDbConnectionProvider.java and MultiDbConnectionProviderTest.java match master. The only adaptation is in MultiDbProviderHealthStatusChangeTest: mockConnectionPool() mocks TrackingConnectionPool, which master gets from [maintenance events] Smart Client Handoffs (SCH): maintenance notifications support #4668 (not on 8.x).

Testing

Run on JDK 8 against the local Docker Redis environment:

  • mcf unit and integration tests plus MultiDbProviderHealthStatusChangeTest: 305 tests, 0 failures.
  • With MultiDbConnectionProvider.java reverted to 8.x, 4 of the new or updated tests fail: userCommand_afterPermanent_onlySecondaryHealthyAgain_failsOverAutomatically_healthCheckDriven, userCommand_connectionExceptions_thenMultipleTemporary_thenPermanent_inOrder, postInit_assertOperability_candidateOperableAfterItsGrace_failsOverToIt, postInit_healthyEventWithoutFailoverTarget_countsAsFailoverAttempt.

Note

Medium Risk
Changes core MultiDb failover timing and active-DB selection on health events and failed commands; behavior shifts from “stay on broken active until manual failback” to automatic switch to any operable endpoint.

Overview
Fixes a case where MultiDbClient could remain pinned to an inoperable active database even after a lower-weight replica became usable again.

Health status changes: When a non-active database reports healthy, the provider now calls failoverIfActiveInoperable() if the active database is still unhealthy—not only when the active DB turns unhealthy. Failed failover attempts from health events still swallow exceptions so the health-check scheduler keeps running, with an updated warn log.

Command path: assertOperability() (used when a command cannot get a connection from the active DB) now attempts an immediate switch to any operable database instead of only throwing temporary/permanent “no healthy database” exceptions when a candidate exists. Switches use tryLock so in-flight failing commands do not block on an ongoing switch.

Docs clarify that recovery can happen automatically via health checks or the next command (any weight), and tweak SwitchReason.HEALTH_CHECK wording.

Tests are updated and expanded for automatic recovery after permanent outage, command-driven failover, grace-period timing, and forceActiveDatabase pinning behavior.

Reviewed by Cursor Bugbot for commit eae1b1d. Bugbot is set up for automated code reviews on this repo. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@ggivo
Fail over to a recovered database when the active one is inoperable (#…
eae1b1d
…4765)

(cherry picked from commit c0c3c5d)

8.x adaptation: MultiDbProviderHealthStatusChangeTest mocks
TrackingConnectionPool (master gets this from #4668).
@ggivo ggivo added the bug label Oct 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T12:51:29.262487Z eae1b1d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Test Results

  206 files  ±0    206 suites  ±0   8m 7s ⏱️ +8s
8 098 tests ±0  8 030 ✅ ±0  68 💤 ±0  0 ❌ ±0 
8 118 runs  ±0  8 050 ✅ ±0  68 💤 ±0  0 ❌ ±0 

Results for commit eae1b1d. ± Comparison against base commit b7f5067.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ggivo
ggivo merged commit 53fecac into 8.x Oct 5, 2026
15 of 18 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ggivo ggivo mentioned this pull request Oct 5, 2026
Backport #4771 to 8.0.x: Document that automatic recovery is not guaranteed after the permanent failure #4776
Merged
@ggivo
ggivo deleted the topic/ggivo/backport/4765-8.0.x branch October 14, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@ggivo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.