{"record":{"id":"f1274fc84703c1e5","repo":"vitessio/vitess","slug":"error-v-updating-time-throttled","errorCode":null,"errorMessage":"error %v updating time throttled","messagePattern":"error (.+?) updating time throttled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"go/vt/vttablet/tabletmanager/vreplication/vreplicator.go","lineNumber":733,"sourceCode":"// with a rate limit so that it's only saved in the database at most once per\n// throttleUpdatesRateLimiter.tickerTime.\n// It also increments the throttled count in the stats to keep track of how many\n// times a VReplication workflow, and the specific sub-component, is throttled by the\n// tablet throttler over time. It also increments the global throttled count to keep\n// track of how many times in total vreplication has been throttled across all workflows\n// (both ones that currently exist and ones that no longer do).\nfunc (vr *vreplicator) updateTimeThrottled(appThrottled throttlerapp.Name, reasonThrottled string) error {\n\tappName := appThrottled.String()\n\tvr.stats.ThrottledCounts.Add([]string{\"tablet\", appName}, 1)\n\tglobalStats.ThrottledCount.Add(1)\n\terr := vr.throttleUpdatesRateLimiter.Do(func() error {\n\t\ttm := time.Now().Unix()\n\t\tupdate, err := binlogplayer.GenerateUpdateTimeThrottled(vr.id, tm, appName, reasonThrottled)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := vr.dbClient.ExecuteFetch(update, maxRows); err != nil {\n\t\t\treturn fmt.Errorf(\"error %v updating time throttled\", err)\n\t\t}\n\t\treturn nil\n\t})\n\treturn err\n}\n\nfunc (vr *vreplicator) updateHeartbeatTime(tm int64) error {\n\tupdate, err := binlogplayer.GenerateUpdateHeartbeat(vr.id, tm)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := vr.dbClient.ExecuteFetch(update, maxRows); err != nil {\n\t\treturn fmt.Errorf(\"error %v updating time\", err)\n\t}\n\treturn nil\n}\n\nfunc (vr *vreplicator) clearFKCheck(dbClient *vdbClient) error {","sourceCodeStart":715,"sourceCodeEnd":751,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go#L715-L751","documentation":"When a stream is throttled, the code records the throttle event by updating the time_throttled column in _vt.vreplication (GenerateUpdateTimeThrottled builds the UPDATE). If that ExecuteFetch fails, this error wraps the MySQL error. It only concerns the throttling bookkeeping — the underlying data copy state is unaffected.","triggerScenarios":"The UPDATE of time_throttled fails at the point the throttler marks the stream as throttled: connection error, row deleted, read-only mysqld. Raised inside a throttler-client callback.","commonSituations":"Throttler fires during a MySQL restart/failover; concurrent workflow cancellation removed the row; read-only target during maintenance.","solutions":["Check the wrapped MySQL error for cause (dead connection vs. missing row vs. read-only).","Verify the _vt.vreplication row still exists for this id; if the workflow was cancelled, let the stream die instead of forcing updates.","Confirm target mysqld is writable and reachable; retry by restarting the workflow.","Check throttler health — if throttling is spurious, review throttler thresholds so this path stops firing."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure throttling bookkeeping can succeed:\n// SELECT id FROM _vt.vreplication WHERE id = <id>;\n// SHOW GLOBAL VARIABLES LIKE 'read_only';","typeGuard":null,"tryCatchPattern":"if _, err := vr.dbClient.ExecuteFetch(update, maxRows); err != nil {\n\tlog.Warn(\"failed to record throttle time; data copy unaffected\", slog.Any(\"error\", err))\n\t// non-fatal: continue; investigate row/read-only only if persistent\n}","preventionTips":["Treat throttle-bookkeeping errors as secondary health signals.","Keep target writable outside maintenance windows.","Check throttler configuration if throttle events fire unexpectedly often.","Don't delete workflow rows while streams are active."],"tags":["vreplication","throttler","mysql"],"backgroundTag":"vreplication-state-update-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}