{"record":{"id":"22ae6b2f83dca110","repo":"vitessio/vitess","slug":"vreplication-streams-must-have-named-workflows-for","errorCode":null,"errorMessage":"VReplication streams must have named workflows for migration: shard: %s:%s","messagePattern":"VReplication streams must have named workflows for migration: shard: (.+?):(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/workflow/resharder.go","lineNumber":191,"sourceCode":"\n\t\tmu.Lock()\n\t\tdefer mu.Unlock()\n\n\t\tmustCreate := false\n\t\tvar ref map[string]bool\n\t\tif rs.refStreams == nil {\n\t\t\trs.refStreams = make(map[string]*refStream)\n\t\t\tmustCreate = true\n\t\t} else {\n\t\t\t// Copy the ref streams for comparison.\n\t\t\tref = make(map[string]bool, len(rs.refStreams))\n\t\t\tfor k := range rs.refStreams {\n\t\t\t\tref[k] = true\n\t\t\t}\n\t\t}\n\t\tfor _, workflow := range res.Workflows {\n\t\t\tif workflow.Workflow == \"\" {\n\t\t\t\treturn fmt.Errorf(\"VReplication streams must have named workflows for migration: shard: %s:%s\", source.Keyspace(), source.ShardName())\n\t\t\t}\n\t\t\tfor _, stream := range workflow.Streams {\n\t\t\t\tbls := stream.Bls\n\t\t\t\tisReference, err := rs.blsIsReference(bls)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn vterrors.Wrap(err, \"blsIsReference\")\n\t\t\t\t}\n\t\t\t\tif !isReference {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\trefKey := fmt.Sprintf(\"%s:%s:%s\", workflow.Workflow, bls.Keyspace, bls.Shard)\n\t\t\t\tif mustCreate {\n\t\t\t\t\trs.refStreams[refKey] = &refStream{\n\t\t\t\t\t\tworkflow:        workflow.Workflow,\n\t\t\t\t\t\tbls:             bls,\n\t\t\t\t\t\tcell:            workflow.Cells,\n\t\t\t\t\t\ttabletTypes:     discovery.BuildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference),\n\t\t\t\t\t\tworkflowType:    workflow.WorkflowType,","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/workflow/resharder.go#L173-L209","documentation":"During a Reshard-based stream migration, the resharder validates that every VReplication stream on the source shards belongs to a named workflow before it can be migrated to the target keyspace. An unnamed (empty workflow name) stream cannot be tracked or re-targeted by the migration machinery, so the operation fails fast. This is a safety check to avoid orphaning streams during resharding.","triggerScenarios":"Running MigrateStreams (or a reshard that migrates existing VReplication streams) when at least one vreplication row on a source shard has an empty workflow column — typically streams created by legacy Vitess versions or by manual inserts into _vt.vreplication.","commonSituations":"Clusters upgraded from very old Vitess versions that predated named workflows; manually created VReplication rows for testing; partial state left by crashed tooling that inserted vreplication rows without a workflow name.","solutions":["Identify the unnamed stream on the named shard (SELECT id, workflow FROM _vt.vreplication WHERE workflow='') and delete or name it.","If the stream is obsolete, cancel/remove it before retrying the migration.","If it is needed, re-create it via a supported workflow (MoveTables/Reshard) so it gets a proper workflow name.","Upgrade intermediate Vitess versions so legacy streams are migrated to named workflows."],"exampleFix":"-- before\nmysql> SELECT id, workflow FROM _vt.vreplication WHERE workflow='';\n-- after (remove or fix the offending row)\nmysql> DELETE FROM _vt.vreplication WHERE id=<id>;","handlingStrategy":"validation","validationCode":"-- Run on every source shard before MigrateStreams\nSELECT id, shard, workflow FROM _vt.vreplication WHERE workflow = '';","typeGuard":null,"tryCatchPattern":"err := vtctldClient.MigrateStreams(...)\nif err != nil && strings.Contains(err.Error(), \"must have named workflows\") {\n    // inspect and clean up unnamed streams, then retry\n}","preventionTips":["Never insert rows into _vt.vreplication manually without a workflow name","Keep all tablets on a Vitess version that assigns workflow names","Audit for empty workflow names before any reshard or stream migration"],"tags":["vreplication","resharding","validation"],"backgroundTag":"unnamed-vreplication-workflow","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}