{"record":{"id":"2ebac85c88f6ca63","repo":"vitessio/vitess","slug":"vdiff-with-uuid-s-already-exists-on-tablet-s","errorCode":null,"errorMessage":"vdiff with UUID %s already exists on tablet %s","messagePattern":"vdiff with UUID (.+?) already exists on tablet (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletmanager/vdiff/action.go","lineNumber":197,"sourceCode":"\treturn strings.Join(cells, \",\"), nil\n}\n\nfunc (vde *Engine) handleCreateResumeAction(ctx context.Context, dbClient binlogplayer.DBClient, action VDiffAction, req *tabletmanagerdatapb.VDiffRequest, resp *tabletmanagerdatapb.VDiffResponse) error {\n\tvar qr *sqltypes.Result\n\toptions := req.GetOptions()\n\n\tquery, err := sqlparser.ParseAndBind(sqlGetVDiffID, sqltypes.StringBindVariable(req.VdiffUuid), sqltypes.StringBindVariable(vde.dbName))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif qr, err = dbClient.ExecuteFetch(query, 1); err != nil {\n\t\treturn err\n\t}\n\trecordFound := len(qr.Rows) == 1\n\n\tif action == CreateAction {\n\t\tif recordFound {\n\t\t\treturn fmt.Errorf(\"vdiff with UUID %s already exists on tablet %s\",\n\t\t\t\treq.VdiffUuid, topoproto.TabletAliasString(vde.thisTablet.Alias))\n\t\t}\n\t\t// Use the options specified via the vdiff create client\n\t\t// command, which we'll then store in the vdiff record.\n\t\tif options, err = vde.fixupOptions(options); err != nil {\n\t\t\treturn err\n\t\t}\n\t\toptionsJSON, err := json.Marshal(options)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tstate := PendingState\n\t\tif options.CoreOptions != nil && options.CoreOptions.AutoStart != nil && !options.CoreOptions.GetAutoStart() {\n\t\t\tstate = StoppedState\n\t\t}\n\t\tquery, err := sqlparser.ParseAndBind(sqlNewVDiff,\n\t\t\tsqltypes.StringBindVariable(req.Keyspace),\n\t\t\tsqltypes.StringBindVariable(req.Workflow),","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vdiff/action.go#L179-L215","documentation":"handleCreateResumeAction rejects a CreateAction when a vdiff record with the requested UUID already exists in _vt.vdiff_tablet on that tablet. Vitess requires unique UUIDs per tablet to avoid clobbering in-progress diff state.","triggerScenarios":"Running `vdiff create --tablet-uuid <uuid>` (or workflow VDiff create) when a previous vdiff with the same UUID was already created on this tablet and not deleted.","commonSituations":"Re-running an interrupted vdiff create without deleting the old record; scripted retries that reuse a fixed UUID; resuming vs creating confusion — the workflow already exists and should be resumed, not created.","solutions":["If you want to continue, use resume instead of create (vdiff resume) for the existing UUID","Delete the existing vdiff first: vtctldclient VDiff delete and then re-create","Pick a new unique UUID for the new comparison","List current vdiffs with vdiff show to confirm which UUIDs exist"],"exampleFix":"// before\nvtctldclient VDiff --keyspace c --workflow w create --tablet-uuid fixed-uuid\n// after\nvtctldclient VDiff --keyspace c --workflow w delete --tablet-uuid fixed-uuid\nvtctldclient VDiff --keyspace c --workflow w create --tablet-uuid fixed-uuid","handlingStrategy":"validation","validationCode":"qr, _ := dbClient.ExecuteFetch(\"SELECT uuid FROM _vt.vdiff_tablet WHERE uuid=?\", 1, true) // bind uuid\nif len(qr.Rows) > 0 { // already exists: resume or delete instead of create }","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"already exists on tablet\") {\n    // fall back to resume, or delete then re-create\n}","preventionTips":["Generate fresh UUIDs per vdiff run instead of reusing constants","Run vdiff show before create to check for existing UUIDs","Script delete-then-create for idempotent reruns"],"tags":["vdiff","duplicate-uuid","idempotency"],"backgroundTag":"duplicate-record","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}