Skip to content

2.31.0.0-b151

@arpit-saxena arpit-saxena tagged this 10 Jun 03:50
Summary:
When connected through YSQL Connection Manager, `SET LOCAL` on a
GUC_REPORT variable (e.g. `application_name`) did not send a
ParameterStatus message to the client: `set_config_option_ext()`
skipped setting `GUC_NEEDS_REPORT` when the client is Connection
Manager and the action is `GUC_ACTION_LOCAL`. Clients that maintain a
parameter cache from ParameterStatus messages (e.g. pgjdbc's
`PGConnection.getParameterStatus()`) would therefore see a stale value
after `SET LOCAL`. Plain `SET` was unaffected. This exclusion was
introduced in eda482d8bb (D45460).

Remove the exclusion so `SET LOCAL` marks the GUC for reporting just
like plain `SET`. The end-of-transaction unwind in `AtEOXact_GUC()`
re-reports the restored value, so the client cache re-syncs on
COMMIT/ROLLBACK as it does without Connection Manager.

This also fixes the upstream pgjdbc tests
`ParameterStatusTest.transactionalParametersCommit` and
`transactionalParametersRollback`, which fail under Connection Manager
without this change.

Test Plan:
New test covering the commit and rollback paths, including that a fresh
ConnMgr connection does not inherit the prior session's value:

```
./yb_build.sh release --java-test 'org.yb.ysqlconnmgr.TestSessionParameters#testSetLocalEmitsParameterStatus'
```

Jenkins: all tests

Reviewers: mkumar, skumar, vikram.damle

Reviewed By: skumar

Subscribers: ybase, yql

Differential Revision: https://phorge.dev.yugabyte.com/D54143
Assets 2
Loading