vitessio/vitess · error

streams are mismatched across source shards for workflow: %s

Error message

streams are mismatched across source shards for workflow: %s

What it means

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.

Source

Thrown at go/vt/vtctl/workflow/resharder.go:214

				if err != nil {
					return vterrors.Wrap(err, "blsIsReference")
				}
				if !isReference {
					continue
				}
				refKey := fmt.Sprintf("%s:%s:%s", workflow.Workflow, bls.Keyspace, bls.Shard)
				if mustCreate {
					rs.refStreams[refKey] = &refStream{
						workflow:        workflow.Workflow,
						bls:             bls,
						cell:            workflow.Cells,
						tabletTypes:     discovery.BuildTabletTypesString(workflow.TabletTypes, workflow.TabletSelectionPreference),
						workflowType:    workflow.WorkflowType,
						workflowSubType: workflow.WorkflowSubType,
					}
				} else {
					if !ref[refKey] {
						return fmt.Errorf("streams are mismatched across source shards for workflow: %s", workflow)
					}
					delete(ref, refKey)
				}
			}
			if len(ref) != 0 {
				return fmt.Errorf("streams are mismatched across source shards: %v", ref)
			}
		}
		return nil
	})
	return err
}

// blsIsReference is partially copied from streamMigrater.templatize.
// It reuses the constants from that function also.
func (rs *resharder) blsIsReference(bls *binlogdatapb.BinlogSource) (bool, error) {
	streamType := StreamTypeUnknown
	for _, rule := range bls.Filter.Rules {

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Compare _vt.vreplication rows (workflow, filter, tablet_types) across all source shards and make them consistent.
  2. Cancel or recreate the affected workflow so all shards have matching streams.
  3. Remove stray per-shard streams that should not exist before retrying the reshard.
  4. Use consistent, workflow-based tooling (MoveTables/Reshard commands) rather than per-shard manual stream creation.
Defensive patterns

Strategy: validation

Validate before calling

-- Compare stream sets across all source shards before resharding
SELECT shard, workflow, filter FROM _vt.vreplication ORDER BY workflow, shard;

Try / catch

if err := cancelOrMigrate(); err != nil {
  if strings.Contains(err.Error(), "streams are mismatched across source shards") {
    // reconcile streams per shard, then retry
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/b528ed1de808d653. Report an issue: GitHub.