{"record":{"id":"65e914e25e5eac0c","repo":"vitessio/vitess","slug":"vreplication-stream-has-the-same-workflow-name-as","errorCode":null,"errorMessage":"VReplication stream has the same workflow name as the resharding workflow: shard: %s:%s, stream: %d","messagePattern":"VReplication stream has the same workflow name as the resharding workflow: shard: (.+?):(.+?), stream: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/workflow/stream_migrator.go","lineNumber":318,"sourceCode":"\t\treturn nil, err\n\t}\n\n\tqr := sqltypes.Proto3ToResult(p3qr)\n\ttabletStreams := make([]*VReplicationStream, 0, len(qr.Rows))\n\n\tfor _, row := range qr.Named().Rows {\n\t\tid, err := row[\"id\"].ToInt32()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tworkflowName := row[\"workflow\"].ToString()\n\t\tswitch workflowName {\n\t\tcase \"\":\n\t\t\treturn nil, fmt.Errorf(\"VReplication streams must have named workflows for migration: shard: %s:%s, stream: %d\",\n\t\t\t\tti.Keyspace, ti.Shard, id)\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, stream: %d\",\n\t\t\t\tti.Keyspace, ti.Shard, id)\n\t\t}\n\n\t\tworkflowType, err := row[\"workflow_type\"].ToInt32()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tworkflowSubType, err := row[\"workflow_sub_type\"].ToInt32()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tdeferSecondaryKeys, err := row[\"defer_secondary_keys\"].ToBool()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar bls binlogdatapb.BinlogSource","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/workflow/stream_migrator.go#L300-L336","documentation":"This error is thrown by the legacy VReplication stream migrator (legacyReadTabletStreams) while enumerating rows in the _vt.vreplication table on a source shard's primary tablet. A stream whose `workflow` column equals the current resharding workflow's name cannot be migrated as part of a MoveTables/Reshard workflow migration, because migrating the resharding workflow itself would corrupt the in-progress reshard operation. The migrator hard-fails instead of silently skipping the stream.","triggerScenarios":"Calling MigrateStreams / workflow migration (e.g. `Workflow Migrate` / MoveTables with -workflow transfer) while a _vt.vreplication row on the source shard has workflow = sm.ts.WorkflowName(), i.e. the same name the reshard machinery uses (the 'reshard' internal workflow).","commonSituations":"Operators manually created a VReplication stream named with the reserved resharding workflow name; a prior failed/resumed reshard left a stream with the internal workflow name; running stream migration while a Reshard workflow is still active on the same keyspace.","solutions":["Wait for the in-progress Reshard workflow to complete or cancel it before migrating streams (vtctldclient Reshard ... Cancel / Complete).","Rename the offending VReplication stream to a non-reserved name (update _vt.vreplication set workflow='<newname>' where id=<stream id>) and retry.","Delete the stale/residual stream if it is no longer needed (vtctldclient Workflow --workflow <name> Remove or DELETE from _vt.vreplication).","Verify with `select id, workflow from _vt.vreplication` on the source shard primary that no row uses the reserved workflow name before retrying the migration."],"exampleFix":"// before: stream row named identically to the reshard workflow\nmysql> select id, workflow from _vt.vreplication; -- id=5, workflow='reshard'\n// after: rename it before running stream migration\nmysql> update _vt.vreplication set workflow='sales_copy' where id=5;","handlingStrategy":"validation","validationCode":"rows, _ := qr.Rows // query: select id, workflow from _vt.vreplication where db_name='...'\nfor _, r := range rows {\n    if r[\"workflow\"].ToString() == reshardWorkflowName {\n        return fmt.Errorf(\"stream %d uses reserved reshard workflow name; rename or remove it first\", id)\n    }\n}","typeGuard":"func usesReservedWorkflow(workflow, 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    // complete/cancel reshard or rename the offending stream, then retry\n}","preventionTips":["Never create _vt.vreplication rows manually with the reserved reshard workflow name","Complete or cancel any active Reshard workflow before running stream migration","Audit _vt.vreplication workflow names before each migration"],"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"}