#2 Added new tests for session_log and fixed the inconsistency between login and logout.#53255
Conversation
|
Good day @tavplubix could you please be the reviewer in this PR? Changes between this and the previous PR: |
|
This is an automated comment for commit d499f80 with description of existing statuses. It's updated for the latest CI running
|
|
This fail comes from Postgres connection is failed. ClickHouse server was not even involved in this, It did not even receive a query. I don't see any related error in the clickhouse logs. |
|
I can't guess why the connection from I want to avoid consuming the time of myself and other engineers to create new PRs, review them, and then revert them.
|
|
Yes, this will work. Let's submit fixes without unstable parts of the tests first. |
Random occasional errors exist in our infrastructure due to hardware failures in AWS, regional outages, and similar, but this is not the case. |
|
Thanks for finding these failures. I Agree that something is wrong, I'm trying to figure it out right now, but I still have no clue why it happens. 4 Failures Is too many. Clickhouse definitely listens to PostgreSQL `0.0.0.0:5433 But in every log, I see the same error: Clickhouse server logs do not contain anything that could help me find the root cause of the problem. |
|
This is my test server log: valid_log.txt When the Postgres connection is established, I see this message: This message might catch an eye, but it is always contained in the log: |
|
Bug fix PR: |
|
Separate pull requests for each individual test:
I will unmark those changes as 'DRAFT' after bugfix PR will be merged |
|
ClickHouse several PostgreSQL tests broken: These tests use psycopg2 library for Postgres communication. For my purposes, it is not necessary to use it, but it is the easiest way to achieve my goal. P.S. Another test, ClickHouse/tests/integration/test_profile_max_sessions_for_user/test.py Lines 127 to 133 in 33763e7 I can rewrite the test using native PostgreSQL client |
Preivous PR was here:
#52958 Then the changes from PR were reverted here: #53247
Changes between this and the previous PR:
added the
no-debugtag to the02833_concurrrent_sessionsand02835_drop_user_during_sessiontests.These tests require enough performance to run the required actions. I ran 100 times on my machine with the default build and got no failures.
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.