-
Notifications
You must be signed in to change notification settings - Fork 7.9k
#3 Fixed inconsistency between login success and logout #53302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#3 Fixed inconsistency between login success and logout #53302
Conversation
|
@tavplubix I apologize for having to bother you again, could you be a reviewer for this PR? But without the tests. I will push the tests in separate PRs (see comment) |
|
This is an automated comment for commit 0a49f45 with description of existing statuses. It's updated for the latest CI running
|
Added several new tests for session_log and fixed the inconsistency of the session_log records between user login and logout.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed the record inconsistency in session_log between login and logout.
Inconsistency comes from this behavior:
During a TCP session, the client authenticates as
Alice, Β with interface 'TCP' (set inTCPHandler::makeSession()) on the server side, and then server calls makeSessionContext() with this client_info.After session setup, the client sends
Protocol::Client::Querypacket, the TCP handler accepts it, and then reads client_info.client_tcp_protocol_version >= DBMS_MIN_REVISION_WITH_CLIENT_INFO is true for our caseThis
client_infois used forSession::createQueryContextand it can differ from session->getClientInfo().Session::createQueryContext uses client info from
query_contextfor the Login Success session log record.Session::~Session uses client info from
Session::getClientInfo()This can lead to these results in the session log:
This pull request forces using
Session::getClientInfo()for login success and logoutsession_logrecords.I think we should verify
client_infofrom the client inTCPHandler. It should validate 'interface' at least, it should not be HTTP, GRPC, or other, host, client_name, and protocol versions also must match between session->getClientInfo() and received client_info.