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 #4745 to 8.0.x: Update failover.md and some javadoc by ggivo · Pull Request #4772 · 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

Clean cherry-pick of 2861d3e1a (#4745) onto 8.x.

Rewrites docs/failover.md and updates the MultiDbConfig and HealthCheckStrategy Javadocs. Documentation only, no code changes.

Backport notes

  • Applies without conflicts; per-file patch ids match master.
  • Every identifier and default the page documents exists on 8.x.
  • Needed before the Fail over to a recovered database when the active one is inoperable #4765 backport so its docs/failover.md hunk applies. Merge this one first.

Testing

  • Compiles on JDK 8; formatter:validate passes.
  • In-page anchors resolve; no other docs link into failover.md anchors.

Note

Low Risk
Documentation and Javadoc updates only; no production code behavior changes.

Overview
Major expansion and correction of docs/failover.md for MultiDbClient / MultiDbConfig: reorganized guide outline, documents the shorter database(endpoint, weight, clientConfig) builder overload, and clarifies that the circuit breaker uses a time-based sliding window (seconds) with both minimum failures and failure rate required to trip.

New or substantially added topics include failover/failback settings (defaults such as 2 min failback interval and 1 min grace period), initialization policies (7.3+), behavior when no healthy database exists (temporary vs permanent exceptions), health-check probe parameters and policies, updated fallback exception list (ConnectionFailoverException), DatabaseSwitchEvent / SwitchReason, manual setActiveDatabase vs forceActiveDatabase, and sharper runtime add/remove/query semantics.

Javadoc-only fixes in MultiDbConfig (builder example, sliding window in seconds, failback/grace default descriptions) and HealthCheckStrategy.Config builder (documented defaults 5000 ms interval and 500 ms between probes). No runtime logic changes.

Reviewed by Cursor Bugbot for commit b057c29. 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.

All reactions
@atakavci @ggivo
Update failover.md and some javadoc (#4745)
b057c29
* - update failover.md and some javadoc

* - fix javadoc

(cherry picked from commit 2861d3e)
@ggivo ggivo added the maintenance 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:33:35.825366Z b057c29 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

  170 files   -    36    170 suites   - 36   32s ⏱️ - 8m 13s
3 287 tests  - 4 799  3 281 ✅  - 3 573  6 💤  - 1 226  0 ❌ ±0 
3 268 runs   - 4 826  3 262 ✅  - 3 592  6 💤  - 1 234  0 ❌ ±0 

Results for commit b057c29. ± Comparison against base commit af815c5.

♻️ 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 b7f5067 into 8.x Oct 5, 2026
15 of 16 checks passed

Uh oh!

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

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 5, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b057c295f2

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread docs/failover.md
Comment on lines +608 to +610
```java
// Pin redis-east as the active database for the next 10 minutes
client.forceActiveDatabase(endpoint, Duration.ofMinutes(10).toMillis());

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 5, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid passing a newly constructed endpoint to forceActiveDatabase

In the documented scenario, endpoint is a new HostAndPort equal to—but not identical to—the endpoint stored during configuration. MultiDbConnectionProvider.forceActiveDatabase() excludes the target using entry.getKey() != endpoint, so it also puts this target into the grace period; the subsequent validation then throws JedisValidationException instead of pinning it. Either fix that identity comparison or demonstrate obtaining the stored endpoint (for example from getDatabaseEndpoints()) before recommending this call.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread docs/failover.md
Comment on lines +259 to +263
MultiDbConfig config = MultiDbConfig.builder()
.database(east, 1.0f, clientConfig)
.database(west, 0.5f, clientConfig)
.initializationPolicy(InitializationPolicy.BuiltIn.ONE_AVAILABLE) // start as soon as one database is reachable
.build();

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 5, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not promise ONE_AVAILABLE starts on the first reachable database

With multiple health-checked databases, ONE_AVAILABLE does not necessarily let build() return as soon as any database is reachable. waitForInitializationPolicy() sorts endpoints by weight and waits for each specific endpoint in that order, so a slow or unreachable high-weight endpoint blocks initialization even when a lower-weight endpoint has already reported healthy. This comment should not promise immediate startup unless the provider is changed to react to health results globally.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread docs/failover.md
- **Health Check Integration**: If health checks are configured, the new database will be monitored according to the configured health check strategy
- **Duplicate Prevention**: Attempting to add an endpoint that already exists will throw a `JedisValidationException`
- **Weight-Based Selection**: The new database participates in weight-based active database selection according to its configured weight
- **Weight-Based Selection**: The new database participates in weight-based active database selection according to its configured weight. Adding a database does not switch the active database by itself; if the new database has the highest weight, the next periodic failback check will switch to it

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 5, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Condition new-database switching on failback support

When failbackSupported(false) is configured, MultiDbConnectionProvider never schedules periodicFailbackCheck(), so adding a new highest-weight database will not switch to it on any later check; it remains inactive until a failover or manual switch occurs. Qualify this behavior with failback being enabled so users who disabled automatic failback do not wait for a switch that cannot happen.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread docs/failover.md
Comment on lines +422 to +423
If you already have a configured strategy instance, `healthCheckStrategy(HealthCheckStrategy)` wraps it in a supplier for you.
The same instance is then reused for every database that shares that `DatabaseConfig`, so make sure it is thread-safe.

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 5, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prefer per-database health-check strategy instances

Thread safety alone does not make sharing this strategy instance safe. Every HealthCheckImpl treats its strategy as owned and calls strategy.close() when its database is removed or its client closes, so if the same DatabaseConfig is reused across clients—or the same instance is otherwise shared—closing one health check closes the resources still used by the others. Recommend a supplier that creates a distinct instance per database/client, or explicitly document the shared lifecycle hazard.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
This was referenced Oct 5, 2026
Backport #4765 to 8.0.x: Fail over to a recovered database when the active one is inoperable #4774
Merged
Backport #4771 to 8.0.x: Document that automatic recovery is not guaranteed after the permanent failure #4776
Merged
@ggivo ggivo added the documentation label Oct 6, 2026
@ggivo
ggivo deleted the topic/ggivo/backport/4745-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

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

documentation maintenance

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.

2 participants

@ggivo @atakavci
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.