{"record":{"id":"3597475d0b61ddf0","repo":"vitessio/vitess","slug":"unable-to-s-vdiff-for-uuid-s-as-it-was-not-found","errorCode":null,"errorMessage":"unable to %s vdiff for UUID %s as it was not found on tablet %v (%w)","messagePattern":"unable to (.+?) vdiff for UUID (.+?) as it was not found on tablet (.+?) \\(%w\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletmanager/vdiff/action.go","lineNumber":278,"sourceCode":"\t\t\trowsAffected, err := execResume(sqlStartVDiff)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif rowsAffected == 0 {\n\t\t\t\treturn fmt.Errorf(\"no completed or stopped vdiff found for UUID %s on tablet %s\",\n\t\t\t\t\treq.VdiffUuid, topoproto.TabletAliasString(vde.thisTablet.Alias))\n\t\t\t}\n\t\t}\n\t}\n\n\tresp.VdiffUuid = req.VdiffUuid\n\tqr, err = vde.getVDiffByID(ctx, dbClient, resp.Id)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvdiffRecord := qr.Named().Row()\n\tif vdiffRecord == nil {\n\t\treturn fmt.Errorf(\"unable to %s vdiff for UUID %s as it was not found on tablet %v (%w)\",\n\t\t\taction, req.VdiffUuid, topoproto.TabletAliasString(vde.thisTablet.Alias), err)\n\t}\n\tif action == ResumeAction {\n\t\t// Use the existing options from the vdiff record.\n\t\toptions = optionsZeroVal\n\t\terr = protojson.Unmarshal(vdiffRecord.AsBytes(\"options\", []byte(\"{}\")), options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvde.mu.Lock()\n\tdefer vde.mu.Unlock()\n\tif err := vde.addController(vdiffRecord, options); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vdiff/action.go#L260-L296","documentation":"After determining the vdiff record id, Vitess re-fetches the full vdiff row by id (getVDiffByID); if the row is gone (nil) it reports the action cannot proceed because the record vanished, wrapping any error from the fetch. This is a race/consistency guard between the first lookup and the by-id fetch.","triggerScenarios":"Concurrent deletion of the vdiff record (or an internal fetch error producing no row) between the initial UUID lookup and getVDiffByID inside handleCreateResumeAction; also fires when the fetch returned err and a nil row.","commonSituations":"Another operator or a cleanup job deleted the vdiff mid-operation; concurrent vdiff delete while resuming; replica-local _vt table changes applied between the two queries.","solutions":["Re-run the vdiff action after confirming the record's existence with vdiff show","Avoid running concurrent vdiff delete and create/resume for the same UUID","Check tablet logs for the wrapped error from getVDiffByID","Re-create the vdiff if it was intentionally deleted"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// re-check existence immediately before acting:\nqr, err := dbClient.ExecuteFetch(\"SELECT id FROM _vt.vdiff_tablet WHERE uuid=?\", 1, true)\nif err != nil || len(qr.Rows) == 0 { return errors.New(\"vdiff missing; aborting\") }","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"as it was not found on tablet\") {\n    // record vanished mid-operation; verify with show and retry or re-create\n}","preventionTips":["Serialize vdiff operations per UUID (no concurrent delete + resume)","Use a single operator/tool to drive vdiff lifecycles","Re-run show after the error to confirm the record's fate"],"tags":["vdiff","race-condition","missing-record"],"backgroundTag":"record-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}