Reject max_replicated_logs_to_keep = 0 in the setting's type
Declare the setting as NonZeroUInt64 instead of checking the bound by hand in MergeTreeSettingsImpl::sanityCheck. sanityCheck runs only for mode <= LoadingStrictnessLevel::CREATE, so the hand written bound left 0 reachable through an ATTACH that carries a full definition and through loading a table whose stored metadata already holds it. The field type rejects the value wherever it is assigned, so CREATE, ALTER MODIFY SETTING, ATTACH, the server config and loading existing metadata are all covered, and the clamp in clearOldLogs is no longer reachable and goes away. A table whose stored metadata holds 0 now fails to attach with BAD_ARGUMENTS instead of aborting the server from a background thread. BuzzHouse generates values for this setting, so its range moves to highRangeNonZeroSetting, which is what the other NonZeroUInt64 table settings already use.
G
Groene AI committed
4401a1a33c972e54b2869303c8bc897592fcf094
Parent: 34543f5