GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
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
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Test Results 170 files - 36 170 suites - 36 32s ⏱️ - 8m 13s Results for commit b057c29. ± Comparison against base commit af815c5. ♻️ This comment has been updated with latest results. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: b057c295f2
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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.
There was an error while loading. Please reload this page.
| ```java | ||
| // Pin redis-east as the active database for the next 10 minutes | ||
| client.forceActiveDatabase(endpoint, Duration.ofMinutes(10).toMillis()); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
| 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(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
| - **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 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
| 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. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.