Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
557 commits
Select commit Hold shift + click to select a range
aeefd4c
Log error messages for network failures (#289)
drdrsh Jan 19, 2023
32746aa
Removes message cloning operation required for query router (#285)
zainkabani Jan 19, 2023
e6110c0
Add more metrics to prometheus endpoint (#263)
magec Jan 19, 2023
6ba2102
Refactors is_banned logic and forces health check on unban (#288)
zainkabani Jan 20, 2023
c340882
chore(deps): bump toml from 0.5.10 to 0.5.11 (#290)
dependabot[bot] Jan 20, 2023
d3aede7
chore(deps): bump async-trait from 0.1.61 to 0.1.63 (#291)
dependabot[bot] Jan 23, 2023
187a7b2
chore(deps): bump toml from 0.5.11 to 0.6.0 (#292)
dependabot[bot] Jan 24, 2023
b39e18d
Fix formatting (#299)
levkk Jan 28, 2023
fba7f8f
Startup improvements & PAUSE/RESUME (#300)
levkk Jan 28, 2023
4fab21a
Add initial Windows support, ref #298 (#301)
Kurtsley Jan 28, 2023
488e0bc
chore(deps): bump tokio from 1.24.2 to 1.25.0 (#304)
dependabot[bot] Jan 30, 2023
a3deae9
chore(deps): bump toml from 0.6.0 to 0.7.0 (#305)
dependabot[bot] Jan 30, 2023
80fd1e9
chore(deps): bump bytes from 1.3.0 to 1.4.0 (#310)
dependabot[bot] Feb 1, 2023
4256268
chore(deps): bump hyper from 0.14.23 to 0.14.24 (#311)
dependabot[bot] Feb 4, 2023
35049d9
chore(deps): bump toml from 0.7.0 to 0.7.1 (#309)
dependabot[bot] Feb 4, 2023
f15c4db
chore(deps): bump futures from 0.3.25 to 0.3.26 (#307)
dependabot[bot] Feb 4, 2023
4438012
chore(deps): bump async-trait from 0.1.63 to 0.1.64 (#308)
dependabot[bot] Feb 4, 2023
33d86c6
Fix logging mistakes (#313)
zainkabani Feb 7, 2023
ab702a9
Introduce tcp_keepalives to PgCat (#315)
drdrsh Feb 8, 2023
629c6c7
Fix code coverage + less flakiness (#318)
drdrsh Feb 13, 2023
bae1f01
Support EC and PKCS8 private keys (#316)
tommy351 Feb 14, 2023
51d983e
Fix deprecation warnings (#319)
drdrsh Feb 14, 2023
f4a5f0a
chore(deps): bump once_cell from 1.17.0 to 1.17.1 (#320)
dependabot[bot] Feb 15, 2023
3c5a4f2
Allow shard setting with comments (#293)
jmeagher Feb 15, 2023
da4adf7
Log worker thread count at startup (#322)
zainkabani Feb 16, 2023
0bd2677
Bake toxiproxy into CI image (#323)
drdrsh Feb 17, 2023
a2af27c
Build Dockerfile.ci using Github workflows (#325)
drdrsh Feb 17, 2023
8cd189b
Move toxiproxy.deb to /tmp (#326)
drdrsh Feb 17, 2023
809ab25
Add psmisc to CI image (#327)
drdrsh Feb 17, 2023
3fd538a
More Test coverage + fix some code coverage bugs (#321)
drdrsh Feb 17, 2023
3286d40
More coverage cleanup (#328)
drdrsh Feb 17, 2023
d193106
implement show users (#329)
dat2 Feb 21, 2023
4d8e053
Fix Back-and-forth RELOAD Bug (#330)
drdrsh Feb 22, 2023
a69c073
Adds SHUTDOWN command as alternate option to sending SIGINT (#331)
zainkabani Feb 27, 2023
d6c5656
Allow sending logs to stdout by using STDOUT_LOG env var (#334)
magec Feb 28, 2023
2e71f75
chore(deps): bump sqlparser from 0.30.0 to 0.31.0 (#335)
dependabot[bot] Mar 2, 2023
a343481
chore(deps): bump tokio from 1.25.0 to 1.26.0 (#336)
dependabot[bot] Mar 2, 2023
388f670
Automatic sharding for SELECT v2 (#337)
levkk Mar 2, 2023
ffa08ce
Dev environment (#338)
magec Mar 2, 2023
9a76cb3
Add Manual host banning to PgCat (#340)
drdrsh Mar 6, 2023
352dd0b
chore(deps): bump async-trait from 0.1.64 to 0.1.66 (#342)
dependabot[bot] Mar 6, 2023
6846209
chore(deps): bump sqlparser from 0.31.0 to 0.32.0 (#343)
dependabot[bot] Mar 7, 2023
2a10f8c
chore(deps): bump serde from 1.0.152 to 1.0.154 (#348)
dependabot[bot] Mar 9, 2023
bb61c80
chore(deps): bump serde_derive from 1.0.152 to 1.0.154 (#347)
dependabot[bot] Mar 9, 2023
de0f8df
PgCat Query Mirroring (#341)
drdrsh Mar 10, 2023
da1dae0
Reorder fields in Shard to avoid ValueAfterTable errors (#349)
drdrsh Mar 10, 2023
fa8ab77
Extended query protocol sharding (#339)
levkk Mar 10, 2023
35408e0
Build on 1.67 (#350)
levkk Mar 10, 2023
8cdab19
Improve Config Documentation (#351)
drdrsh Mar 11, 2023
ac32e59
Update README.md (#352)
drdrsh Mar 11, 2023
c77b881
Update CONFIG.md (#353)
drdrsh Mar 11, 2023
c613293
Reduce memory and CPU footprint of mirroring (#369)
drdrsh Mar 15, 2023
abd8149
github/workflows: adds automated image building (#370)
Fraser-Isbester Mar 16, 2023
7bb778d
Check Slice bounds in read_message to avoid panics (#371)
drdrsh Mar 17, 2023
cba373a
Add idle client in transaction configuration (#380)
zainkabani Mar 24, 2023
7def2f7
point CI at updated repo
montanalow Mar 24, 2023
d6f8512
V1 (#383)
levkk Mar 25, 2023
0ba1483
Contributors (#384)
levkk Mar 25, 2023
b28ac5b
Update README.md
levkk Mar 26, 2023
f5d1940
chore(deps): bump regex from 1.7.1 to 1.7.3 (#385)
dependabot[bot] Mar 27, 2023
a23a1c3
chore(deps): bump async-trait from 0.1.66 to 0.1.68 (#382)
dependabot[bot] Mar 27, 2023
0dd1394
chore(deps): bump serde from 1.0.154 to 1.0.158 (#376)
dependabot[bot] Mar 27, 2023
14a78e3
chore(deps): bump toml from 0.7.2 to 0.7.3 (#360)
dependabot[bot] Mar 27, 2023
757c8fe
chore(deps): bump hyper from 0.14.24 to 0.14.25 (#358)
dependabot[bot] Mar 27, 2023
e269fcb
chore(deps): bump futures from 0.3.26 to 0.3.27 (#356)
dependabot[bot] Mar 27, 2023
f4011da
Refactor stats to use atomics (#375)
magec Mar 28, 2023
0f7758d
chore(deps): bump serde_derive from 1.0.154 to 1.0.159 (#387)
dependabot[bot] Mar 28, 2023
1ef7b28
chore(deps): bump serde from 1.0.158 to 1.0.159 (#386)
dependabot[bot] Mar 28, 2023
e9c39b9
Auth passthrough (auth_query) (#266)
magec Mar 30, 2023
d05ec62
chore(deps): bump postgres-protocol from 0.6.4 to 0.6.5 (#391)
dependabot[bot] Mar 31, 2023
1a491cc
chore(deps): bump futures from 0.3.27 to 0.3.28 (#392)
dependabot[bot] Mar 31, 2023
56ad7be
Protocol-level test helpers (#393)
drdrsh Apr 1, 2023
600b3ec
chore(deps): bump tokio-rustls from 0.23.4 to 0.24.0 (#394)
dependabot[bot] Apr 3, 2023
4b36452
Fix port; add user pool mode (#395)
levkk Apr 5, 2023
b13eeb0
A couple things (#397)
levkk Apr 10, 2023
5fc8b52
Fix typos (#398)
kianmeng Apr 11, 2023
98616cd
Load config on client connect (#401)
levkk Apr 11, 2023
6220da0
feat: set keepalive for pgcat server itself (#402)
Cluas Apr 12, 2023
8fdb6e5
chore(deps): bump hyper from 0.14.25 to 0.14.26 (#406)
dependabot[bot] Apr 14, 2023
4bb576a
chore(deps): bump sqlparser from 0.32.0 to 0.33.0 (#399)
dependabot[bot] Apr 14, 2023
eab9b08
chore(deps): bump serde_derive from 1.0.159 to 1.0.160 (#403)
dependabot[bot] Apr 14, 2023
4a5d331
chore(deps): bump serde from 1.0.159 to 1.0.160 (#404)
dependabot[bot] Apr 14, 2023
1416bff
Separate server and client passwords optionally (#407)
levkk Apr 18, 2023
acc0438
Fix CONFIG (#408)
levkk Apr 19, 2023
929666f
README updates (#409)
levkk Apr 20, 2023
5402210
chore(deps): bump regex from 1.7.3 to 1.8.0 (#411)
dependabot[bot] Apr 21, 2023
7255863
fix typo (#415)
NOBLES5E Apr 26, 2023
8d2ecec
Add more pool settings (#416)
levkk Apr 26, 2023
7a2aeed
Server TLS (#417)
levkk Apr 30, 2023
29304b4
Readme update (#418)
levkk Apr 30, 2023
6a45624
Add dns_cache for server addresses as in pgbouncer (#249)
magec May 2, 2023
06ccecd
chore(deps): bump rustls from 0.21.0 to 0.21.1 (#419)
dependabot[bot] May 2, 2023
90789bb
Plugins! (#420)
levkk May 3, 2023
1c93b49
chore(deps): bump regex from 1.8.0 to 1.8.1 (#413)
dependabot[bot] May 3, 2023
fc0e5a3
Actually plugins (#421)
levkk May 3, 2023
bdd7ed6
lowercase config query (#422)
levkk May 3, 2023
6e309ce
Optionally validate config on boot (#423)
levkk May 4, 2023
f2ebcc0
Accurate log messages (#425)
levkk May 5, 2023
ec95b7d
First try with role reset (#427)
atanner27 May 5, 2023
a563569
Calculate averages correctly and preserve totals like before (#429)
levkk May 8, 2023
36d56b9
Fix docker-compose dev stack for Apple silicon (#432)
drdrsh May 10, 2023
4440d2f
Fixes average stats bug (#436)
zainkabani May 12, 2023
fceb556
Improve logging for connection cleanup (#428)
zainkabani May 12, 2023
e1d4e50
Prewarmer (#435)
levkk May 12, 2023
78e349f
Allow to deploy pools without checking (#438)
levkk May 12, 2023
973655f
Fix time based average stats (#442)
zainkabani May 18, 2023
603cbed
Optionally clean up server connections (#444)
levkk May 18, 2023
5abd23f
Ensure data makes it to the client (#446)
levkk May 18, 2023
bcecb77
chore(deps): bump toml from 0.7.3 to 0.7.4 (#447)
dependabot[bot] May 19, 2023
cc92e91
Refactor Pool Stats to be based off of Server/Client stats (#445)
drdrsh May 23, 2023
211623f
Use latest bb8 and use Lifo as the queue strategy in the pool (#455)
zainkabani May 29, 2023
cc1dce3
Change default server lifetime and bump bb8 version to use LIFO corre…
zainkabani May 31, 2023
1e86104
Make queue strategy configurable and default to Fifo (#463)
zainkabani Jun 9, 2023
373c6f1
chore(deps): bump log from 0.4.17 to 0.4.19 (#470)
dependabot[bot] Jun 12, 2023
8a8f034
chore(deps): bump regex from 1.8.1 to 1.8.4 (#466)
dependabot[bot] Jun 12, 2023
159badf
chore(deps): bump sqlparser from 0.33.0 to 0.34.0 (#448)
dependabot[bot] Jun 12, 2023
60b898b
chore(deps): bump pin-project from 1.0.12 to 1.1.0 (#440)
dependabot[bot] Jun 12, 2023
70eaf9d
Report min_pool_size correctly (#471)
jchen1 Jun 12, 2023
9b58049
Support for prepared statements (#474)
levkk Jun 16, 2023
4ce6fb8
Log not implemented messages as debug in prometheus metrics. (#477)
jbub Jun 17, 2023
c569a66
fmt (#480)
levkk Jun 17, 2023
07e1376
Fix build (#481)
levkk Jun 17, 2023
e5a7ca4
Implement Close for prepared statements (#482)
levkk Jun 19, 2023
16caedf
Fixes the default for round robing in General (#488)
zainkabani Jun 23, 2023
6b1cf2d
[BUG] Fix binding of NULL value parameters in prepared statements (#496)
voldemarich Jul 10, 2023
5cb4162
docs: fix general.autoreload description (#491)
Cluas Jul 12, 2023
c2dcef4
chore(deps): bump rustls from 0.21.1 to 0.21.5 (#501)
dependabot[bot] Jul 12, 2023
515c7ed
Add support for tcp_user_timeout (#503)
drdrsh Jul 12, 2023
df0fd58
chore(deps): bump rustls-pemfile from 1.0.2 to 1.0.3 (#504)
dependabot[bot] Jul 13, 2023
92140f6
add "show help" command (#505)
sebawebber Jul 14, 2023
0c29934
chore(deps): bump num_cpus from 1.15.0 to 1.16.0 (#507)
dependabot[bot] Jul 14, 2023
ed436f8
push and build only in main and tags (#508)
sebawebber Jul 14, 2023
30e53af
Add cmd line parser (#512)
sebawebber Jul 18, 2023
242f000
add support for multiple log formats (#517)
sebawebber Jul 19, 2023
dfcce72
add `--no-color` option to disable colors in the terminal (#518)
sebawebber Jul 20, 2023
7443573
Fix COPY FROM and add tests (#522)
drdrsh Jul 21, 2023
be36600
Release 1.1 (#526)
levkk Jul 25, 2023
e7e7c20
Restore the ability to filter spammy log messages (#530)
Spindel Jul 27, 2023
d585ff4
Fix typo in the config documentation (#532)
bpaquet Jul 28, 2023
b93eb59
Fix for #534 and #535
levkk Aug 2, 2023
a4e1fa7
debug -> release
levkk Aug 2, 2023
1cba5f4
Add github tag as tag to image (#537)
mpfeil Aug 4, 2023
7f8629c
pgcat deb package (#539)
levkk Aug 8, 2023
d601b40
Add systemd service (#540)
levkk Aug 8, 2023
73be80f
Make infer role configurable and fix double parse bug (#533)
zainkabani Aug 8, 2023
53d24cb
Preserve existing behavior (#541)
levkk Aug 8, 2023
cd8656f
Revert "Preserve existing behavior" (#542)
levkk Aug 9, 2023
ae1477e
parse server error messages (#543)
sebawebber Aug 9, 2023
46a10d0
Handle and track startup parameters (#478)
zainkabani Aug 10, 2023
78ef6ab
Add pgcat user (#546)
levkk Aug 10, 2023
ebaf1fd
Reset instead of discard all (#549)
zainkabani Aug 16, 2023
4b2ed92
Adds option to log which parameter status is changed by the client (#…
zainkabani Aug 16, 2023
bd91d23
docs: complete the missing general items (#553)
Cluas Aug 21, 2023
77f9780
chore(deps): bump rustls-webpki from 0.100.1 to 0.100.2 (#555)
dependabot[bot] Aug 22, 2023
9843816
Fixes try_execute_command message parsing bug (#560)
zainkabani Aug 24, 2023
49e3cb0
Don't unwrap stream.peer_addr() (#562)
zainkabani Aug 25, 2023
f5ff623
Add yj to CI image (#568)
drdrsh Aug 29, 2023
843d09b
Allow pause/resuming all pools (#566)
tommyzli Aug 29, 2023
18455eb
Fix Docker image runs erroring due to glibc incompatability (#572)
hi019 Aug 30, 2023
9f4cac9
stream.peer_addr() & auth_query (#575)
hellower Aug 31, 2023
7c2ccc1
Allow configuring routing decision when no shard is selected (#578)
drdrsh Sep 11, 2023
598e71b
User-friendly error messages (#586)
levkk Sep 11, 2023
6d6f11c
Revert "User-friendly error messages" (#587)
levkk Sep 11, 2023
92260d1
Include `thread_id` in the logs (#592)
mdashti Sep 20, 2023
de68c8c
Add a cache layer to Docker for development (#594)
mdashti Sep 20, 2023
666963d
Report maxwait for clients that end up not getting a connection (#596)
levkk Sep 21, 2023
0841fc8
Mark admin clients as disconnected on error (#597)
levkk Sep 21, 2023
b364bfc
Fix incorrect data output for plugin query_logger (#601)
kevinelliott Sep 26, 2023
8d9927b
Add psql to the container image. (#607)
nicolasvan Sep 27, 2023
c702a32
chore(deps): bump webpki from 0.22.0 to 0.22.2 in /tests/rust (#609)
dependabot[bot] Oct 2, 2023
e9960e8
Automatic sharding for INSERT, UPDATE, and DELETE statements. (#610)
mdashti Oct 3, 2023
37d6bc0
Added a `Plugin` trait (#536)
mdashti Oct 3, 2023
0071f75
Added `yj` to dev Dockerfile (#612)
mdashti Oct 6, 2023
7eb58d3
Added `clippy` to CI and fixed all `clippy` warnings (#613)
mdashti Oct 10, 2023
e428c44
Removed unnecessary `clippy` overrides. (#614)
mdashti Oct 11, 2023
f3d57b1
Reduces the amount of time the get_pool operation takes (#625)
zainkabani Oct 20, 2023
d31c6ec
Reimplement prepared statements with LRU cache and statement deduplic…
zainkabani Oct 25, 2023
d6881f7
bump version (#629)
levkk Oct 26, 2023
1357268
Add connet_timeout and idle_timeout to the user (#634)
levkk Nov 6, 2023
8b37c1c
Update Dockerfile.ci with golang (#637)
sjuls Nov 8, 2023
c3213bc
Support unnamed prepared statements (#635)
sjuls Nov 9, 2023
9eb5bfa
Expose clients maxwait time in SHOW CLIENTS response via admin (#639)
calvinhughes Nov 13, 2023
23677b8
Dont cache prepared statement with errors (#647)
levkk Nov 29, 2023
af63941
Fix deb build overwriting config (#651)
levkk Dec 4, 2023
3402804
Broken blog link (#652)
levkk Dec 4, 2023
8706531
Broken blog link 2
levkk Dec 4, 2023
e805246
Require a reason when marking a server bad (#654)
alecharmon Dec 5, 2023
a4d6fee
only report wait times from clients currently waiting to match behavi…
dbabiak Dec 5, 2023
6f8ede1
Not sure how this sneaked past CI
levkk Dec 5, 2023
fe271cd
Reset wait times when checked out successfully (#656)
levkk Dec 5, 2023
411747c
Revert max_wait changes (#658)
levkk Dec 5, 2023
1bf2110
Report waiting time only for currently waiting clients (#678)
drdrsh Jan 18, 2024
e6e5d35
feat: add helm chart (#619)
david972 Feb 22, 2024
882d870
Update sqlparser to 0.41 (#666)
tobyhede Apr 13, 2024
2e0b071
Use rust:bullseye as base image (#725)
horacio-qogita Apr 19, 2024
9b06c5b
Report checkout error when all servers are down (#736)
drdrsh May 8, 2024
d8c3a86
Add TCP_NODELAY option to improve performance for large response quer…
zsand May 26, 2024
4792b43
Add STOPSIGNAL to Dockerfile (#758)
adriangb Jun 21, 2024
ede536d
update rust version in docker image (#762)
adriangb Jun 24, 2024
6f53b98
Add ExecReload option to pgcat.service for configuration reloads (#760)
dog-64 Jun 24, 2024
4fa8204
Fix lint warnings for rust-1.79 (#769)
brandonpike Jul 16, 2024
61c1aa7
Fix a Panic in admin commands (#779)
drdrsh Aug 29, 2024
0d96ba5
Fix CI image build step (#780)
drdrsh Aug 29, 2024
0dde5ea
Bump the hyper crate to v1.4.1 and rework prometheus server handling …
sarajmunjal Aug 29, 2024
866222d
Add linux/arm64 docker image build support (#774)
kwongtn Aug 29, 2024
1d59e5d
QueryRouter: route to primary when locks exists (select for update) (…
drdrsh Aug 30, 2024
4beecac
Cut 1.2.0 release (#783)
drdrsh Aug 30, 2024
08538c8
Improve Prometheus stats + Add Grafana dashboard (#785)
drdrsh Aug 31, 2024
3108944
Add test case for issue 776 (#786)
drdrsh Aug 31, 2024
fa33b2b
Fix broken integration test #740 (#787)
drdrsh Aug 31, 2024
847eae3
Make iterating on integration tests easier (#789)
drdrsh Sep 3, 2024
31418d5
Fix CI script to allow consecutive runs locally (#793)
AndrewJackson2020 Sep 5, 2024
1d58a42
Implemented python tests with pytest (#790)
AndrewJackson2020 Sep 5, 2024
358c445
Improve Prometheus exporter output (#795)
drdrsh Sep 5, 2024
e8fb7c6
Automatically start systemd service if config file is present (#800)
MrSerth Sep 6, 2024
54736b5
Automatically build deb package on a new version tag (#801)
MrSerth Sep 6, 2024
37f094b
chore(deps): bump rexml from 3.2.5 to 3.2.8 in /tests/ruby (#743)
dependabot[bot] Sep 7, 2024
323d9e6
chore(deps): bump helm/kind-action from 1.7.0 to 1.10.0 (#732)
dependabot[bot] Sep 7, 2024
a94e879
chore(deps): bump actions/setup-python from 4.1.0 to 5.1.0 (#715)
dependabot[bot] Sep 7, 2024
872f742
Implement Trust Authentication (#805)
AndrewJackson2020 Sep 10, 2024
2ad6e1b
chore(deps): bump rexml from 3.2.8 to 3.3.6 in /tests/ruby (#803)
dependabot[bot] Sep 14, 2024
4899a20
chore(deps): bump helm/chart-releaser-action from 1.5.0 to 1.6.0 (#812)
dependabot[bot] Sep 14, 2024
52d77e7
chore(deps): bump activesupport from 7.0.4.1 to 7.0.7.1 in /tests/rub…
dependabot[bot] Sep 14, 2024
4c3627f
Fix Ruby tests (#819)
drdrsh Sep 14, 2024
45d7c80
Helm chart improvements including allowing user password to be pulled…
Speissi Sep 14, 2024
a77b27b
Improve documentation for connect_timeout and add min_pool_size (#822)
smcgivern Sep 18, 2024
c9001a8
End Prometheus stats with a new line separator (#826)
MrSerth Sep 22, 2024
6c794a8
#829: read/write splitting on CTE mutable statements (#835)
jgoday Oct 23, 2024
275ad30
Rename a couple of variables (#839)
drdrsh Oct 23, 2024
bc6161d
Bump bb8 from 0.8.1 to 0.8.6 (#709)
nicolasvan Oct 28, 2024
da71bd5
Attempt a helm chart release (#844)
drdrsh Nov 2, 2024
4684030
Another no-op release for helm (#845)
drdrsh Nov 2, 2024
8238ff0
Fixing invalid setting name in pgcat.toml (#849)
nothrow Nov 7, 2024
3d48265
Do not unban replicas if a primary is available (#843)
magec Nov 7, 2024
1704d54
Fix `default_role` being ignored when `query_parser_enabled` was fals…
magec Nov 7, 2024
c60f4b0
Revert "Do not unban replicas if a primary is available" (#850)
magec Nov 7, 2024
5ecd897
Use main branch for helm chart releases (#852)
drdrsh Nov 8, 2024
801da13
Another no-op helm release (#853)
drdrsh Nov 8, 2024
74d7386
Fix contact info for Helm chart (#861)
drdrsh Nov 11, 2024
66a0488
DOCS: small typo LIMT (Update README.md) (#866)
vitaliytv Nov 17, 2024
3f3a67e
chore(deps): bump sqlparser from 0.41.0 to 0.52.0 (#870)
gmemstr Nov 23, 2024
f7692c1
Add DB activity based routing (#864)
nadavshatz Dec 22, 2024
836ba94
s/Iniitalize/Initialize/ (#897)
akesling Jan 9, 2025
aba64d6
Add checkout_failure_limit config/feature (#911)
drdrsh Feb 27, 2025
4e4e36c
Bump Rust Version on Dockerfile from 1.79.0 to 1.81 (#912)
JaLnYn Feb 27, 2025
0a9f1fc
Bump rust version on CI image (#913)
drdrsh Feb 27, 2025
853581f
Handle Flush ('H') extended-protocol message
Apr 15, 2026
6b5fd4c
Read Flush responses without waiting for ReadyForQuery
Apr 16, 2026
cb3a205
Flush response: drop double-copy parse and clone
May 21, 2026
1ff5d18
client: don't silently drop client-side prepared statement on server …
May 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: ghcr.io/postgresml/pgcat-ci:latest
environment:
RUST_LOG: info
LLVM_PROFILE_FILE: /tmp/pgcat-%m-%p.profraw
RUSTC_BOOTSTRAP: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -Cinstrument-coverage"
RUSTDOCFLAGS: "-Cpanic=abort"
- image: postgres:14
command: ["postgres", "-p", "5432", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "pg_stat_statements.max=100000"]
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --auth-local=md5 --auth-host=md5 --auth=md5
- image: postgres:14
command: ["postgres", "-p", "7432", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "pg_stat_statements.max=100000"]
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --auth-local=scram-sha-256 --auth-host=scram-sha-256 --auth=scram-sha-256
- image: postgres:14
command: ["postgres", "-p", "8432", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "pg_stat_statements.max=100000"]
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --auth-local=scram-sha-256 --auth-host=scram-sha-256 --auth=scram-sha-256
- image: postgres:14
command: ["postgres", "-p", "9432", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "pg_stat_statements.max=100000"]
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --auth-local=scram-sha-256 --auth-host=scram-sha-256 --auth=scram-sha-256

- image: postgres:14
command: ["postgres", "-p", "10432", "-c", "shared_preload_libraries=pg_stat_statements"]
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --auth-local=md5 --auth-host=md5 --auth=md5

# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
- checkout
- restore_cache:
key: cargo-lock-2-{{ checksum "Cargo.lock" }}
- run:
name: "Lint"
command: "cargo fmt --check"
- run:
name: "Clippy"
command: "cargo clippy --all --all-targets -- -Dwarnings"
- run:
name: "Tests"
command: "cargo clean && cargo build && cargo test && bash .circleci/run_tests.sh && .circleci/generate_coverage.sh"
- store_artifacts:
path: /tmp/cov
destination: coverage-data
- save_cache:
key: cargo-lock-2-{{ checksum "Cargo.lock" }}
paths:
- target
- ~/.cargo


# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
build:
jobs:
- build
15 changes: 15 additions & 0 deletions .circleci/generate_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# inspired by https://doc.rust-lang.org/rustc/instrument-coverage.html#tips-for-listing-the-binaries-automatically
TEST_OBJECTS=$( \
for file in $(cargo test --no-run 2>&1 | grep "target/debug/deps/pgcat-[[:alnum:]]\+" -o); \
do \
printf "%s %s " --object $file; \
done \
)

rust-profdata merge -sparse /tmp/pgcat-*.profraw -o /tmp/pgcat.profdata

bash -c "rust-cov export -ignore-filename-regex='rustc|registry' -Xdemangler=rustfilt -instr-profile=/tmp/pgcat.profdata $TEST_OBJECTS --object ./target/debug/pgcat --format lcov > ./lcov.info"

genhtml lcov.info --title "PgCat Code Coverage" --css-file ./cov-style.css --no-function-coverage --highlight --ignore-errors source --legend --output-directory /tmp/cov --prefix $(pwd)
158 changes: 158 additions & 0 deletions .circleci/pgcat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#
# PgCat config example.
#

#
# 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 = 6432

# 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 = 1000

# How much time to give the 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 = 5000

# 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

# Reload config automatically if it changes.
autoreload = 15000

# TLS
tls_certificate = ".circleci/server.cert"
tls_private_key = ".circleci/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 = "admin_user"
admin_password = "admin_pass"

# 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_db"
[pools.sharded_db]
# Pool mode (see PgBouncer docs for more).
# session: one server connection per connected client
# transaction: one server connection per client transaction
pool_mode = "transaction"
prepared_statements_cache_size = 500

# If the client doesn't specify, route traffic to
# this role by default.
#
# any: round-robin between primary and replicas,
# replica: round-robin between replicas only without touching the primary,
# primary: all queries go to the primary unless otherwise specified.
default_role = "any"

# Query parser. If enabled, we'll attempt to parse
# every incoming query to determine if it's a read or a write.
# If it's a read query, we'll direct it to a replica. Otherwise, if it's a write,
# we'll direct it to the primary.
query_parser_enabled = true

# If the query parser is enabled and this setting is enabled, we'll attempt to
# infer the role from the query itself.
query_parser_read_write_splitting = true

# If the query parser is enabled and this setting is enabled, the primary will be part of the pool of databases used for
# load balancing of read queries. Otherwise, the primary will only be used for write
# queries. The primary can always be explicitely selected with our custom protocol.
primary_reads_enabled = true

# So what if you wanted to implement a different hashing function,
# or you've already built one and you want this pooler to use it?
#
# Current options:
#
# pg_bigint_hash: PARTITION BY HASH (Postgres hashing function)
# sha1: A hashing function based on SHA1
#
sharding_function = "pg_bigint_hash"

# Credentials for users that may connect to this cluster
[pools.sharded_db.users.0]
username = "sharding_user"
password = "sharding_user"
# Maximum number of server connections that can be established for this user
# The maximum number of connection from a single Pgcat process to any database in the cluster
# is the sum of pool_size across all users.
pool_size = 9
statement_timeout = 0

[pools.sharded_db.users.1]
username = "other_user"
password = "other_user"
pool_size = 21
statement_timeout = 30000

# Shard 0
[pools.sharded_db.shards.0]
# [ host, port, role ]
servers = [
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ]
]
# Database name (e.g. "postgres")
database = "shard0"

[pools.sharded_db.shards.1]
servers = [
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ],
]
database = "shard1"

[pools.sharded_db.shards.2]
servers = [
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ],
]
database = "shard2"


[pools.simple_db]
pool_mode = "session"
default_role = "primary"
query_parser_enabled = true
query_parser_read_write_splitting = true
primary_reads_enabled = true
sharding_function = "pg_bigint_hash"
prepared_statements_cache_size = 500

[pools.simple_db.users.0]
username = "simple_user"
password = "simple_user"
pool_size = 5
statement_timeout = 30000

[pools.simple_db.shards.0]
servers = [
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ]
]
database = "some_db"
Loading
Loading