feat(labrinth): Redis Cluster (#6771)

* chore(labrinth): bump to redis 1.4.1

* feat(labrinth): redis cluster

* chore: cleanup

* feat(labrinth): cache locking

* fix(labrinth): clippy

* chore(labrinth): cleanup env, remove postcard support

* chore(ci): fix test env for labrinth

* chore(labrinth): bump all key versions

* chore(labrinth): improve redis key identities handling

* chore(labrinth): simplify deadline handling

* chore(labrinth): remove unused lease tracking

* chore(labrinth): remove distributed cache locking for now

* chore(labrinth): improve redis backend init error

* feat(labrinth): expose redis read replica strategy

* chore(ci): remove other connection mode tests

* chore: split xredis crate

* feat(xredis): primaries routing

* chore: tombi fmt

* chore: clippy

* chore: update query cache
This commit is contained in:
François-Xavier Talbot
2026-07-23 11:35:02 +02:00
committed by GitHub
parent 11af2651ef
commit b4d681e713
146 changed files with 4741 additions and 2000 deletions
+252
View File
@@ -64,6 +64,255 @@ services:
interval: 3s
timeout: 5s
retries: 3
redis-cluster-0:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-0
restart: on-failure
networks:
- redis-cluster-mesh
ports:
- '127.0.0.1:7000:7000'
command:
[
'redis-server',
'--port',
'7000',
'--cluster-enabled',
'yes',
'--cluster-config-file',
'nodes.conf',
'--cluster-node-timeout',
'5000',
'--appendonly',
'no',
'--save',
'',
]
tmpfs:
- /data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '7000', 'PING']
interval: 3s
timeout: 5s
retries: 10
redis-cluster-1:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-1
restart: on-failure
networks:
- redis-cluster-mesh
ports:
- '127.0.0.1:7001:7001'
command:
[
'redis-server',
'--port',
'7001',
'--cluster-enabled',
'yes',
'--cluster-config-file',
'nodes.conf',
'--cluster-node-timeout',
'5000',
'--appendonly',
'no',
'--save',
'',
]
tmpfs:
- /data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '7001', 'PING']
interval: 3s
timeout: 5s
retries: 10
redis-cluster-2:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-2
restart: on-failure
networks:
- redis-cluster-mesh
ports:
- '127.0.0.1:7002:7002'
command:
[
'redis-server',
'--port',
'7002',
'--cluster-enabled',
'yes',
'--cluster-config-file',
'nodes.conf',
'--cluster-node-timeout',
'5000',
'--appendonly',
'no',
'--save',
'',
]
tmpfs:
- /data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '7002', 'PING']
interval: 3s
timeout: 5s
retries: 10
redis-cluster-3:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-3
restart: on-failure
networks:
- redis-cluster-mesh
ports:
- '127.0.0.1:7003:7003'
command:
[
'redis-server',
'--port',
'7003',
'--cluster-enabled',
'yes',
'--cluster-config-file',
'nodes.conf',
'--cluster-node-timeout',
'5000',
'--appendonly',
'no',
'--save',
'',
]
tmpfs:
- /data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '7003', 'PING']
interval: 3s
timeout: 5s
retries: 10
redis-cluster-4:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-4
restart: on-failure
networks:
- redis-cluster-mesh
ports:
- '127.0.0.1:7004:7004'
command:
[
'redis-server',
'--port',
'7004',
'--cluster-enabled',
'yes',
'--cluster-config-file',
'nodes.conf',
'--cluster-node-timeout',
'5000',
'--appendonly',
'no',
'--save',
'',
]
tmpfs:
- /data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '7004', 'PING']
interval: 3s
timeout: 5s
retries: 10
redis-cluster-5:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-5
restart: on-failure
networks:
- redis-cluster-mesh
ports:
- '127.0.0.1:7005:7005'
command:
[
'redis-server',
'--port',
'7005',
'--cluster-enabled',
'yes',
'--cluster-config-file',
'nodes.conf',
'--cluster-node-timeout',
'5000',
'--appendonly',
'no',
'--save',
'',
]
tmpfs:
- /data
healthcheck:
test: ['CMD', 'redis-cli', '-p', '7005', 'PING']
interval: 3s
timeout: 5s
retries: 10
redis-cluster-creator:
profiles:
- clustered-redis
image: redis:alpine
container_name: labrinth-redis-cluster-creator
networks:
- redis-cluster-mesh
depends_on:
redis-cluster-0:
condition: service_healthy
redis-cluster-1:
condition: service_healthy
redis-cluster-2:
condition: service_healthy
redis-cluster-3:
condition: service_healthy
redis-cluster-4:
condition: service_healthy
redis-cluster-5:
condition: service_healthy
entrypoint: ['sh', '-c']
command:
- |
cluster_info="$$(redis-cli -h redis-cluster-0 -p 7000 cluster info 2>/dev/null || true)"
case "$$cluster_info" in
*"cluster_state:ok"*) exit 0 ;;
esac
exec redis-cli --cluster create \
redis-cluster-0:7000 \
redis-cluster-1:7001 \
redis-cluster-2:7002 \
redis-cluster-3:7003 \
redis-cluster-4:7004 \
redis-cluster-5:7005 \
--cluster-replicas 1 \
--cluster-yes
redis-insight:
profiles:
- clustered-redis
image: redis/redisinsight:latest
container_name: labrinth-redis-insight
restart: on-failure
networks:
- redis-cluster-mesh
depends_on:
redis-cluster-creator:
condition: service_completed_successfully
ports:
- '127.0.0.1:5540:5540'
volumes:
- redis-insight-data:/data
clickhouse:
image: clickhouse/clickhouse-server
container_name: labrinth-clickhouse
@@ -234,6 +483,8 @@ services:
networks:
meilisearch-mesh:
driver: bridge
redis-cluster-mesh:
driver: bridge
volumes:
typesense-data:
meilisearch-data:
@@ -244,5 +495,6 @@ volumes:
elasticsearch-certs:
db-data:
redis-data:
redis-insight-data:
redpanda-data:
labrinth-cdn-data: