Qikuyueser.com

Write a Migration Plan That Can Pause

Added 2026-11-01

Batches, resumability and rollback — not a single do-or-die run.

We are doing a data migration (size and database below). Write the plan: 1) how many batches, how large, split on what; 2) a checkpoint per batch — how we know it succeeded; 3) how to resume after an interruption — idempotency key, cursor, state table; 4) what to do with dirty rows — skip, fix, or stop and wait; 5) rollback plan and its time window; 6) three things to verify before and after cutover. Do not assume a single run.
Site original

Chinese original

Open in ChatGPT
How to use

迁移方案的第一要求是「能停下来」,不是「跑得快」。

Try tweaking it

  • Have it restate requirements and constraints before writing code.
  • Ask for the smallest change plus a rollback path, not a full-file rewrite.

What you should get

  • A minimal, runnable change with copy-ready code
  • Impact list: which files and call sites must follow

Common mistakes

  • Asking it to touch ten files at once, then losing track of what broke what.
  • Pasting only the error, with no code or version, and getting an unfixable answer.

How to check the output

  • The change runs, can be rolled back, and touches nothing unrelated.
  • Edge cases (empty, oversized, concurrent) are covered or explained.

Where it works

  • Good for: having it restate requirements and constraints, then propose the smallest runnable change.
  • Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.

More in this topic