Andrei Harbunou
06/23/2026, 9:04 PMRocky
06/23/2026, 9:04 PMpartition_retention_condition property (introduced in v3.5.0) has had specific bugs related to how it evaluates time-based expressions:
* Issue #65575: Specifically addressed failures and incorrect behavior when this condition referenced generated columns or specific expression types.
* Scheduling Latency: The background cleaner periodically evaluates these expressions. If you updated the property from 2 months to 6 months, the FE leader restart might have triggered an immediate "catch-up" run of the partition cleaner. If the cleaner thread initialized with a stale version of the MV's metadata before the full image was replayed or if it used a cached value, it could have executed the drop based on the old 2-month threshold.
Troubleshooting and Verification
To confirm if this is a persistence bug or a scheduling anomaly:
1. Check the DDL again: Run SHOW CREATE MATERIALIZED VIEW <mv_name>; now. If it still says 6 months, the issue is likely in the scheduler/cleaner logic (which might be using a stale internal state). If it somehow reverted to 2 months in the output, it is a metadata persistence bug.
2. Verify the partitions: Check information_schema.partitions or run SHOW PARTITIONS FROM <mv_name>; to see if the partitions were physically dropped or just "hidden" from query results (though retention policies usually physically drop them).
3. Recovering Data: Since you are on 4.0.0, you might be able to recover the dropped partitions using the RECOVER command if they were dropped within the catalog_trash_expire_second window (default is 1 day):
sql
RECOVER PARTITION <partition_name> FROM <mv_name>;
Recommendation
If you can, upgrade to v4.0.2 or later. The 4.0.0 release was the initial major version, and subsequent patches fixed several critical metadata and MV scheduling bugs (such as #71265 and #66474) that could cause exactly this kind of behavior.
If the problem persists on a newer version, it is recommended to collect the FE leader logs from the time of the restart and provide them to the community on Slack or GitHub, as this would indicate a regression in how the partition cleaner handles property updates.
References
• administration/management/FE_configuration.md
• release_notes/release-4.0.md