Renaming replicated table

Learn how to rename a Kudu table involved in a replication job by performing coordinated changes on both the source and sink clusters.

Renaming a replicated table requires coordinated changes on both clusters and a controlled job restart. You must stop the job cleanly by ensuring no writes are in flight before you rename any table.

  1. Follow the Kudu replication Pre-stop checklist to drain the pipeline.
  2. Stop the replication job by using a savepoint.

    You must confirm that the pendingCount, unassignedCount, and pendingRemovalCount metrics are all zero before you stop the job. This ensures the savepoint contains no in-flight scan splits.

  3. Rename the source Kudu table by running the following command:
    kudu table rename_table <source-master-addresses> old_name new_name
  4. Rename the sink Kudu table.

    If the job.tableSuffix property is configured, the sink table name follows the <tableName><suffix> format. You must rename it to new_name<suffix> to match the new source name.

    Without a suffix:

    kudu table rename_table <sink-master-addresses> old_name new_name

    With the job.tableSuffix=_dr property (for example):

    kudu table rename_table <sink-master-addresses> old_name_dr new_name_dr
  5. Restart the replication job from the savepoint.

    For more information, see Restarting the replication job and finding the job ID. You must pass the new table name by using the --job.tableName new_name argument. The job.tableSuffix value does not change.