Commit 7225348
Manav Kumar
[#29527] YSQL: Evict server hashmap cache entry on parse error received during connection reset
Summary:
A fix to remove the stale entry from server's hashmap in case of an error been received in connection manager has been implemented in [[ 1acabde | 1acabde ]]. Postgres returns a special packet `YBParsePrepareErrorResponse` consumed by conn mgr containing prepared statement needs to be removed from server hashmap.
**BUT** the new packet been returned was not been intercepted during the reset phase of the connection manager, when server object is not synchronised. Therefore it was getting ignored and no entry was been removed from server hashmap. This diff fixes the same above.
Test Plan:
Jenkins: all tests
**Hacky Manual Testing With Connection Manager**
Steps:
- Added the sleep in PARSE phase in postgres backend for a particular prepared statement name-Q. Make sure it's less than `ysql_conn_mgr_wait_timeout_ms`. So conn mgr wait for enough time.
- Add a failure of a parse for that particular prepared statement name (Q) in postgres backend after sleep.
- Started application, when parse gets stuck, kill the JDBC connection forcefully.
Cmd to find port of JDBC connection: sudo ss -tn state established '( sport = :5433 or dport = :5433 )'
Cmd to kill the connection sudo ss -K dst 10.150.3.175 dport = <port got from above cmd>.
- Client will get disconnected and server in connection manager will require to get synchronised. And hence we see YBParsePrepareErrorResponse packet in reset phase.
- Re-ran the same application and check in connection manager logs, we should never get "prepared statement <> does not exist" error for same prepared statement Q.
Reviewers: skumar, arpit.saxena, vikram.damle, asrinivasan
Reviewed By: skumar, arpit.saxena
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D486241 parent aebcfea commit 7225348
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1109 | 1114 | | |
1110 | 1115 | | |
1111 | 1116 | | |
| |||
0 commit comments