Yasir Arfat
09/17/2026, 3:02 PMTushar Pednekar
09/17/2026, 4:26 PMpg_dump comes from.
The knobs that actually shape throughput:
| Flag | Default | Controls |
|---|---|---|
| --copy-jobs | 4 | Tables copied concurrently |
| --on-segment-threshold | 1000000 | Row count above which segment-parallel copy kicks in |
| --compression / --compress-type | off / zstd | Wire compression |
| --metadata-jobs | 2 | Concurrent metadata restore tasks |
| --validate | true | Row-count check after each table |
3 & 4. Workflow and underlying commands
Per table: pick a strategy from pg_class.reltuples and cluster topology → start cbcopy_helper listeners on the receiving side using --data-port-range → COPY ... TO PROGRAM 'cbcopy_helper' on source and COPY ... FROM PROGRAM 'cbcopy_helper' on destination → helpers stream over direct TCP → compare COPY TO and COPY FROM row counts.
No storage APIs, no object store, no intermediate files. Just SQL COPY with TO PROGRAM / FROM PROGRAM, the ON SEGMENT clause for the segment-parallel strategy, and the external table mechanism for the redistribution strategy.
Three strategies:
- Copy On Coordinator — below --on-segment-threshold. Everything funnels through the two coordinators. Single stream.
- Copy On Segment — above the threshold, same version and same segment count on both sides. Segments stream directly to their counterparts, no redistribution.
- Copy On External Table — everything else. Parallel across segments, with redistribution.
5. Parallelism
Two levels. Across tables: --copy-jobs. Within a table: determined by topology, not configurable — the two segment strategies fan out across all segments, Copy On Coordinator is single-stream regardless of --copy-jobs. So if one large table is slow, check which strategy it landed in before raising --copy-jobs.
6. Docs and logs
Official docs: cloudberry.apache.org/docs/sys-admin/migration-and-upgrade
The README at github.com/cloudberry-contrib/cbcopy goes deeper on strategies and failure signatures. Use --debug / `--verbose`; logs land in ~/gpAdminLogs/cbcopy_$timestamp.log with succeed/failed table lists alongside.
One tie-back to your earlier thread: --validate defaults to true, and that row-count comparison is exactly what produced your "Copy to affected rows" failure.
Happy to go deeper on any of it.
~tushar
Synx Data LabsYasir Arfat
09/19/2026, 6:30 PM