Commit e9b9ba1
committed
connection-pool: implement connection pool with master discovery
Main features:
- Return available connection from pool according to
round-robin strategy.
- Automatic master discovery by `mode` parameter.
Additional options (configurable via `ConnectWithOpts`):
* `CheckTimeout` - time interval to check for connection
timeout and try to switch connection
`Mode` parameter:
* `ANY` (use any instance) - the request can be executed on any
instance (master or replica).
* `RW` (writeable instance (master)) - the request can only
be executed on master.
* `RO` (read only instance (replica)) - the request can only
be executed on replica.
* `PREFER_RO` (prefer read only instance (replica)) - if there is one,
otherwise fallback to a writeable one (master).
* `PREFER_RW` (prefer write only instance (master)) - if there is one,
otherwise fallback to a read only one (replica).
Closes #1131 parent f388f6d commit e9b9ba1
File tree
13 files changed
+3050
-5
lines changed- connection_pool
- test_helpers
13 files changed
+3050
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments