Skip to content

Fix --split-tables-larger-than resume guidance#36

Open
teknogeek0 wants to merge 1 commit intomainfrom
fix/resume-split-tables-guidance
Open

Fix --split-tables-larger-than resume guidance#36
teknogeek0 wants to merge 1 commit intomainfrom
fix/resume-split-tables-guidance

Conversation

@teknogeek0
Copy link
Copy Markdown
Contributor

Summary

  • Add --split-tables-larger-than back to resume-migration.sh (matching run-migration.sh)
  • Replace blanket "never use with --resume" with phase-aware guidance across all docs
  • If COPY completed: --resume with same value is safe (COPY supervisor doesn't run)
  • If COPY failed mid-flight: use --restart instead (truncation risk for split tables)

Test plan

  • Review updated guidance in README, AGENTS.md, and resume-migration.sh

The blanket "never use with --resume" was wrong. The truncation risk
only exists when COPY is still in progress. If COPY completed and the
failure was in indexes/CDC, resume with the same value is safe and
required by catalog validation.
/usr/lib/postgresql/17/bin/pgcopydb clone \
--follow \
--plugin wal2json \
--resume \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the script does not support switching between --resume and --restart flags. according to the README users should be able to do that

This backs up the SQLite catalog before resuming. It uses `--not-consistent` to allow resuming from a mid-transaction state, and intentionally omits `--split-tables-larger-than` because pgcopydb truncates the entire table before checking split parts on resume, which causes data loss.
This backs up the SQLite catalog before resuming and uses `--not-consistent` to allow resuming from a mid-transaction state.

**Choosing between `--resume` and `--restart`:**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a user, I am not sure where to apply --resume and --restart because it wasn't shown in the examples above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants