Features
- Add support for recursive cross-shard subqueries (i.e., subquery inside another subquery) @jkaczman
- Add support for
INSERT INTO [...] SELECT [...] FROMsubqueries @jkaczman - Add support for handling subqueries in right side of boolean expression in a WHERE clause @jkaczman
- Breaking
prepared_statements_limitis now set to 5,000 by default. This is to prevent statement leaks when that setting is not set and the pg client driver does not use prepared statements optimally (e.g., tokio-postgres). @levkk - Add a bunch of CLI tools to the production Docker image to help with debugging (e.g., netstat, dig, etc.)
- Add
min_connectionsOTEL/OpenMetrics gauge which tracksmin_pool_sizefor each connection pool @meskill - Make
SIGTERMbehave likeSIGINT, preventing common misuse in cloud-native environments @meskill - Cross-shard
ORDER BYnow supportsCASEexpressions @jkaczman - Partial support for
HAVINGin cross-shard aggregates @murex971 - Support cumulative temporailty for OTEL metrics, allowing to export those metrics to servers that don't support incremental measurements, e.g., GCP @jkaczman
- Parse
URIon TLS certificates along withdnsNameto be used as identity for client-to-PgDog mTLS @eidam @levkk
Performance
- Query router performance improvements (5-12% improvement in microbenchmarks). @jkaczman
- Replace query cache mutex with a rwlock, decreasing contention on the AST cache. The cache now uses CLOCK (second chance) eviction to enforce the LRU policy. @jkaczman
- Improve cross-shard INSERT handling by grouping tuples that belong to the same shard into a single statement. @jkaczman
- Skip query routing logic in non-sharded single primary/replicas-only clusters. CPU utilization reduced by 1.3%. @jkaczman
- Make PgDog production Docker images 35% smaller @meskill
- Remove redundant clock reads in the hot path @jkaczman
Bug fixes
- Make
SETmore Postgres-compliant: return errors on incorrect parameter values, return correctParameterStatusmessages, handleRESETcorrectly forDateStyleand other parameters that have connection defaults, correctly return multipleCommandCompletemessages for multi-querySETstatements. min_pool_sizewas incorrectly rejected on[[users]]entries whenpassthrough_authwas enabled @meskill- Logical replication couldn't handle tables with primary keys that cover all table columns @levkk
- Extended protocol error recovery had an edge case that could cause PgDog to stall @levkk @frangz
- Sharding key updates were incorrectly blocked to omnisharded tables wherie they were safe @levkk
- [Enterprise] Cancelled replication tasks were incorrectly tracked as completed @meskill
- Some resharding tasks could hang on cancellation @meskill
- Some extended protocol messages (e.g., Describe) were incorrectly routed in cross-shard transactions @meskill
- PgDog would crash if it would run out of available open file descriptions. Correct behavior is to return an error and continue operations. @meskill
- Reject unsupported cross-shard aggregates with
HAVINGclause instead of returning wrong results @murex971 - Correctly parse
-cstartup parameters inStartupmessage @meskill - Cross-shard
INSERTtransaction usingtwo_phase_commit_autowould not automatically commit @meskill - Don't disconnect clients that attempt to use
LISTEN/NOTIFYwhenpub_sub_channel_sizeis 0 @murex971 - Correctly stick pg catalog omnisharded queries to one shard, allowing tools like
pg_dumpto work correctly with sharded databases @meskill GROUP BY 0and other invalid values would crash PgDog @murex971
Security
- Prevent clients directly executing PgDog-prepared statements by internal name. This only affected users that were able to authenticate to PgDog, so multi-tenant publicly accessible deployments should consider upgrading. @levkk
Code quality
- Subquery test suite runs in parallel for all DML queries @jkaczman
- Cleanup transaction handling to re-use the same simulated responses code @levkk
- Use
pg_stat_monitorextension in tests to validate correct statement routing @jkaczman - Move to self-hosted metal instances for performance regression testing @jkaczman
- Updated to latest Tokio @meskill
- Use instruction count instead of latency for microbenchmarks @jkaczman
Full Changelog: v0.1.62...v0.1.63