v.23.8Improvement

Add SYSTEM SYNC FILESYSTEM CACHE Command for State Comparison and Fixing in ClickHouse

Add SYSTEM SYNC FILESYSTEM CACHE command. It will compare in-memory state of filesystem cache with what it has on disk and fix in-memory state if needed. This is only needed if you are making manual interventions in on-disk data, which is highly discouraged. #51622 (Kseniia Sumarokova).
Introduces the SYSTEM SYNC FILESYSTEM CACHE command to synchronize the in-memory filesystem cache with the on-disk data state.

Why it matters

This feature addresses inconsistencies between the in-memory filesystem cache and the actual data stored on disk that may occur due to manual interventions in on-disk data. It helps ensure data integrity by correcting the in-memory state to match the disk state, which is critical when manual modifications are made, although such interventions are generally discouraged.

How to use it

Execute the command:

SYSTEM SYNC FILESYSTEM CACHE


This command compares the current in-memory filesystem cache with the on-disk data and fixes any discrepancies to bring the cache in sync. It should be used only if manual changes to on-disk data were made.