{"record":{"id":"32dbe6682033e79a","repo":"thanos-io/thanos","slug":"min-query-split-interval-should-be-greater-than-0","errorCode":null,"errorMessage":"min query split interval should be greater than 0 when query split threshold is enabled","messagePattern":"min query split interval should be greater than 0 when query split threshold is enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/queryfrontend/config.go","lineNumber":317,"sourceCode":"\n\tif cfg.DownstreamURL == \"\" {\n\t\treturn errors.New(\"downstream URL should be configured\")\n\t}\n\n\treturn nil\n}\n\nfunc (cfg *Config) validateDynamicSplitParams() error {\n\tif cfg.HorizontalShards <= 0 {\n\t\treturn errors.New(\"min horizontal shards should be greater than 0 when query split threshold is enabled\")\n\t}\n\n\tif cfg.MaxQuerySplitInterval <= 0 {\n\t\treturn errors.New(\"max query split interval should be greater than 0 when query split threshold is enabled\")\n\t}\n\n\tif cfg.MinQuerySplitInterval <= 0 {\n\t\treturn errors.New(\"min query split interval should be greater than 0 when query split threshold is enabled\")\n\t}\n\treturn nil\n}\n\nfunc (cfg *Config) isStaticSplitSet() bool {\n\treturn cfg.QueryRangeConfig.SplitQueriesByInterval != 0\n}\n\nfunc (cfg *Config) isDynamicSplitSet() bool {\n\treturn cfg.MinQuerySplitInterval > 0 ||\n\t\tcfg.HorizontalShards > 0 ||\n\t\tcfg.MaxQuerySplitInterval > 0\n}\n","sourceCodeStart":299,"sourceCodeEnd":331,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/queryfrontend/config.go#L299-L331","documentation":"validateDynamicSplitParams requires MinQuerySplitInterval > 0 when the dynamic query-split threshold feature is enabled. This is the narrowest split width the frontend may generate; zero or negative makes the splitter produce invalid ranges, so Validate rejects the config.","triggerScenarios":"Validate -> validateDynamicSplitParams is called with cfg.MinQuerySplitInterval <= 0 — query_split_threshold enabled but min_query_split_interval unset or set to 0/negative.","commonSituations":"Operators enabling query_split_threshold and setting only max_query_split_interval; upgrades where the new min interval field defaults to zero; templated configs with a computed value evaluating to 0.","solutions":["Set query_frontend.min_query_split_interval to a positive duration (e.g. 1h)","Ensure it is smaller than max_query_split_interval","Disable query_split_threshold if dynamic splitting is not desired"],"exampleFix":"// before\nquery_frontend:\n  query_split_threshold: 100000\n  max_query_split_interval: 24h\n// after\nquery_frontend:\n  query_split_threshold: 100000\n  max_query_split_interval: 24h\n  min_query_split_interval: 1h","handlingStrategy":"validation","validationCode":"if cfg.MinQuerySplitInterval <= 0 {\n    return errors.New(\"min_query_split_interval must be > 0 when query_split_threshold is enabled\")\n}\nif cfg.MinQuerySplitInterval > cfg.MaxQuerySplitInterval {\n    return errors.New(\"min_query_split_interval must be <= max_query_split_interval\")\n}","typeGuard":"func minSplitIntervalSet(d time.Duration) bool { return d > 0 }","tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"min query split interval\") {\n        log.Fatalf(\"set min_query_split_interval > 0: %v\", err)\n    }\n}","preventionTips":["Choose min and max split intervals together, e.g. 1h/24h","Avoid templated values that can evaluate to 0 or empty durations","Run Validate against every environment's rendered config in CI"],"tags":["config","validation","query-frontend","splitting"],"backgroundTag":"invalid-config-value","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}