Commit b86c373
committed
adapter: Set upstream version in handshake messages
Upon new client connections, Readyset is setting the default database
version string into the connection handshake packets. When we
introduced the `LazyUpstream`, we made some functions not go upstream
and just return a default value; `version()` is one of those
functions.
The reasoning behind the lazy connects is that when control
plane/operational tools connect to Readyset for health
check/diagnostic information, we were inadvertently opening a lot of
connections to the upstream postgres itself, and thus naively
consuming the limited connections that one can make to PG. Also, if a
given client connection will never need to query the upstream anyways,
why create that connection?
This patch adds a new field to the `UpstreamSystemProperties` struct
for `db_version`, and we pass that to the adapter `Backend`, via it's
builder. `Backend::version()` will return that value if it is `Some`;
else, it'll do it's normal behavior (which may be to return the
default).
Fixes: #1562
Release-Note-Core: Set the correct version of the upstream database
new connection handshake for both mysql and postgres.
Change-Id: Ib4cd2e85a4271c645e90eb9fd44befdfeff202df
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/10703
Tested-by: Buildkite CI
Reviewed-by: Marcelo Altmann <marcelo@readyset.io>1 parent 71d7bfc commit b86c373
File tree
4 files changed
+32
-10
lines changed- readyset-adapter/src
- readyset-client-test-helpers/src
- readyset-data/src
- readyset/src
4 files changed
+32
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| |||
422 | 424 | | |
423 | 425 | | |
424 | 426 | | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | 430 | | |
| |||
525 | 528 | | |
526 | 529 | | |
527 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
528 | 536 | | |
529 | 537 | | |
530 | 538 | | |
| |||
652 | 660 | | |
653 | 661 | | |
654 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
655 | 666 | | |
656 | 667 | | |
657 | 668 | | |
| |||
905 | 916 | | |
906 | 917 | | |
907 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
908 | 923 | | |
909 | 924 | | |
910 | 925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
| 716 | + | |
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
721 | 722 | | |
| 723 | + | |
722 | 724 | | |
723 | 725 | | |
724 | 726 | | |
| |||
1408 | 1410 | | |
1409 | 1411 | | |
1410 | 1412 | | |
1411 | | - | |
1412 | | - | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1421 | 1426 | | |
1422 | 1427 | | |
1423 | 1428 | | |
| |||
0 commit comments