-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#21505] YSQL: Use role_oid instead of role GUC variable in YSQL Conn…
…ection Manager Summary: YSQL Connection Manager tracks GUC variables that were modified on a logical connection by maintaining a list of modified variables (as per ParameterStatus packets received). The `role` GUC variable can be modified through SET/RESET statements, but roles can also be renamed as such: `ALTER ROLE role_1 RENAME TO role_2`. Since Connection Manager would have `role_1` being stored as the role name, this leads to incorrect behaviour while roles are renamed mid-session. To resolve this issue, we can track the role GUC variable using its OID instead. List of changes made to facilitate this provision: - Whenever `role` ParameterStatus is being sent by the backend, additionally send a `role_oid` ParameterStatus packet (sent via custom RoleOidParameterStatus packet) - Whenever the backend process receives a query like: `SET role_oid = 12345`, map the OID received to its role name (if valid, else throw invalid OID error) and accordingly set the `role` GUC variable - Ignore tracking of `role` ParameterStatus packets on Connection Manager, simply forward them to client - Whenever ConnectionManager receives a RoleOidParameterStatus packet, process it to store relevant details and deliberately skip relaying of the packet to client Jira: DB-10389 Test Plan: ./yb_build.sh --enable-ysql-conn-mgr-test --java-test org.yb.pgsql.TestPgAuthorization#testRoleRenamingMidSession Reviewers: mkumar, nkumar, jason Reviewed By: nkumar Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D34316
- Loading branch information
Showing
10 changed files
with
117 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters