{"record":{"id":"39d5b4250c556a25","repo":"vitessio/vitess","slug":"buffer-min-time-between-failovers-must-be-1s","errorCode":null,"errorMessage":"--buffer-min-time-between-failovers must be >= 1s (specified value: %v)","messagePattern":"--buffer-min-time-between-failovers must be >= 1s \\(specified value: (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtgate/buffer/flags.go","lineNumber":76,"sourceCode":"}\n\nfunc init() {\n\tservenv.OnParseFor(\"vtgate\", registerFlags)\n\tservenv.OnParseFor(\"vtcombo\", registerFlags)\n}\n\nfunc verifyFlags() error {\n\tif bufferWindow < 1*time.Second {\n\t\treturn fmt.Errorf(\"--buffer-window must be >= 1s (specified value: %v)\", bufferWindow)\n\t}\n\tif bufferWindow > bufferMaxFailoverDuration {\n\t\treturn fmt.Errorf(\"--buffer-window must be <= --buffer-max-failover-duration: %v vs. %v\", bufferWindow, bufferMaxFailoverDuration)\n\t}\n\tif bufferSize < 1 {\n\t\treturn fmt.Errorf(\"--buffer-size must be >= 1 (specified value: %d)\", bufferSize)\n\t}\n\tif bufferMinTimeBetweenFailovers < 1*time.Second {\n\t\treturn fmt.Errorf(\"--buffer-min-time-between-failovers must be >= 1s (specified value: %v)\", bufferMinTimeBetweenFailovers)\n\t}\n\n\tif bufferDrainConcurrency < 1 {\n\t\treturn fmt.Errorf(\"--buffer-drain-concurrency must be >= 1 (specified value: %d)\", bufferDrainConcurrency)\n\t}\n\n\tif bufferKeyspaceShards != \"\" && !bufferEnabled {\n\t\treturn fmt.Errorf(\"--buffer-keyspace-shards=%v also requires that --enable_buffer is set\", bufferKeyspaceShards)\n\t}\n\tif bufferEnabled && bufferEnabledDryRun && bufferKeyspaceShards == \"\" {\n\t\treturn errors.New(\"both the dry-run mode and actual buffering is enabled. To avoid ambiguity, keyspaces and shards for actual buffering must be explicitly listed in --buffer-keyspace-shards\")\n\t}\n\n\tkeyspaces, shards := keyspaceShardsToSets(bufferKeyspaceShards)\n\tfor s := range shards {\n\t\tkeyspace, _, err := topoproto.ParseKeyspaceShard(s)\n\t\tif err != nil {\n\t\t\treturn err","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtgate/buffer/flags.go#L58-L94","documentation":"--buffer-min-time-between-failovers throttles how often buffering can re-trigger. verifyFlags requires a value of at least 1 second; anything smaller would effectively re-enable buffering instantly after each failover and is rejected at startup.","triggerScenarios":"Starting vtgate with --buffer-min-time-between-failovers set below 1s (e.g. 500ms or 0 via a config default).","commonSituations":"Operators trying to buffer during rapid flapping failovers shrink this value below the minimum; templated configs defaulting the variable to 0/empty interpreted as 0s.","solutions":["Set --buffer-min-time-between-failovers to >= 1s (default is 1s)","If failovers are flapping rapidly, address the underlying flapping instead of lowering the throttle","Keep the value aligned with --buffer-window/--buffer-max-failover-duration tuning"],"exampleFix":"// before\nvtgate --buffer-min-time-between-failovers=0\n// after\nvtgate --buffer-min-time-between-failovers=1s","handlingStrategy":"validation","validationCode":"if bufferMinTimeBetweenFailovers < 1*time.Second {\n    return fmt.Errorf(\"--buffer-min-time-between-failovers must be >= 1s, got %v\", bufferMinTimeBetweenFailovers)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the default (1s) unless you have measured reason to change it","Ensure config tooling emits explicit unit suffixes for durations","Validate duration flags in staging before production rollout"],"tags":["vtgate","buffering","flag-validation","configuration"],"backgroundTag":"invalid-flag-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}