Skip to content
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
merged 10 commits into from
Jul 23, 2024

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Apr 5, 2024

Backport of #444 to 4.x

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
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.
@Ladicek Ladicek added this to the 4.5.10 milestone Jul 23, 2024
@Ladicek Ladicek merged commit 08337ab into vert-x3:4.x Jul 23, 2024
4 checks passed
@Ladicek Ladicek deleted the static-topology-4.x branch July 23, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant