Commit Graph

1721 Commits

Author SHA1 Message Date
Andrey Borodin d9b829c901 Add route lock during server connection retry 2019-06-27 17:01:05 +05:00
Andrey Borodin 8dff1aabef Wait for server connection on "too many connections" if pool_timeout!=0
This reflects PgBouncer behavior on query_wait_timeout and should help
replace cascades of PgBouncers. Currently if wave of incoming
connections is coordinated casecade of PgBouncers will try smooth peak
with at least 2 seconds wait, while Odyssey just resest every
connection with is over role connection limit.
2019-06-27 16:43:26 +05:00
Andrey Borodin 99b1979ea5 Reformat code 2019-06-26 10:49:51 +05:00
Michael Goryainov 7b6fb2ded7 * Corrected SEGFAULT in case of non-existent user in auth_query
+ Added ability for host-based authentification a-la pg_hba:
  e.g.
  auth_query "SELECT usename, passwd FROM pg_shadow,pg_hba_net WHERE usename='%u' AND ((pg_shadow.usename=pg_hba_net.username and network >> '%h') OR (SELECT COUNT(*) FROM pg_hba_net WHERE username='%u'))
2019-06-25 17:09:31 +03:00
Andrey Borodin f8f8db1ac5 Add logging for start, stop and client error 2019-06-17 11:35:21 +05:00
Dmitry Simonenko d784c2ad19 odyssey: make restart read logic explicit in router attach 2019-06-13 11:55:01 +03:00
Dmitry Simonenko a3f55f4f21 odyssey: rework packet header validation 2019-06-03 13:12:50 +03:00
Andrey 32a779206b Remove branch restrictions from travis 2019-05-28 22:18:29 -04:00
Andrey f1d7bf697c Add binary collection to releases 2019-05-29 02:52:14 +01:00
Dmitry Simonenko 5716feb831 odyssey: unsubscribe from read events during pool attach wait 2019-05-25 17:26:29 +03:00
Andrey Borodin 80484c3337 Fix route connection limit handling 2019-05-21 17:43:46 +05:00
Andrey Borodin a02f9a0b87 Move message synchronization checks 2019-05-21 17:43:25 +05:00
Andrey Borodin f803b88ae5 Avoid flushing amid packet on sudden connection termination 2019-05-14 16:45:53 +05:00
Andrey Borodin 538042916f Allow long FE messages in msg validation 2019-05-13 15:29:46 +03:00
Andrey Borodin edd5477302 Improve protocol message validation 2019-04-30 14:47:43 +05:00
Andrey Borodin 8abed18d69 Minimal message validation
Prevent improperly formatted message from breaking into serious disaster
for running process.
2019-04-29 17:14:45 +05:00
Andrey Borodin 4198f2694d Restore odyssey_stress 2019-04-29 14:01:15 +05:00
Andrey Borodin 5fa204b082 Minor fixes 2019-04-25 14:23:23 +05:00
Dmitry Simonenko 9cd12c9d4c odyssey: minor fixes and refactoring 2019-04-13 13:26:47 +03:00
Andrey Borodin c4e2cedc35 Support of replication protocol 2019-04-12 15:13:50 +05:00
Dmitry Simonenko 859401f6dc odyssey: handle relay packet SKIP during for full-packet/deploy 2019-04-07 18:35:31 +03:00
Dmitry Simonenko df38cfe87b
Merge pull request #54 from x4m/cond_leak
Prevent condition leak
2019-03-29 13:09:10 +03:00
Andrey Borodin 0b8e8309c3 Prevent condition leak 2019-03-29 15:07:59 +05:00
Dmitry Simonenko 3513ed59b4
Merge pull request #53 from x4m/iov_leak
Prevent iov leak
2019-03-29 12:13:58 +03:00
Andrey Borodin f552c053e8 Prevent iov leak 2019-03-29 13:52:55 +05:00
Dmitry Simonenko af015839b0 machinarium: fix readers race in fast_channel implementation 2019-03-12 19:39:46 +03:00
Andrey Borodin 8998f1b9e6
Add cmake to Build-Depends of debian package 2019-03-12 13:14:35 +05:00
Dmitry Simonenko 73f4f9e8ca odyssey: fix warnings 2019-02-10 14:27:28 +03:00
Dmitry Simonenko f0374cb4f4 odyssey: fix server attach path on stray io event 2019-02-10 13:59:48 +03:00
Andrey Borodin b7eeeed27a Wait for read signals twice
This is a temporary solution to ensure server connection is not reattached to
the client in case after backend is ready for query in transaction pooling
mode.
2019-02-07 17:41:09 +03:00
Andrey Borodin 76ec3581a1
Use pg_lrand48 for portability (#48) 2019-01-30 14:30:31 +05:00
Andrey Borodin e63537be6d
Add scripts for testing and benchmarking (#49)
pgsql_test.sh performs tests by PostgreSQL test suit (make installcheck)
pgsql_benchmark.sh is doing pgbench benchmarking on various resultset size
2019-01-29 15:19:41 +05:00
Dmitry Simonenko 0e19a0ec28 odyssey: remove packet_read_size ref from README 2019-01-24 18:49:46 +03:00
Dmitry Simonenko 89f3bc5c9e odyssey: fix readahead re-usage case and event for pending tls data 2019-01-24 18:25:46 +03:00
Dmitry Simonenko f4c09af3df odyssey: allocate temp buffer for tls writev support 2019-01-24 16:46:46 +03:00
Dmitry Simonenko 49795088f7 odyssey: optimize relay processing 2019-01-24 15:35:07 +03:00
Dmitry Simonenko 6c0a1f09f8 odyssey: major rework of io architecture
This patch intend is to improve overall io performance, reduce
cpu and system usage.

Machinarium:

IO read/write logic is highly simplified and now based on conditions
instead of previously made internal readahead buffer and msg
queues. This allows to give user more control over io operations and
avoid doing undesired readahead copying.

Above that, TLS implementation reworked to use async logic instead of
separate BIO layer.

Direct pooling functions removed.

New objects machine_cond_t and machine_iov_t objects.

Odyssey:

Introduced readahead, io and relay objects.

Relay allows to connect two io handles for direct data retransmission
without double copying.

Removed configuration options no longer needed:
packet_read_size, packet_write_queue
2019-01-23 18:43:52 +03:00
Dmitry Simonenko 8c9933452e
Merge pull request #46 from x4m/show_pools
odyssey: implement SHOW POOLS command
2018-12-24 15:40:35 +03:00
Andrey Borodin b6e09fa00c Implement SHOW POOLS command 2018-12-24 17:37:40 +05:00
Dmitry Simonenko 82f0deba7d odyssey: disable discard by default 2018-12-13 15:40:18 +03:00
Dmitry Simonenko 9e0152417f odyssey: rework and optimize parameters setting logic 2018-12-13 14:18:20 +03:00
Dmitry Simonenko 9d6dea5d92 odyssey: major parameter settings optimization 2018-12-12 16:07:25 +03:00
Dmitry Simonenko c4f383ccfb odyssey: introduce pool_discard configuration parameter 2018-12-11 12:57:52 +03:00
Dmitry Simonenko 47b65e8ef2 odyssey: fix show servers callback arg 2018-12-07 15:28:32 +03:00
Dmitry Simonenko 0504a34b52 odyssey: rework pool wait logic and refactor client notification 2018-12-07 15:12:06 +03:00
Dmitry Simonenko 2e03af9c88 odyssey: major router and shared logic rework
Goal is to improve overall performance during massive peaks
of connecting clients.

This patch makes router a shared structure, instead of
being run in separate system worker thread/coroutine.

Now router and each route object is protected by
separate mutex. Worker threads directly access router object
without calls to separate thread.
2018-12-06 17:23:15 +03:00
Dmitry Simonenko 7807fd91f2 machinarium: implement readahead-less mode 2018-11-29 18:04:13 +03:00
Dmitry Simonenko 9115d60117 machinarium: rework time update logic 2018-11-27 16:19:16 +03:00
Dmitry Simonenko 9e37d1eff8 odyssey: add support for BoringSSL 2018-11-23 17:07:39 +03:00
Dmitry Simonenko 6b91e6e609 machinarium: try PTHREAD_CANCEL_DISABLE/DEFERRED to avoid __libc calls 2018-11-22 18:44:53 +03:00