#3 Fixed inconsistency between login success and logout#53302
Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom Aug 12, 2023
Merged
#3 Fixed inconsistency between login success and logout#53302alexey-milovidov merged 1 commit intoClickHouse:masterfrom
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
Conversation
Contributor
Author
|
@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) |
tavplubix
approved these changes
Aug 11, 2023
Contributor
|
This is an automated comment for commit 0a49f45 with description of existing statuses. It's updated for the latest CI running
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.