I've looked onto code, and it seems it does not send SelectDB to rueidis, nor uses ParseURL, and InitAddress contains only host, so it always connects to default database 0.
What did you expect to happen?
Anycable-go uses database 2.
What actually happened?
On the clear Redis instance it sets keys only for database 0.
On the other side, gem anycable does change the database number depending on the url, and will create a key in a not default database.
Anycable-go logs:
DEBUG 2023-09-07T05:38:12.974Z context=main 🔧 🔧 🔧 Debug mode is on 🔧 🔧 🔧 [5/6804]
INFO 2023-09-07T05:38:12.974Z context=main Starting AnyCable 1.4.3-214a549 (pid: 1, open file limit: 1048576, gomaxprocs: 8)
INFO 2023-09-07T05:38:12.974Z context=main Anonymized telemetry is on. Learn more: https://docs.anycable.io/anycable-go/telemetry
INFO 2023-09-07T05:38:12.974Z context=main Using in-memory broker (epoch: yR3N, history limit: 5000, history ttl: 20s, sessions ttl: 300s)
DEBUG 2023-09-07T05:38:12.974Z context=disconnector Calls rate: 10ms
WARN 2023-09-07T05:38:12.974Z context=main Using a non-distributed broadcaster without a pub/sub enabled; each broadcasted message is only processed by a single node
INFO 2023-09-07T05:38:12.974Z consumer=Zir5Yw context=broadcast id=Zir5Yw provider=redisx stream=__anycable__ Starting Redis broadcaster at redis:6379
INFO 2023-09-07T05:38:12.975Z context=rpc RPC controller initialized: localhost:50051 (concurrency: 28, impl: grpc, enable_tls: false, proto_versions: v
INFO 2023-09-07T05:38:12.975Z context=main Handle WebSocket connections at http://0.0.0.0:8080/cable
INFO 2023-09-07T05:38:12.975Z context=main Handle health requests at http://0.0.0.0:8080/health
DEBUG 2023-09-07T05:38:12.975Z context=main Go pools initialized (remote commands: 256)
DEBUG 2023-09-07T05:38:12.975Z context=http Starting WebSocket server at http://0.0.0.0:8080
DEBUG 2023-09-07T05:38:12.975Z context=metrics No metrics writers. Disable metrics rotation
AnyCable-Go version: 1.4.3-214a549
AnyCable gem version: anycable (1.4.1)
What did you do?
We are using Anycable with a single-instance Redis, and it appears that Anycable-go ignores the Redis database number.
For clarity in the experiment, I ran only anycable-go with the following configuration:
Based on the output of --help, it seems that the Redis URL is detected correctly(as it changes default to "redis://redis:6379/2"):
I've looked onto code, and it seems it does not send SelectDB to rueidis, nor uses ParseURL, and InitAddress contains only host, so it always connects to default database 0.
What did you expect to happen?
Anycable-go uses database 2.
What actually happened?
On the clear Redis instance it sets keys only for database 0.
On the other side, gem anycable does change the database number depending on the url, and will create a key in a not default database.
Anycable-go logs: