Route cluster metadata to writable primary

This commit is contained in:
admin committed 2026-10-11 00:36:16 +02:00
1 parent a71c4fa5f1
commit 43987bbadb
9 files changed
+137 -12

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
services:
metadata:
image: postgres:17-alpine
environment:
POSTGRES_DB: objectstore_test
POSTGRES_USER: objectstore_test
POSTGRES_PASSWORD: local-metadata-test-only
tmpfs:
- /var/lib/postgresql/data:size=268435456
healthcheck:
test: ["CMD-SHELL", "pg_isready -U objectstore_test -d objectstore_test"]
interval: 2s
timeout: 2s
retries: 20
mem_limit: 256m
check:
build:
context: ../..
image: lunarsky-objectstore:metadata-test
entrypoint: ["java", "--add-modules", "jdk.httpserver,java.net.http", "-cp", "/app:/app/postgresql.jar:/app/hash4j.jar", "cloud.lunarsky.store.ClusterMetadataTest"]
environment:
POSTGRES_JDBC_URL: jdbc:postgresql://127.0.0.2:5432,metadata:5432/objectstore_test?connectTimeout=1&socketTimeout=10&targetServerType=primary&hostRecheckSeconds=0
POSTGRES_ADMIN_JDBC_URL: jdbc:postgresql://metadata:5432/postgres?connectTimeout=3&socketTimeout=10
POSTGRES_USER: objectstore_test
POSTGRES_PASSWORD: local-metadata-test-only
depends_on:
metadata:
condition: service_healthy
mem_limit: 384m
+1 -1
View File
@@ -1,6 +1,6 @@
# Two-machine durability drill
Run this disposable test on two machines. Machine A runs the gateway, PostgreSQL, and one storage node; machine B runs a second storage node. Keep the node connection on a private network: the node protocol uses bearer tokens over HTTP.
Run this disposable test on two machines. Machine A runs the gateway, PostgreSQL, and one storage node; machine B runs a second storage node. Keep the node connection on a private network: this drill uses bearer tokens over HTTP and does not enable the optional node TLS setup.
Both machines need Docker. Machine A also needs Docker Compose and Python 3. The example uses loopback port 9003 on machine A and private-network port 9103 on machine B; change them if needed. Use separate test volumes, and do not point this drill at an existing ObjectStore cluster.