-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x] Add support for static topology configuration for the replication client #445
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8e4f68f
to
feb52b1
Compare
The `READONLY` command is sent to replicas as a setup command before the connection is handed to the caller. This command should only be sent to replicas in the cluster mode (see [1]). The sentinel mode didn't use it, but the replication mode did, which is a bug and causes all replicas to be ignored (because the setup command fails). This commit fixes it. [1] https://redis.io/commands/readonly/
- add logging configuration, more readable than JUL default
feb52b1
to
b21218d
Compare
For each Redis deployment style (standalone, replication, sentinel, cluster), there's a class that can be used as a JUnit test rule and internally uses Testcontainers to run Redis. They provide some basic startup guarantees, so users don't need to wait for a server to come online etc. The helper class for standalone Redis allows customizing the Redis version, setting a password, and enabling TLS (including mutual TLS). The multi-node variants assume basic configuration and don't allow customization. These standalone helper classes uses the Bitnami image, because it provides environment variables for all the necessary customizations. Other helper classes use custom-built images.
The improvements mostly consist of using the new Redis helper classes for running standalone/replication/sentinel/cluster Redis, instead of the previous approach with a single container for multi-node deployments, which is not realistic and can hide bugs, but there are other improvements too. Notably, the TLS test uses actual Redis TLS support instead of a Vert.x-based TLS proxy, and the multi-node tests verify that data replication actually works. Some useless tests are deleted, too.
In one of the tests (`testPublishSubscribe`), the subscription connection wasn't used at all and instead, the publication connection was used both for subscription and publication. This commit fixes that.
b21218d
to
49efd5d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #444 to
4.x