v.19.14Improvement

Removed Recursive Rwlock by Thread

Removed recursive rwlock by thread. It makes no sense, because threads are reused between queries. SELECT query may acquire a lock in one thread, hold a lock from another thread and exit from first thread. In the same time, first thread can be reused by DROP query. This will lead to false "Attempt to acquire exclusive lock recursively" messages. #6771 (alexey-milovidov)
Removed the recursive rwlock by thread mechanism to fix incorrect lock acquisition errors caused by thread reuse in ClickHouse.

Why it matters

The previous implementation tracked recursive rwlock ownership by thread, which caused false "Attempt to acquire exclusive lock recursively" errors because threads are reused between different queries. For example, a SELECT query might acquire a lock on one thread and release it on another, while the original thread could be reused for a DROP query. This feature removes that problematic mechanism to prevent these misleading error messages and improve lock handling accuracy.

How to use it

This change is applied internally within ClickHouse and requires no user intervention or configuration. Users will experience fewer false lock recursion errors automatically after upgrading to the updated version.