From 431c73484d3ee75cc6a8b1e151812b3f618838df Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 30 Apr 2026 18:08:06 -0700 Subject: [PATCH 1/3] feat: add missing settings --- templates/config.yaml | 102 ++++++++++++++++++++++++++- test/values-pgdog-config-extras.yaml | 65 +++++++++++++++++ 2 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 test/values-pgdog-config-extras.yaml diff --git a/templates/config.yaml b/templates/config.yaml index ec8613f..4963209 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -26,6 +26,12 @@ data: {{- if hasKey .Values "banTimeout" }} ban_timeout = {{ include "pgdog.intval" .Values.banTimeout }} {{- end }} + {{- if hasKey .Values "banReplicaLag" }} + ban_replica_lag = {{ include "pgdog.intval" .Values.banReplicaLag }} + {{- end }} + {{- if hasKey .Values "banReplicaLagBytes" }} + ban_replica_lag_bytes = {{ include "pgdog.intval" .Values.banReplicaLagBytes }} + {{- end }} rollback_timeout = {{ include "pgdog.intval" (.Values.rollbackTimeout | default "5_000") }} load_balancing_strategy = {{ .Values.loadBalancingStrategy | default "round_robin" | quote }} read_write_strategy = {{ .Values.readWriteStrategy | default "conservative" | quote }} @@ -92,6 +98,18 @@ data: {{- if hasKey .Values "twoPhaseCommitAuto" }} two_phase_commit_auto = {{ .Values.twoPhaseCommitAuto }} {{- end }} + {{- if .Values.twoPhaseCommitWalDir }} + two_phase_commit_wal_dir = {{ .Values.twoPhaseCommitWalDir | quote }} + {{- end }} + {{- if .Values.twoPhaseCommitWalSegmentSize }} + two_phase_commit_wal_segment_size = {{ include "pgdog.intval" .Values.twoPhaseCommitWalSegmentSize }} + {{- end }} + {{- if .Values.twoPhaseCommitWalFsyncInterval }} + two_phase_commit_wal_fsync_interval = {{ include "pgdog.intval" .Values.twoPhaseCommitWalFsyncInterval }} + {{- end }} + {{- if .Values.twoPhaseCommitWalCheckpointInterval }} + two_phase_commit_wal_checkpoint_interval = {{ include "pgdog.intval" .Values.twoPhaseCommitWalCheckpointInterval }} + {{- end }} {{- if .Values.systemCatalogs }} system_catalogs = {{ .Values.systemCatalogs | quote }} {{- end }} @@ -104,6 +122,12 @@ data: {{- if .Values.reshardingParallelCopies }} resharding_parallel_copies = {{ include "pgdog.intval" .Values.reshardingParallelCopies }} {{- end }} + {{- if .Values.reshardingCopyRetryMaxAttempts }} + resharding_copy_retry_max_attempts = {{ include "pgdog.intval" .Values.reshardingCopyRetryMaxAttempts }} + {{- end }} + {{- if .Values.reshardingCopyRetryMinDelay }} + resharding_copy_retry_min_delay = {{ include "pgdog.intval" .Values.reshardingCopyRetryMinDelay }} + {{- end }} {{- if hasKey .Values "reloadSchemaOnDdl" }} reload_schema_on_ddl = {{ .Values.reloadSchemaOnDdl }} {{- end }} @@ -159,6 +183,36 @@ data: {{- if hasKey .Values "lsnCheckTimeout" }} lsn_check_timeout = {{ include "pgdog.intval" .Values.lsnCheckTimeout }} {{- end }} + {{- if .Values.queryLog }} + query_log = {{ .Values.queryLog | quote }} + {{- end }} + {{- if .Values.rewriteShardKeyUpdates }} + rewrite_shard_key_updates = {{ .Values.rewriteShardKeyUpdates | quote }} + {{- end }} + {{- if hasKey .Values "uniqueIdMin" }} + unique_id_min = {{ include "pgdog.intval" .Values.uniqueIdMin }} + {{- end }} + {{- if .Values.uniqueIdFunction }} + unique_id_function = {{ .Values.uniqueIdFunction | quote }} + {{- end }} + {{- if hasKey .Values "cutoverTrafficStopThreshold" }} + cutover_traffic_stop_threshold = {{ include "pgdog.intval" .Values.cutoverTrafficStopThreshold }} + {{- end }} + {{- if hasKey .Values "cutoverReplicationLagThreshold" }} + cutover_replication_lag_threshold = {{ include "pgdog.intval" .Values.cutoverReplicationLagThreshold }} + {{- end }} + {{- if hasKey .Values "cutoverLastTransactionDelay" }} + cutover_last_transaction_delay = {{ include "pgdog.intval" .Values.cutoverLastTransactionDelay }} + {{- end }} + {{- if hasKey .Values "cutoverTimeout" }} + cutover_timeout = {{ include "pgdog.intval" .Values.cutoverTimeout }} + {{- end }} + {{- if .Values.cutoverTimeoutAction }} + cutover_timeout_action = {{ .Values.cutoverTimeoutAction | quote }} + {{- end }} + {{- if hasKey .Values "cutoverSaveConfig" }} + cutover_save_config = {{ .Values.cutoverSaveConfig }} + {{- end }} {{- range .Values.databases }} [[databases]] @@ -199,18 +253,27 @@ data: {{- if .serverLifetime }} server_lifetime = {{ include "pgdog.intval" .serverLifetime }} {{- end }} + {{- if .reshardingOnly }} + resharding_only = {{ .reshardingOnly }} + {{- end }} + {{- if .lbWeight }} + lb_weight = {{ include "pgdog.intval" .lbWeight }} + {{- end }} {{- end }} {{- range .Values.mirrors }} [[mirroring]] source_db = {{ .sourceDb | quote }} destination_db = {{ .destinationDb | quote }} - {{- if .queueDepth }} - queue_depth = {{ include "pgdog.intval" .queueDepth }} + {{- if or .queueLength .queueDepth }} + queue_length = {{ include "pgdog.intval" (.queueLength | default .queueDepth) }} {{- end}} {{- if .exposure }} exposure = {{ .exposure }} {{- end }} + {{- if .level }} + level = {{ .level | quote }} + {{- end }} {{- end }} {{- range .Values.shardedSchemas }} @@ -266,7 +329,7 @@ data: {{- end }} {{- end }} - {{- if or (hasKey .Values "tcpKeepalive") (hasKey .Values "tcpTime") (hasKey .Values "tcpInterval") (hasKey .Values "tcpRetries") }} + {{- if or (hasKey .Values "tcpKeepalive") (hasKey .Values "tcpTime") (hasKey .Values "tcpInterval") (hasKey .Values "tcpRetries") (hasKey .Values "tcpUserTimeout") (hasKey .Values "tcpCongestionControl") }} [tcp] {{- if hasKey .Values "tcpKeepalive" }} keepalive = {{ .Values.tcpKeepalive }} @@ -280,6 +343,12 @@ data: {{- if hasKey .Values "tcpRetries" }} retries = {{ include "pgdog.intval" .Values.tcpRetries }} {{- end }} + {{- if hasKey .Values "tcpUserTimeout" }} + user_timeout = {{ include "pgdog.intval" .Values.tcpUserTimeout }} + {{- end }} + {{- if hasKey .Values "tcpCongestionControl" }} + congestion_control = {{ .Values.tcpCongestionControl | quote }} + {{- end }} {{- end }} {{- if or (hasKey .Values "memoryNetBuffer") (hasKey .Values "memoryMessageBuffer") (hasKey .Values "memoryStackSize") }} @@ -342,6 +411,33 @@ data: split_inserts = {{ .Values.rewrite.splitInserts | default "error" | quote }} primary_key = {{ .Values.rewrite.primaryKey | default "ignore" | quote }} {{- end }} + + {{- if .Values.multiTenant }} + [multi_tenant] + column = {{ .Values.multiTenant.column | quote }} + {{- end }} + + {{- if .Values.otel }} + [otel] + {{- if .Values.otel.endpoint }} + endpoint = {{ .Values.otel.endpoint | quote }} + {{- end }} + {{- if .Values.otel.namespace }} + namespace = {{ .Values.otel.namespace | quote }} + {{- end }} + {{- if .Values.otel.datadogApiKey }} + datadog_api_key = {{ .Values.otel.datadogApiKey | quote }} + {{- end }} + {{- if .Values.otel.pushInterval }} + push_interval = {{ include "pgdog.intval" .Values.otel.pushInterval }} + {{- end }} + {{- if .Values.otel.headers }} + [otel.headers] + {{- range $k, $v := .Values.otel.headers }} + {{ $k }} = {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} {{- range .Values.plugins }} {{- if .config }} {{ .name }}.toml: | diff --git a/test/values-pgdog-config-extras.yaml b/test/values-pgdog-config-extras.yaml new file mode 100644 index 0000000..9b49e49 --- /dev/null +++ b/test/values-pgdog-config-extras.yaml @@ -0,0 +1,65 @@ +# Test recently-added pgdog-config settings. +# Covers: ban_replica_lag*, 2PC WAL persistence, resharding copy retries, +# query_log, rewrite_shard_key_updates, unique_id_*, cutover_*, +# tcp user_timeout/congestion_control, mirroring queue_length/level, +# database lb_weight/resharding_only, multi_tenant, otel. + +banReplicaLag: 60_000 +banReplicaLagBytes: 10_000_000 + +twoPhaseCommitWalDir: /var/lib/pgdog/wal +twoPhaseCommitWalSegmentSize: 16777216 +twoPhaseCommitWalFsyncInterval: 2 +twoPhaseCommitWalCheckpointInterval: 60 + +reshardingCopyRetryMaxAttempts: 3 +reshardingCopyRetryMinDelay: 1_000 + +queryLog: /var/log/pgdog/queries.log +rewriteShardKeyUpdates: error + +uniqueIdMin: 1_000_000 +uniqueIdFunction: compact + +cutoverTrafficStopThreshold: 1_000_000 +cutoverReplicationLagThreshold: 0 +cutoverLastTransactionDelay: 1_000 +cutoverTimeout: 30_000 +cutoverTimeoutAction: abort +cutoverSaveConfig: false + +tcpKeepalive: true +tcpUserTimeout: 30_000 +tcpCongestionControl: cubic + +multiTenant: + column: tenant_id + +# Mirroring with level = "dml" requires the query parser +queryParser: "on" + +otel: + endpoint: https://otlp.example.com/v1/metrics + namespace: pgdog + datadogApiKey: dd-api-key-value + pushInterval: 10_000 + headers: + DD-API-KEY: header-value + X-Custom: foo + +databases: + - name: primary + host: db.example.com + port: 5432 + lbWeight: 100 + - name: shard0 + host: shard0.example.com + role: primary + reshardingOnly: true + +mirrors: + - sourceDb: primary + destinationDb: primary_mirror + queueLength: 256 + exposure: 0.5 + level: dml From fa3449887ec10b52cf0c4355591908f9f9b0fc50 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 30 Apr 2026 18:08:44 -0700 Subject: [PATCH 2/3] bump versions --- Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 4e9d69a..c9393da 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: pgdog -version: v0.55 -appVersion: "0.1.37" +version: v0.56 +appVersion: "0.1.39" From 5d610a89a4d8eb5255a88b8298fe337427f331c7 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 30 Apr 2026 18:11:56 -0700 Subject: [PATCH 3/3] query log --- templates/config.yaml | 3 --- test/values-pgdog-config-extras.yaml | 1 - 2 files changed, 4 deletions(-) diff --git a/templates/config.yaml b/templates/config.yaml index 4963209..1cce341 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -183,9 +183,6 @@ data: {{- if hasKey .Values "lsnCheckTimeout" }} lsn_check_timeout = {{ include "pgdog.intval" .Values.lsnCheckTimeout }} {{- end }} - {{- if .Values.queryLog }} - query_log = {{ .Values.queryLog | quote }} - {{- end }} {{- if .Values.rewriteShardKeyUpdates }} rewrite_shard_key_updates = {{ .Values.rewriteShardKeyUpdates | quote }} {{- end }} diff --git a/test/values-pgdog-config-extras.yaml b/test/values-pgdog-config-extras.yaml index 9b49e49..bfecd6c 100644 --- a/test/values-pgdog-config-extras.yaml +++ b/test/values-pgdog-config-extras.yaml @@ -15,7 +15,6 @@ twoPhaseCommitWalCheckpointInterval: 60 reshardingCopyRetryMaxAttempts: 3 reshardingCopyRetryMinDelay: 1_000 -queryLog: /var/log/pgdog/queries.log rewriteShardKeyUpdates: error uniqueIdMin: 1_000_000