v.22.12Improvement

Change Query Behavior to Ensure Durability and Enable Concurrent Reads

Change how the following queries delete parts: TRUNCATE TABLE, ALTER TABLE DROP PART, ALTER TABLE DROP PARTITION. Now, these queries make empty parts which cover the old parts. This makes the TRUNCATE query work without a followedexclusive lock which means concurrent reads aren't locked. Also achieved durability in all those queries. If the request succeeds, then no resurrected parts appear later. Note that atomicity is achieved only with transaction scope. #41145 (Sema Checherinda).
Improved parts deletion for TRUNCATE TABLE, ALTER TABLE DROP PART, and ALTER TABLE DROP PARTITION by creating empty parts that cover old parts, enabling lock-free concurrent reads and enhanced durability.

Why it matters

This feature changes parts deletion strategy to avoid exclusive locks during TRUNCATE and part drop operations, allowing concurrent reads without blocking. It also ensures durability by preventing resurrection of dropped parts after successful requests, improving stability and consistency in data management. Atomicity is guaranteed only within transaction scope.

How to use it

Users can leverage this improvement transparently as it modifies the internal behavior of TRUNCATE TABLE, ALTER TABLE DROP PART, and ALTER TABLE DROP PARTITION queries. No specific configuration is needed; just run these queries as usual to benefit from lock-free reads and guaranteed durability.