From 3d702d79463d15fec24a1e726eca91a4a72802e7 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Wed, 9 Sep 2026 14:25:54 -0700 Subject: [PATCH 1/3] docker update --- .../control_plane/docker-compose.yaml | 4 +- docs/examples/docker-compose-sharded.yaml | 155 ++++++++++++++++++ 2 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 docs/examples/docker-compose-sharded.yaml diff --git a/docs/examples/control_plane/docker-compose.yaml b/docs/examples/control_plane/docker-compose.yaml index 50ada4cb..2ce0bc26 100644 --- a/docs/examples/control_plane/docker-compose.yaml +++ b/docs/examples/control_plane/docker-compose.yaml @@ -1,5 +1,5 @@ x-pgdog: &pgdog - image: ghcr.io/pgdogdev/pgdog-enterprise:v2026-07-09 + image: ghcr.io/pgdogdev/pgdog-enterprise:v2026-09-03-2023 command: [ "pgdog", @@ -43,7 +43,7 @@ services: image: redis:7 control: - image: ghcr.io/pgdogdev/pgdog-enterprise/control:v2026-07-09 + image: ghcr.io/pgdogdev/pgdog-enterprise/control:v2026-09-03-2023 ports: - "8099:8080" environment: diff --git a/docs/examples/docker-compose-sharded.yaml b/docs/examples/docker-compose-sharded.yaml new file mode 100644 index 00000000..0b2a198e --- /dev/null +++ b/docs/examples/docker-compose-sharded.yaml @@ -0,0 +1,155 @@ +services: + # Databases + shard_0: + image: postgres:17 + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + shard_1: + image: postgres:17 + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + shard_2: + image: postgres:17 + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + + # Redis + redis: + image: redis:7 + + # Control plane with Raft + control: + image: ghcr.io/pgdogdev/pgdog-enterprise/control:9b3698eb + ports: + - "8099:8080" + environment: + RUST_LOG: warn + CONTROL_CONFIG: /etc/pgdog-control/control.toml + configs: + - source: control_config + target: /etc/pgdog-control/control.toml + healthcheck: + test: ["CMD-SHELL", "curl -fsS http://localhost:8080/healthz || exit 1"] + interval: 5s + timeout: 5s + retries: 5 + depends_on: + redis: + condition: service_started + + # The dog! + pgdog: + image: ghcr.io/pgdogdev/pgdog-enterprise:9b3698eb + command: + [ + "pgdog", + "--config", + "/etc/pgdog/pgdog.toml", + "--users", + "/etc/secrets/pgdog/users.toml", + ] + mem_limit: 1g + environment: + PGPASSWORD: postgres + healthcheck: + test: + [ + "CMD-SHELL", + "psql -h 127.0.0.1 -p 6432 -U postgres -d postgres -tAc 'SELECT 1' || exit 1", + ] + interval: 5s + timeout: 5s + retries: 5 + depends_on: + postgres: + condition: service_healthy + control: + condition: service_healthy + ports: + - "6432:6432" + configs: + - source: pgdog_config + target: /etc/pgdog/pgdog.toml + - source: pgdog_users + target: /etc/secrets/pgdog/users.toml + +configs: + control_config: + content: | + [redis] + url = "redis://redis:6379" + + [raft] + cluster_name = "pgdog" + storage_path = "/tmp/raft.redb" + token = "raft-auth-token" + + [[raft.members]] + id = 1 + address = "127.0.0.1:8080" + + pgdog_config: + content: | + [general] + port = 6432 + load_schema = "on" + + [[databases]] + name = "postgres" + host = "shard_0" + shard = 0 + port = 5432 + + [[databases]] + name = "postgres" + host = "shard_1" + shard = 1 + port = 5432 + + [[databases]] + name = "postgres" + host = "shard_2" + shard = 2 + port = 5432 + + [control] + endpoint = "http://control:8080" + token = "pgdog" + + [admin] + user = "pgdog" + password = "pgdog" + + [query_stats] + enabled = true + + [qos] + enabled = true + + pgdog_users: + content: | + [[users]] + name = "postgres" + password = "postgres" + database = "postgres" From a4993f7aef78f9883502622c1504c205529cb764 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Wed, 9 Sep 2026 14:49:35 -0700 Subject: [PATCH 2/3] raft demo --- docs/examples/docker-compose-sharded.yaml | 56 ++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/examples/docker-compose-sharded.yaml b/docs/examples/docker-compose-sharded.yaml index 0b2a198e..79186bd7 100644 --- a/docs/examples/docker-compose-sharded.yaml +++ b/docs/examples/docker-compose-sharded.yaml @@ -2,6 +2,10 @@ services: # Databases shard_0: image: postgres:17 + # entrypoint: ["/bin/sh", "-c", "exec docker-entrypoint.sh postgres >/dev/null 2>&1"] + configs: + - source: postgres_setup + target: /docker-entrypoint-initdb.d/setup.sql environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -13,6 +17,10 @@ services: retries: 5 shard_1: image: postgres:17 + # entrypoint: ["/bin/sh", "-c", "exec docker-entrypoint.sh postgres >/dev/null 2>&1"] + configs: + - source: postgres_setup + target: /docker-entrypoint-initdb.d/setup.sql environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -24,6 +32,10 @@ services: retries: 5 shard_2: image: postgres:17 + # entrypoint: ["/bin/sh", "-c", "exec docker-entrypoint.sh postgres >/dev/null 2>&1"] + configs: + - source: postgres_setup + target: /docker-entrypoint-initdb.d/setup.sql environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -45,6 +57,7 @@ services: - "8099:8080" environment: RUST_LOG: warn + RAFT_NODE_ID: "pgdog-control-1" CONTROL_CONFIG: /etc/pgdog-control/control.toml configs: - source: control_config @@ -82,7 +95,11 @@ services: timeout: 5s retries: 5 depends_on: - postgres: + shard_0: + condition: service_healthy + shard_1: + condition: service_healthy + shard_2: condition: service_healthy control: condition: service_healthy @@ -95,6 +112,34 @@ services: target: /etc/secrets/pgdog/users.toml configs: + # Shared SQL for all shards; runs only when initializing an empty data directory. + postgres_setup: + content: | + -- sharded table + CREATE TABLE users ( + id BIGINT PRIMARY KEY, + email VARCHAR NOT NULL, + tenant_id BIGINT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() + ); + + -- omnisharded table + CREATE TABLE settings ( + id BIGINT PRIMARY KEY, + name VARCHAR NOT NULL, + value VARCHAR NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() + ); + + -- sharded table with reference to omnisharded table + CREATE TABLE user_settings ( + id BIGINT PRIMARY KEY, + user_id BIGINT NOT NULL REFERENCES users(id), + tenant_id BIGINT NOT NULL, + setting_id BIGINT NOT NULL REFERENCES settings(id), + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() + ); + control_config: content: | [redis] @@ -133,6 +178,14 @@ configs: shard = 2 port = 5432 + [[sharded_tables]] + database = "postgres" + column = "tenant_id" + + [rewrite] + primary_key = "rewrite_omni_global" + split_inserts = "rewrite" + [control] endpoint = "http://control:8080" token = "pgdog" @@ -153,3 +206,4 @@ configs: name = "postgres" password = "postgres" database = "postgres" + schema_admin = true From 07422c5fbe15a8fed5cd1792263645de629384c3 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Wed, 9 Sep 2026 14:54:33 -0700 Subject: [PATCH 3/3] update ee tag --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 7271cf1a..3ede452b 100644 --- a/main.py +++ b/main.py @@ -10,7 +10,7 @@ # Latest released tag for the Enterprise Docker images. Update this in one # place; reference it in docs with {{ enterprise_tag }}. Can be overridden at # build time with the ENTERPRISE_TAG environment variable. -ENTERPRISE_TAG = os.environ.get("ENTERPRISE_TAG", "v2026-07-25") +ENTERPRISE_TAG = os.environ.get("ENTERPRISE_TAG", "v2026-09-03-2023") def define_env(env):