{"record":{"id":"b528ed1de808d653","repo":"vitessio/vitess","slug":"streams-are-mismatched-across-source-shards-for-wo","errorCode":null,"errorMessage":"streams are mismatched across source shards for workflow: %s","messagePattern":"streams are mismatched across source shards for workflow: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/workflow/resharder.go","lineNumber":214,"sourceCode":"\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,\n\t\t\t\t\t\tworkflowSubType: workflow.WorkflowSubType,\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif !ref[refKey] {\n\t\t\t\t\t\treturn fmt.Errorf(\"streams are mismatched across source shards for workflow: %s\", workflow)\n\t\t\t\t\t}\n\t\t\t\t\tdelete(ref, refKey)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(ref) != 0 {\n\t\t\t\treturn fmt.Errorf(\"streams are mismatched across source shards: %v\", ref)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\treturn err\n}\n\n// blsIsReference is partially copied from streamMigrater.templatize.\n// It reuses the constants from that function also.\nfunc (rs *resharder) blsIsReference(bls *binlogdatapb.BinlogSource) (bool, error) {\n\tstreamType := StreamTypeUnknown\n\tfor _, rule := range bls.Filter.Rules {","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/workflow/resharder.go#L196-L232","documentation":"The resharder compares the set of VReplication streams found on each source shard of a reshard. Every non-reference stream must appear identically (same refKey) on all source shards; if a stream for the same workflow differs across shards, the migration cannot proceed because the target configuration would be inconsistent. The workflow name is included in the message to identify the offending stream set.","triggerScenarios":"MigrateStreams/Reshard where one source shard has a VReplication stream (workflow + filter combination) that other source shards do not have, or the streams differ in their key attributes, during the ForAllSources validation loop in resharder.","commonSituations":"MoveTables or Reshard was previously run against only some shards of a keyspace; a stream was created or deleted on a single shard manually; asymmetric reshard leftovers from an interrupted earlier operation.","solutions":["Compare _vt.vreplication rows (workflow, filter, tablet_types) across all source shards and make them consistent.","Cancel or recreate the affected workflow so all shards have matching streams.","Remove stray per-shard streams that should not exist before retrying the reshard.","Use consistent, workflow-based tooling (MoveTables/Reshard commands) rather than per-shard manual stream creation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"-- Compare stream sets across all source shards before resharding\nSELECT shard, workflow, filter FROM _vt.vreplication ORDER BY workflow, shard;","typeGuard":null,"tryCatchPattern":"if err := cancelOrMigrate(); err != nil {\n  if strings.Contains(err.Error(), \"streams are mismatched across source shards\") {\n    // reconcile streams per shard, then retry\n  }\n}","preventionTips":["Always manage streams via workflow-level commands, not per-shard","Verify consistent MoveTables/Reshard completion across all shards","Audit _vt.vreplication symmetry across source shards pre-migration"],"tags":["vreplication","resharding","consistency"],"backgroundTag":"vreplication-stream-mismatch-across-shards","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}