Commit e7ea2df
committed
[#31357] YSQL: Conn Mgr - Update SIGHUP LCV on AP Control Backends on SIGHUP
Summary:
Setup:
Connection Manager enabled in Auth Passthrough mode.
`enable_ysql_conn_mgr=true` & `ysql_conn_mgr_use_auth_backend=false`.
Issue:
GUC vars updated via SIGHUPs are not visible on newly authenticated clients (authenticated
after GUC change is effected).
These are PGC_BACKEND GUCs that require postmaster to process a SIGHUP and re-read the PG config.
The root cause is that control backends don't update their "Logical Client Version" when handling a
SIGHUP. The LCV which indicates the latest "version" of GUC changes that *should* be visible to a
client. Thus, clients aren't assigned to transactional backends having the correct LCV (thus, not
having the correct/expected GUC values).
Solution:
Control backend LCVs are updated same as postmaster LCVs, but separately (not set directly
from the postmaster LCV). This involves setting the increment_LCV flag in guc.c for control backends
(in addition for the postmaster proc) and incrementing the SIGHUP_LCV for the control backend in the
SIGHUP handler section of the main postgres.c backend loop.
Test Plan:
Jenkins: all tests
Manually run with Auth Passthrough enabled
`./yb_build.sh --enable-ysql-conn-mgr-test --java-test 'org.yb.ysqlconnmgr.TestSessionParameters#testUpdatingRuntimeFlagPGCBackend'`
`./yb_build.sh --enable-ysql-conn-mgr-test --java-test 'org.yb.pgsql.TestPgRegressThirdPartyExtensionsPgHintPlan#schedule'`
`./yb_build.sh --enable-ysql-conn-mgr-test --java-test 'org.yb.ysqlconnmgr.TestAuthPassthrough'`
Reviewers: skumar, arpit.saxena, mkumar
Reviewed By: arpit.saxena
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D525801 parent 1f718f1 commit e7ea2df
5 files changed
Lines changed: 87 additions & 46 deletions
File tree
- java/yb-ysql-conn-mgr/src/test/java/org/yb/ysqlconnmgr
- src/postgres/src
- backend
- tcop
- utils/misc
- include
Lines changed: 29 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
| 869 | + | |
879 | 870 | | |
880 | 871 | | |
881 | 872 | | |
| |||
918 | 909 | | |
919 | 910 | | |
920 | 911 | | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
921 | 940 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6830 | 6830 | | |
6831 | 6831 | | |
6832 | 6832 | | |
| 6833 | + | |
6833 | 6834 | | |
6834 | | - | |
6835 | | - | |
6836 | | - | |
6837 | | - | |
6838 | | - | |
6839 | | - | |
6840 | | - | |
6841 | | - | |
| 6835 | + | |
| 6836 | + | |
| 6837 | + | |
| 6838 | + | |
| 6839 | + | |
| 6840 | + | |
| 6841 | + | |
| 6842 | + | |
| 6843 | + | |
| 6844 | + | |
| 6845 | + | |
6842 | 6846 | | |
6843 | | - | |
6844 | | - | |
6845 | | - | |
6846 | | - | |
6847 | | - | |
6848 | | - | |
6849 | | - | |
6850 | | - | |
6851 | | - | |
6852 | | - | |
| 6847 | + | |
| 6848 | + | |
6853 | 6849 | | |
6854 | | - | |
6855 | | - | |
6856 | | - | |
6857 | | - | |
6858 | | - | |
| 6850 | + | |
| 6851 | + | |
| 6852 | + | |
| 6853 | + | |
6859 | 6854 | | |
6860 | | - | |
6861 | | - | |
| 6855 | + | |
| 6856 | + | |
| 6857 | + | |
6862 | 6858 | | |
6863 | 6859 | | |
6864 | 6860 | | |
| |||
7512 | 7508 | | |
7513 | 7509 | | |
7514 | 7510 | | |
| 7511 | + | |
| 7512 | + | |
| 7513 | + | |
| 7514 | + | |
| 7515 | + | |
| 7516 | + | |
| 7517 | + | |
| 7518 | + | |
| 7519 | + | |
| 7520 | + | |
| 7521 | + | |
7515 | 7522 | | |
7516 | 7523 | | |
7517 | 7524 | | |
7518 | | - | |
7519 | 7525 | | |
7520 | 7526 | | |
7521 | 7527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11175 | 11175 | | |
11176 | 11176 | | |
11177 | 11177 | | |
| 11178 | + | |
| 11179 | + | |
| 11180 | + | |
| 11181 | + | |
| 11182 | + | |
| 11183 | + | |
| 11184 | + | |
| 11185 | + | |
| 11186 | + | |
| 11187 | + | |
| 11188 | + | |
| 11189 | + | |
| 11190 | + | |
| 11191 | + | |
| 11192 | + | |
| 11193 | + | |
11178 | 11194 | | |
11179 | 11195 | | |
11180 | 11196 | | |
| |||
11199 | 11215 | | |
11200 | 11216 | | |
11201 | 11217 | | |
11202 | | - | |
11203 | | - | |
11204 | | - | |
11205 | | - | |
11206 | | - | |
11207 | | - | |
11208 | | - | |
11209 | | - | |
11210 | | - | |
11211 | | - | |
11212 | 11218 | | |
11213 | 11219 | | |
11214 | 11220 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
0 commit comments