{"record":{"id":"0a665f6c9d3742ff","repo":"vitessio/vitess","slug":"vreplication-stream-has-the-same-workflow-name-as-0a665f","errorCode":null,"errorMessage":"VReplication stream has the same workflow name as the resharding workflow: shard: %s:%s","messagePattern":"VReplication stream has the same workflow name as the resharding workflow: shard: (.+?):(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/workflow/stream_migrator.go","lineNumber":396,"sourceCode":"\t\tIncludeIds:       ids,\n\t\tIncludeStates:    states,\n\t\tExcludeFrozen:    excludeFrozen,\n\t}\n\n\tres, err := sm.ts.TabletManagerClient().ReadVReplicationWorkflows(ctx, ti.Tablet, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttabletStreams := make([]*VReplicationStream, 0, len(res.Workflows))\n\n\tfor _, workflow := range res.Workflows {\n\t\tswitch workflow.Workflow {\n\t\tcase \"\":\n\t\t\treturn nil, fmt.Errorf(\"VReplication streams must have named workflows for migration: shard: %s:%s\",\n\t\t\t\tti.Keyspace, ti.Shard)\n\t\tcase sm.ts.WorkflowName():\n\t\t\treturn nil, fmt.Errorf(\"VReplication stream has the same workflow name as the resharding workflow: shard: %s:%s\",\n\t\t\t\tti.Keyspace, ti.Shard)\n\t\t}\n\n\t\tfor _, stream := range workflow.Streams {\n\t\t\tisReference, err := sm.blsIsReference(stream.Bls)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, vterrors.Wrap(err, \"blsIsReference\")\n\t\t\t}\n\n\t\t\tif isReference {\n\t\t\t\tsm.ts.Logger().Infof(\"readTabletStreams: ignoring reference table %+v\", stream.Bls)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tpos, err := replication.DecodePosition(stream.Pos)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/workflow/stream_migrator.go#L378-L414","documentation":"Thrown by readTabletStreams when one of the source tablet's VReplication workflows has exactly the same name as the resharding workflow currently being built. Migrating the reshard workflow's own streams would be self-referential and break resharding, so the migrator refuses and reports the shard.","triggerScenarios":"Running MigrateStreams / workflow migration while the source shard still contains streams belonging to the internal reshard workflow (workflow == sm.ts.WorkflowName()) — e.g. transferring streams before the reshard completes.","commonSituations":"Attempting stream migration during an active Reshard; leftover streams from a cancelled/incomplete reshard that still carry the reserved internal workflow name.","solutions":["Complete or cancel the active Reshard workflow first (vtctldclient Reshard Complete / Cancel), then retry the stream migration.","Remove leftover reshard workflow streams: vtctldclient Workflow --workflow <reshard-workflow-name> Remove on the affected keyspace.","Rename any legitimately needed stream that collides with the reserved name (`update _vt.vreplication set workflow=...`).","Check `_vt.vreplication` on all source shard primaries for rows whose workflow equals the resharding workflow name before migrating."],"exampleFix":"// before: attempt migrate with reshard still present\n$ vtctldclient Workflow --keyspace customer Migrate ...\n// after: finish reshard first\n$ vtctldclient Reshard --workflow rebuy customer/0- Complete\n$ vtctldclient Workflow --keyspace customer Migrate ...","handlingStrategy":"validation","validationCode":"res, _ := tmclient.ReadVReplicationWorkflows(ctx, tablet, req)\nfor _, wf := range res.Workflows {\n    if wf.Workflow == \"reshard\" /* sm.ts.WorkflowName() */ {\n        return fmt.Errorf(\"complete or cancel the reshard workflow before migrating streams\")\n    }\n}","typeGuard":"func isReshardWorkflow(workflow string, reshardWorkflow string) bool {\n    return workflow == reshardWorkflow\n}","tryCatchPattern":"err := migrateStreams(ctx, cfg)\nif err != nil && strings.Contains(err.Error(), \"same workflow name as the resharding workflow\") {\n    // run Reshard Complete/Cancel or Workflow Remove first\n}","preventionTips":["Finish reshard workflows before starting stream migration","Clean up cancelled reshards with Workflow Remove","Check Workflow --keyspace list for the reserved name before migrating"],"tags":["vitess","vreplication","resharding","workflow-migration"],"backgroundTag":"reserved-workflow-name-conflict","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}