{"record":{"id":"bc9184b36596283e","repo":"vitessio/vitess","slug":"both-atomic-copy-and-partial-mode-cannot-be-specif-bc9184","errorCode":null,"errorMessage":"both atomic copy and partial mode cannot be specified for the same workflow","messagePattern":"both atomic copy and partial mode cannot be specified for the same workflow","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/materializer.go","lineNumber":1460,"sourceCode":"\nfunc (mz *materializer) getWorkflowType() binlogdatapb.VReplicationWorkflowType {\n\tvar workflowType binlogdatapb.VReplicationWorkflowType\n\tswitch mz.ms.MaterializationIntent {\n\tcase vtctldatapb.MaterializationIntent_CUSTOM:\n\t\tworkflowType = binlogdatapb.VReplicationWorkflowType_Materialize\n\tcase vtctldatapb.MaterializationIntent_MOVETABLES:\n\t\tworkflowType = binlogdatapb.VReplicationWorkflowType_MoveTables\n\tcase vtctldatapb.MaterializationIntent_CREATELOOKUPINDEX:\n\t\tworkflowType = binlogdatapb.VReplicationWorkflowType_CreateLookupIndex\n\t}\n\treturn workflowType\n}\n\nfunc (mz *materializer) getWorkflowSubType() (binlogdatapb.VReplicationWorkflowSubType, string, error) {\n\tworkflowSubType := binlogdatapb.VReplicationWorkflowSubType_None\n\tswitch {\n\tcase mz.isPartial && mz.ms.AtomicCopy:\n\t\treturn workflowSubType, \"\", errors.New(\"both atomic copy and partial mode cannot be specified for the same workflow\")\n\tcase mz.isPartial:\n\t\tworkflowSubType = binlogdatapb.VReplicationWorkflowSubType_Partial\n\tcase mz.ms.AtomicCopy:\n\t\tworkflowSubType = binlogdatapb.VReplicationWorkflowSubType_AtomicCopy\n\tdefault:\n\t\tworkflowSubType = binlogdatapb.VReplicationWorkflowSubType_None\n\t}\n\treturn workflowSubType, \"\", nil\n}\n\nfunc matchColInSelect(col sqlparser.IdentifierCI, sel *sqlparser.Select) (*sqlparser.ColName, error) {\n\tfor _, selExpr := range sel.GetColumns() {\n\t\tswitch selExpr := selExpr.(type) {\n\t\tcase *sqlparser.StarExpr:\n\t\t\treturn &sqlparser.ColName{Name: col}, nil\n\t\tcase *sqlparser.AliasedExpr:\n\t\t\tmatch := selExpr.As\n\t\t\tif match.IsEmpty() {","sourceCodeStart":1442,"sourceCodeEnd":1478,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/materializer.go#L1442-L1478","documentation":"getWorkflowSubType was asked to classify a workflow as both Partial and AtomicCopy simultaneously, which are mutually exclusive vreplication workflow sub-types. Wrangler rejects the combination because a workflow cannot atomically copy all tables and run in partial (subset) mode at the same time.","triggerScenarios":"Calling MoveTables (or another materializer-based workflow) with flags/inputs that set mz.isPartial while ms.AtomicCopy is true — e.g. combining --atomic-copy with a partial-tables/partition specification.","commonSituations":"CLI or API automation merging flag sets from two different workflows; users assuming atomic copy and partial copy are compatible; generated configs where both options default into the request.","solutions":["Remove --atomic-copy if the workflow is intended to be partial","Remove the partial-mode specification if a full atomic copy is intended","Audit automation that composes MoveTables flags so only one sub-type is set"],"exampleFix":"// before\nms.AtomicCopy = true; mz.isPartial = true\n// after: pick one\nms.AtomicCopy = true // OR mz.isPartial = true, not both","handlingStrategy":"validation","validationCode":"// reject the combination before calling MoveTables\nif opts.isPartial && opts.atomicCopy {\n\treturn errors.New(\"pick either partial mode or atomic copy, not both\")\n}","typeGuard":null,"tryCatchPattern":"subType, _, err := mz.getWorkflowSubType()\nif err != nil && strings.Contains(err.Error(), \"both atomic copy and partial\") {\n\t// return a flag-usage error to the CLI caller\n}","preventionTips":["Make CLI flags mutually exclusive (fail in PreRunE on invalid combos)","In automation, build workflow options from a single source of truth","Document that Partial and AtomicCopy are alternative sub-types"],"tags":["movetables","wrangler","configuration","mutually-exclusive-flags"],"backgroundTag":"conflicting-workflow-flags","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}