-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Version: 25.11.1.2598
Description
When renaming a user to an existing user name, ALTER USER ... RENAME TO ... correctly returns ACCESS_ENTITY_ALREADY_EXISTS, but the rename is still partially applied internally.
As a result:
user15is renamed touser16even though an exception is thrown.- Two
user16entries appear insystem.users. - Dropping
user16anduser15removes both entries. - Subsequent
CREATE USER OR REPLACE user15fails withFILE_DOESNT_EXISTorACCESS_ENTITY_ALREADY_EXISTS(onCREATE USER user15).
This indicates that the rename operation is modifying internal metadata even after the exception, leading to RBAC corruption.
Steps to reproduce the issue
CREATE USER IF NOT EXISTS user15 IDENTIFIED WITH no_password;
CREATE USER IF NOT EXISTS user16 IDENTIFIED WITH no_password;
-- Check that user15 and user16 were created:
SELECT name, storage, id FROM system.users;
-- Expected error: ACCESS_ENTITY_ALREADY_EXISTS
ALTER USER user15 RENAME TO user16;
-- Problem: even though the previous command raises an exception,
-- user15 is actually renamed and now we have two `user16` entries:
SELECT name, storage, id FROM system.users;
DROP USER IF EXISTS user16;
DROP USER IF EXISTS user15;
-- Both `user16` entries are deleted:
SELECT name, storage, id FROM system.users;
-- This is the failure Code: 107(FILE_DOESNT_EXIST) that is later caught in the regression test :
CREATE USER OR REPLACE user15;Versions tested:
- 25.11.1.2648 - ❌ Failed
- 25.10.2.65 - ✅ Passed
- 25.9.5.21 - ✅ Passed
- 25.8.11.66 - ✅ Passed
Issue on Upstream
CI Run
https://github.com/Altinity/clickhouse-regression/actions/runs/19316216971/job/55247989837
Artifacts and Reports
Artifacts will be uploaded to https://altinity-test-reports.s3.amazonaws.com/index.html#clickhouse/25.11.1.2598/19316216971/testflows/x86_64/with_analyzer/zookeeper/without_thread_fuzzer/rbac1/
Review report at https://altinity-test-reports.s3.amazonaws.com/clickhouse/25.11.1.2598/19316216971/testflows/x86_64/with_analyzer/zookeeper/without_thread_fuzzer/rbac1/report.html
Review new fails (nice) at https://altinity-test-reports.s3.amazonaws.com/clickhouse/25.11.1.2598/19316216971/testflows/x86_64/with_analyzer/zookeeper/without_thread_fuzzer/rbac1/nice-new-fails.log.txt
Failure Description
Received exception from server (version 25.11.1):
Code: 107. DB::Exception: Received from localhost:9000. DB::Exception: Couldn't delete /var/lib/clickhouse/access/38373166-2d31-6134-6164-373733313063.sql. (FILE_DOESNT_EXIST)
(query: CREATE USER OR REPLACE user15 )