v.22.2New Feature
Support IF EXISTS Clause for TTL Expression with MOVE TTL Rules on Replicas
SupportIF EXISTSclause forTTL expr TO [DISK|VOLUME] [IF EXISTS] 'xxx'feature. Parts will be moved to disk or volume only if it exists on replica, soMOVE TTLrules will be able to behave differently on replicas according to the existing storage policies. Resolves #34455. #34504 (Anton Popov).
Why it matters
This feature addresses the need forMOVE TTL rules to behave differently on replicas based on existing storage policies. It prevents errors and inconsistencies by moving parts only when the specified disk or volume exists on the replica, improving replication flexibility and reliability.How to use it
Add theIF EXISTS clause to your TTL expressions when specifying movement of parts to a disk or volume. For example:TTL some_column + INTERVAL 7 DAY TO VOLUME IF EXISTS 'volume_name'This will move parts only if the volume 'volume_name' exists on the replica.