{"record":{"id":"9c793858c38a4c95","repo":"vitessio/vitess","slug":"s-9c7938","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/common/config.go","lineNumber":259,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\terrors = append(errors, getError(k, v))\n\t\t\t} else {\n\t\t\t\tc.VStreamBinlogRotationThresholdOverride = true\n\t\t\t\tc.VStreamBinlogRotationThreshold = value\n\t\t\t}\n\t\tcase \"max-row-json-bytes\":\n\t\t\tvalue, err := strconv.ParseInt(v, 10, 64)\n\t\t\tif err != nil || value < 0 {\n\t\t\t\terrors = append(errors, getError(k, v))\n\t\t\t} else {\n\t\t\t\tc.MaxRowJSONBytes = value\n\t\t\t}\n\t\tdefault:\n\t\t\terrors = append(errors, \"unknown vreplication config flag: \"+k)\n\t\t}\n\t}\n\tif len(errors) > 0 {\n\t\treturn c, fmt.Errorf(\"%s\", strings.Join(errors, \", \"))\n\t}\n\treturn c, nil\n}\n\n// Map returns a map of the VReplicationConfig: the keys are the flag names and the values are string representations.\n// Used in tests to compare the expected and actual configuration values and in validations to check if the user-provided\n// keys are one of those that are supported.\nfunc (c VReplicationConfig) Map() map[string]string {\n\treturn map[string]string{\n\t\t\"vreplication-experimental-flags\":         strconv.FormatInt(c.ExperimentalFlags, 10),\n\t\t\"vreplication-net-read-timeout\":           strconv.Itoa(c.NetReadTimeout),\n\t\t\"vreplication-net-write-timeout\":          strconv.Itoa(c.NetWriteTimeout),\n\t\t\"vreplication-copy-phase-duration\":        c.CopyPhaseDuration.String(),\n\t\t\"vreplication-retry-delay\":                c.RetryDelay.String(),\n\t\t\"vreplication-max-time-to-retry-on-error\": c.MaxTimeToRetryError.String(),\n\t\t\"relay-log-max-size\":                      strconv.Itoa(c.RelayLogMaxSize),\n\t\t\"relay_log_max_size\":                      strconv.Itoa(c.RelayLogMaxSize),\n\t\t\"relay-log-max-items\":                     strconv.Itoa(c.RelayLogMaxItems),","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/common/config.go#L241-L277","documentation":"NewVReplicationConfig validates user-supplied vreplication config flags. Unknown flag keys are accumulated into a joined error message ('unknown vreplication config flag: <k>', comma-separated for multiple), and the function returns the (partial) config together with this error so misconfiguration is surfaced at startup.","triggerScenarios":"Constructing/refreshing the VReplicationConfig (config refresh loop or TestMaxRowJSONBytesOverride-style overrides) with a key that is not a known vreplication config flag — typically from a bad command-line flag or wrong key in the config source.","commonSituations":"Typo like 'vreplication_track_er_heartbeat' misspelled; flag renamed/removed in a newer Vitess version; leftover flags in an old config file after upgrade.","solutions":["Fix or remove the unknown key from the vreplication flags on the vttablet command line/config","List valid flags (`vttablet --help | grep vreplication` or common/config.go NewVReplicationConfig) and use an exact match","After a Vitess upgrade, diff your flags against the new version's accepted keys — renamed flags cause this at boot","If a flag was deprecated, migrate to its replacement rather than passing it through"],"exampleFix":"// before\n--vreplication_track_er_heartbeat=true\n// after\n--vreplication_track_heartbeat=true","handlingStrategy":"validation","validationCode":"flags := map[string]bool{\"vreplication_track_heartbeat\": true, /* ...known keys */}\nfor k := range userFlags {\n    if !flags[k] { return fmt.Errorf(\"unknown flag %s\", k) }\n}","typeGuard":null,"tryCatchPattern":"c, err := common.NewVReplicationConfig(m)\nif err != nil {\n    for _, e := range strings.Split(err.Error(), \", \") { log.Warn(e) }\n}","preventionTips":["Diff vttablet flags after each Vitess upgrade","Keep config in a checked-in file with a schema check","Use --help to enumerate accepted vreplication flags"],"tags":["vttablet","config","vreplication"],"backgroundTag":"unknown-config-flag","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}