{"record":{"id":"0ef1921b5c942280","repo":"vitessio/vitess","slug":"unsupported-post-copy-action-type-v","errorCode":null,"errorMessage":"unsupported post copy action type: %v","messagePattern":"unsupported post copy action type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletmanager/vreplication/vreplicator.go","lineNumber":1218,"sourceCode":"\t\t\t\t\t\t\t\tfound = true\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif !found {\n\t\t\t\t\t\t\treturn failedAlterErr\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// All of the keys we wanted to add in the ALTER already\n\t\t\t\t\t// exist in the live table schema.\n\t\t\t\t} else {\n\t\t\t\t\treturn failedAlterErr\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := deleteAction(dbClient, id, vr.id, tableName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported post copy action type: %v\", action.Type)\n\t\t}\n\t}\n\n\tvr.insertLog(LogCopyStart, fmt.Sprintf(\"Completed all post copy actions for %s table\", tableName))\n\n\treturn nil\n}\n\n// supportsDeferredSecondaryKeys tells you if related work should be done\n// for the workflow. Deferring secondary index generation is only supported\n// with MoveTables, Migrate, and Reshard.\nfunc (vr *vreplicator) supportsDeferredSecondaryKeys() bool {\n\treturn vr.WorkflowType == int32(binlogdatapb.VReplicationWorkflowType_MoveTables) ||\n\t\tvr.WorkflowType == int32(binlogdatapb.VReplicationWorkflowType_Migrate) ||\n\t\tvr.WorkflowType == int32(binlogdatapb.VReplicationWorkflowType_Reshard)\n}\n\nfunc (vr *vreplicator) newClientConnection(ctx context.Context) (*vdbClient, error) {","sourceCodeStart":1200,"sourceCodeEnd":1236,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go#L1200-L1236","documentation":"Post copy actions are stored as JSON rows in _vt.post_copy_action with a type field; currently only 'sql' actions are supported (the code's switch only handles PostCopyActionSQL). This error is returned when an action row carries an unknown or unsupported type, so VReplication refuses to execute it blindly.","triggerScenarios":"An action row in _vt.post_copy_action for the table has a JSON 'type' that is not PostCopyActionSQL — e.g. written by a newer Vitess version with additional action types, or manually inserted/corrupted rows.","commonSituations":"Mixed-version cluster where a newer vttablet wrote a new action type and an older version tries to execute it; manual edits to the _vt.post_copy_action table; corrupted JSON in the action column.","solutions":["Check the action row's type value: SELECT the row from _vt.post_copy_action for the named table","Ensure all tablets run a compatible Vitess version — upgrade the older tablet if the action type comes from a newer release","If the row is corrupted or manually inserted, delete it from _vt.post_copy_action (after confirming the intended schema change was applied or applying it manually)","File an issue if a shipped action type is reported as unsupported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before upgrading/merging versions, check pending action types:\nrows := dbaConn.ExecuteFetch(\"SELECT vr_id, table_name, JSON_EXTRACT(action, '$.type') FROM _vt.post_copy_action\", -1, false)\n// ensure every type is \"sql\" on the OLDEST vitess version in the cluster","typeGuard":"func isSupportedPostCopyAction(action PostCopyAction) bool {\n    return action.Type == PostCopyActionSQL\n}","tryCatchPattern":"switch action.Type {\ncase PostCopyActionSQL:\n    // execute\ndefault:\n    // inspect and clean the row manually:\n    // DELETE FROM _vt.post_copy_action WHERE id = ?\n}","preventionTips":["Keep all tablets on the same Vitess version — never run a newer writer against older readers in a mixed cluster","Do not manually insert or edit rows in _vt.post_copy_action","Before a rolling upgrade, drain pending post copy actions (finish copy phases) first","If a row is unsupported, apply the intended schema change manually and delete the row"],"tags":["vreplication","go","compatibility"],"backgroundTag":"unsupported-action-type","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}