postgresml/pgcat

Pgcat not working with spilo timescale

Opened this issue · 1 comments

Describe the bug
pgcat says shard0 is down whenever i try to connect with spilo timescale db, it works well with normal timescale image while says shard0 down with spilo image although i am able to connect the spilo timescale db without pgcat .

my config---

# General pooler settings
[general]
# What IP to run on, 0.0.0.0 means accessible from everywhere.
host = "0.0.0.0"

# Port to run on, same as PgBouncer used in this example.
port = 5432

# Whether to enable prometheus exporter or not.
enable_prometheus_exporter = true

# Port at which prometheus exporter listens on.
prometheus_exporter_port = 9930

# How long to wait before aborting a server connection (ms).
connect_timeout = 5000

# How much time to give `SELECT 1` health check query to return with a result (ms).
healthcheck_timeout = 1000

# How long to keep connection available for immediate re-use, without running a healthcheck query on it
healthcheck_delay = 30000

# How much time to give clients during shutdown before forcibly killing client connections (ms).
shutdown_timeout = 60000

# For how long to ban a server if it fails a health check (seconds).
ban_time = 60 # seconds

# If we should log client connections
log_client_connections = false

# If we should log client disconnections
log_client_disconnections = false

# TLS
# tls_certificate = "server.cert"
# tls_private_key = "server.key"

# Credentials to access the virtual administrative database (pgbouncer or pgcat)
# Connecting to that database allows running commands like `SHOW POOLS`, `SHOW DATABASES`, etc..
admin_username = "postgres"
admin_password = "zalando"

# pool
# configs are structured as pool.<pool_name>
# the pool_name is what clients use as database name when connecting
# For the example below a client can connect using "postgres://sharding_user:sharding_user@pgcat_host:pgcat_port/sharded"

[pools.postgres]
pool_mode = "session"
default_role = "any"
query_parser_enabled = true
query_parser_read_write_splitting = true
primary_reads_enabled = true
sharding_function = "pg_bigint_hash"
[pools.postgres.users.0]
username = "postgres"
password = "zalando"
pool_size = 25
server_lifetime = 60000
statement_timeout = 0
[pools.postgres.shards.0]

# [ host, port, role ]
servers = [
    [ "postgres", 6432, "primary" ],
    [ "postgres", 6432, "replica" ]
]

database = "postgres"

the docker compose i am using

version: '3'

services:
  postgres:
    image: alfredcapital/spilo-15:v8
    ports:
      - "6432:6432"  # Map the PostgreSQL port
    environment:
      SPILO_PROVIDER: "local"
      PGPORT: 6432
      SPILO_CONFIGURATION: |
        postgresql:
          create_replica_methods:
            - wal_e
          connect_address: 0.0.0.0:6432
          use_pg_rewind: true
          use_slots: true
          parameters:
            max_connections: '2000'
            max_replication_slots: '64'
          authentication:
            replication:
              password: standby
              username: standby
            superuser:
              password: postgres
              username: postgres
    volumes:
      - ./pgdata:/home/postgres/pgdata

  pgcat:
    image: ghcr.io/postgresml/pgcat:7994a661d90bdb8d7796014de89047a0c914e905
    command:
      - "pgcat"
      - "/etc/pgcat/pgcat.toml"
    volumes:
      - "./pgcat.toml:/etc/pgcat/pgcat.toml"
    ports:
      - "5432:5432"
      - "9930:9930"
    depends_on:
      - postgres

eror throws

desktop-pgcat-1 | 2023-09-06T09:58:38.595845Z ERROR pgcat::pool: Shard 0 down or misconfigured: TimedOut
desktop-pgcat-1 | 2023-09-06T09:58:38.595894Z ERROR pgcat::pool: Shard 0 down or misconfigured: TimedOut
desktop-pgcat-1 | 2023-09-06T09:58:38.595906Z ERROR pgcat::pool: Could not validate connection pool

@Ajaiswal2610 Did you ever determine what the issue was here?