Lev Kokotov
7987c5ffad
Replace a few types with more developer-friendly names ( #182 )
...
* Replace a few types with more developer-friendly names
* UserPool -> PoolIdentifier
2022-10-01 10:25:59 -07:00
zainkabani
24f5eec3ea
Change sharding config to enum and move validation of configs into public functions ( #178 )
...
Moves config validation to own functions to enable tools to use them
Moves sharding config to enum
Makes defaults public
Make connect_timeout on pool and option which is overwritten by general connect_timeout
2022-09-28 08:50:14 -05:00
Mostafa Abdelraouf
af064ef447
Set client state to idle after error ( #179 )
...
* Set client state to idle after error
* fmt
* spelling
* clean up
2022-09-24 09:09:15 -07:00
Lev Kokotov
19fd677891
Fix the pool fix ( #176 )
...
* Always listen to the compiler
* Its fine
2022-09-23 12:06:07 -07:00
Lev Kokotov
964a5e1708
Don't drop connections if DB hasn't changed ( #175 )
...
* Don't drop connections if DB hasn't changed
* Incoporate connect_timeout into the pool config
* use the field
2022-09-23 11:32:05 -07:00
Mostafa Abdelraouf
d126c7424d
Log failed client logins ( #173 )
...
* Log failed client logins
* more logging
* remove clones
* remove
2022-09-23 09:08:38 -07:00
zainkabani
f72dac420b
Add defaults for configs ( #174 )
...
* add statement timeout to readme
* Add defaults to various configs
* primary read enabled default to false
2022-09-22 23:00:46 -07:00
zainkabani
3a729bb75b
Minor refactor for configs ( #172 )
...
* Changes shard struct to use vector of ServerConfig
* Adds to query router
* Change client disconnect with error message to warn instead of debug
* Add warning logs for clean up actions
2022-09-22 10:07:02 -07:00
zainkabani
85cc2f4147
Update to latest library versions ( #170 )
2022-09-21 13:48:33 -07:00
zainkabani
8c09ab6c20
Export pgcat objects in lib ( #169 )
...
* Export pgcat objects in lib
* fmt
2022-09-20 18:47:32 -07:00
Mostafa Abdelraouf
f7a951745c
Report Query times ( #166 )
...
* Report avg and total query timing
* Report query times
* fmt
2022-09-15 02:21:45 -04:00
Mostafa Abdelraouf
4ae1bc8d32
Add SHOW CLIENTS / SHOW SERVERS + Stats refactor and tests ( #159 )
...
* wip
* Main Thread Panic when swarmed with clients
* fix
* fix
* 1024
* fix
* remove test
* Add SHOW CLIENTS
* revert
* fmt
* Refactor + tests
* fmt
* add test
* Add SHOW SERVERS + Make PR unreviewable
* prometheus
* add state to clients and servers
* fmt
* Add application_name to server stats
* Add tests for waiting clients
* Docs
* remove comment
* comments
* typo
* cleanup
* CI
2022-09-14 11:20:41 -04:00
Mostafa Abdelraouf
9514b3b2d1
Clean connection state up after protocol named prepared statement ( #163 )
...
* Clean connection state up after protocol named prepared statement
* Avoid cloning + add test
* fmt
2022-09-07 20:37:17 -07:00
Mostafa Abdelraouf
744ceada86
Better logging for failure to get connection from pool ( #161 )
2022-09-07 08:24:07 -07:00
Mostafa Abdelraouf
a5c8dd69b2
Avoid reporting ProtocolSyncError when admin session disconnects ( #160 )
...
* Avoid reporting ProtocolSyncError when admin session disconnects
* rebuild
* rebuild
2022-09-06 22:22:31 -07:00
zainkabani
6a9a4db648
Adds microsecond logging and also reformats duration to include milliseconds ( #156 )
...
* Adds microsecond logging and also reformats duration to include milliseconds
* fmt
* attempt to fix cd
* revert
2022-09-05 01:21:27 -07:00
Mostafa Abdelraouf
976b406468
Main Thread Panic when swarmed with clients ( #158 )
...
* Main Thread Panic when swarmed with clients
* fix
* fix
* 1024
* fix
* remove test
* Update src/client.rs
* Update src/main.rs
* Update src/client.rs
* Update src/main.rs
Co-authored-by: Lev Kokotov <levkk@users.noreply.github.com >
2022-09-05 01:21:06 -07:00
zain-kabani
417358c35d
Patch graceful shutdown bug ( #157 )
...
* Fixes non-admin client counting error
* Add log when sigterm received and log number of active clients when shutdown timeout is reached
2022-09-05 01:02:49 -07:00
Mostafa Abdelraouf
23a642f4a4
Send DISCARD ALL even if client is not in transaction ( #152 )
...
* Send DISCARD ALL even if client is not in transaction
* fmt
* Added tests + avoided sending extra discard all
* Adds set name logic to beginning of handle client
* fmt
* refactor dead code handling
* Refactor reading command tag
* remove unnecessary trim
* Removing debugging statement
* typo
* typo{
* documentation
* edit text
* un-unwrap
* run ci
* run ci
Co-authored-by: Zain Kabani <zain.kabani@instacart.com >
2022-09-01 20:06:55 -07:00
Mostafa Abdelraouf
7f20dc3054
Better handling extended protocol messages in the event of busy pool ( #155 )
...
* Better handling for checkout errors during extended protocol messages
* Fix specs
* comment
2022-09-01 15:02:39 -07:00
Mostafa Abdelraouf
36339bd96f
Log Address information in connection create/drop ( #154 )
...
* Log Address information in connection create/drop
* run ci
2022-09-01 11:16:22 -07:00
zainkabani
2628dec42e
Move autoreloader to own tokio task ( #148 )
2022-08-29 00:08:44 -07:00
Mostafa Abdelraouf
3bc4f9351c
Exit with failure codes if configs are bad ( #146 )
...
* Exit with failure codes if configs are bad
* fmt
2022-08-25 18:56:18 -07:00
Lev Kokotov
9d84d6f131
Graceful shutdown and refactor ( #144 )
...
* Graceful shutdown and refactor
* ok
* _Graceful_ shutdown
* Remove hardcoded setting
* clean up
* end
* timeout
* hmm
* hmm!
* bash
* bash
* hmm
* maybe maybe
* Adds tests and move non-admin connection rejection to startup (#145 )
* Move error response
* Adds tests and removes unused variable
* Adds debug log
Co-authored-by: zainkabani <77307340+zainkabani@users.noreply.github.com >
2022-08-25 06:40:56 -07:00
Mostafa Abdelraouf
c054ff068d
Avoid sending Z packet in the middle of extended protocol packet sequence if we fail to get connection from pool ( #137 )
...
* Failing test
* maybe
* try fail
* try
* add message
* pool size
* correct user
* more
* debug
* try fix
* see stdout
* stick?
* fix configs
* modify
* types
* m
* maybe
* make tests idempotent
* hopefully fails
* Add client fix
* revert pgcat.toml change
* Fix tests
2022-08-23 11:02:23 -07:00
Lev Kokotov
5a0cea6a24
Really fix idle servers ( #141 )
2022-08-22 11:56:40 -07:00
Lev Kokotov
d0e8171b1b
Fix too many idle servers ( #140 )
...
* Fix too many idle servers
* oops
2022-08-22 11:52:34 -07:00
Lev Kokotov
069d76029f
Fix incorrect routing for replicas ( #139 )
...
* Fix incorrect routing for replicas
* name
2022-08-21 22:40:49 -07:00
Mostafa Abdelraouf
5f5b5e2543
Random instance selection ( #136 )
...
* wip
* revert some'
* revert more
* poor-man's integration test
* remove test
* fmt
* --workspace
* fix build
* fix integration test
* another stab
* log
* run after integration
* cargo test after integration
* revert
* revert more
* Refactor + clean up
* more clean up
2022-08-21 22:15:20 -07:00
zainkabani
5948fef6cf
Minor Refactoring of re-used code and server stat reporting ( #129 )
...
* Minor changes to stats reporting and recduce re-used code
* fmt
2022-08-18 05:12:38 -07:00
Mostafa Abdelraouf
790898c20e
Add pool name and username to address object ( #128 )
...
* Add pool name and username to address object
* Fix address name
* fmt
2022-08-17 08:40:47 -07:00
Pradeep Chhetri
d64f6793c1
Minor cleanup in admin command ( #126 )
...
* Minor cleanup in admin command
* Typo correction
* fix when the admin query is ending with semicolon
2022-08-16 10:01:46 -07:00
Lev Kokotov
cea35db35c
Fix lost statistics ( #125 )
...
* Lost events
* more logging
2022-08-15 23:54:49 -07:00
Mostafa Abdelraouf
a3aefabb47
Add cl_idle to SHOW POOLS ( #124 )
2022-08-15 20:51:37 -07:00
Lev Kokotov
3285006440
Statement timeout + replica imbalance fix ( #122 )
...
* Statement timeout
* send error message too
* Correct error messages
* Fix replica inbalance
* disable stmt timeout by default
* Redundant mark_bad
* revert healthcheck delay
* tests
* set it to 0
* reload config again
2022-08-13 13:45:58 -07:00
Pradeep Chhetri
52303cc808
Make prometheus port configurable ( #121 )
...
* Make prometheus port configurable
* Update circleci config
2022-08-13 10:25:14 -07:00
Lev Kokotov
be254cedd9
Fix debug log ( #120 )
2022-08-11 22:47:47 -07:00
zainkabani
f963b12821
Health check delay ( #118 )
...
* initial commit of server check delay implementation
* fmt
* spelling
* Update name to last_healthcheck and some comments
* Moved server tested stat to after require_healthcheck check
* Make health check delay configurable
* Rename to last_activity
* Fix typo
* Add debug log for healthcheck
* Add address to debug log
2022-08-11 14:42:40 -07:00
Nicholas Dujay
1b166b462d
create a prometheus exporter on a standard http port ( #107 )
...
* create a hyper server and add option to enable it in config
* move prometheus stuff to its own file; update format
* create metric type and help lookup table
* finish the metric help type map
* switch to a boolean and a standard port
* dont emit unimplemented metrics
* fail if curl returns a non 200
* resolve conflicts
* move log out of config.show and into main
* terminating new line
* upgrade curl
* include unimplemented stats
2022-08-09 12:19:11 -07:00
Mostafa Abdelraouf
7592339092
Prevent clients from sticking to old pools after config update ( #113 )
...
* Re-acquire pool at the beginning of Protocol loop
* Fix query router + add tests for recycling behavior
2022-08-09 12:18:27 -07:00
zainkabani
3719c22322
Implementing graceful shutdown ( #105 )
...
* Initial commit for graceful shutdown
* fmt
* Add .vscode to gitignore
* Updates shutdown logic to use channels
* fmt
* fmt
* Adds shutdown timeout
* Fmt and updates tomls
* Updates readme
* fmt and updates log levels
* Update python tests to test shutdown
* merge changes
* Rename listener rx and update bash to be in line with master
* Update python test bash script ordering
* Adds error response message before shutdown
* Add details on shutdown event loop
* Fixes response length for error
* Adds handler for sigterm
* Uses ready for query function and fixes number of bytes
* fmt
2022-08-08 16:01:24 -07:00
Mostafa Abdelraouf
106ebee71c
Fix local dev ( #112 )
...
* Fix Dev env
* Update tests/sharding/query_routing_setup.sql
* Update tests/sharding/query_routing_setup.sql
* bring pgcat.toml on ci and local dev to parity
* more parity
* pool names
* pool names
* less diff
* fix tests
* fmt
* add other user to setup
Co-authored-by: Lev Kokotov <levkk@users.noreply.github.com >
2022-08-08 13:15:48 -07:00
Mostafa Abdelraouf
b828e62408
Report banned addresses as disabled ( #111 )
2022-08-08 07:50:29 -07:00
Mostafa Abdelraouf
499612dd76
Add user to SHOW STATS query ( #108 )
...
* Add user to SHOW STATS query
* user_name => username
2022-08-03 18:16:53 -07:00
Mostafa Abdelraouf
1b648ca00e
Send proper server parameters to clients using admin db ( #103 )
...
* Send proper server parameters to clients using admin db
* clean up
* fix python test
* build
* Add python
* missing &
* debug ls
* fix tests
* fix tests
* fix
* Fix warning
* Address comments
2022-07-31 19:52:23 -07:00
Mostafa Abdelraouf
35381ba8fd
Add test for config Serializer ( #102 )
...
* Add test for serializer
* fmt
2022-07-30 16:28:25 -07:00
Mostafa Abdelraouf
e591865d78
Avoid ValueAfterTable when serializing configs ( #101 )
2022-07-30 16:12:02 -07:00
Mostafa Abdelraouf
48cff1f955
Slightly more light weight health check ( #100 )
2022-07-29 11:58:25 -07:00
Mostafa Abdelraouf
8a06fc4047
Add Serialize trait to configs ( #99 )
2022-07-28 15:42:04 -07:00
Pradeep Chhetri
14d4dc45f5
Minor fix for some stats ( #97 )
2022-07-27 22:59:33 -07:00