vitessio/vitess · error

unsupported post copy action type: %v

Error message

unsupported post copy action type: %v

What it means

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.

Source

Thrown at go/vt/vttablet/tabletmanager/vreplication/vreplicator.go:1218

								found = true
								break
							}
						}
						if !found {
							return failedAlterErr
						}
					}
					// All of the keys we wanted to add in the ALTER already
					// exist in the live table schema.
				} else {
					return failedAlterErr
				}
			}
			if err := deleteAction(dbClient, id, vr.id, tableName); err != nil {
				return err
			}
		default:
			return fmt.Errorf("unsupported post copy action type: %v", action.Type)
		}
	}

	vr.insertLog(LogCopyStart, fmt.Sprintf("Completed all post copy actions for %s table", tableName))

	return nil
}

// supportsDeferredSecondaryKeys tells you if related work should be done
// for the workflow. Deferring secondary index generation is only supported
// with MoveTables, Migrate, and Reshard.
func (vr *vreplicator) supportsDeferredSecondaryKeys() bool {
	return vr.WorkflowType == int32(binlogdatapb.VReplicationWorkflowType_MoveTables) ||
		vr.WorkflowType == int32(binlogdatapb.VReplicationWorkflowType_Migrate) ||
		vr.WorkflowType == int32(binlogdatapb.VReplicationWorkflowType_Reshard)
}

func (vr *vreplicator) newClientConnection(ctx context.Context) (*vdbClient, error) {

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Check the action row's type value: SELECT the row from _vt.post_copy_action for the named table
  2. Ensure all tablets run a compatible Vitess version — upgrade the older tablet if the action type comes from a newer release
  3. 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)
  4. File an issue if a shipped action type is reported as unsupported
Defensive patterns

Strategy: validation

Validate before calling

// Before upgrading/merging versions, check pending action types:
rows := dbaConn.ExecuteFetch("SELECT vr_id, table_name, JSON_EXTRACT(action, '$.type') FROM _vt.post_copy_action", -1, false)
// ensure every type is "sql" on the OLDEST vitess version in the cluster

Type guard

func isSupportedPostCopyAction(action PostCopyAction) bool {
    return action.Type == PostCopyActionSQL
}

Try / catch

switch action.Type {
case PostCopyActionSQL:
    // execute
default:
    // inspect and clean the row manually:
    // DELETE FROM _vt.post_copy_action WHERE id = ?
}

Prevention

When it happens

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

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

Related errors


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