Yasir Arfat
09/19/2026, 6:31 PMDianjin Wang
09/19/2026, 10:17 PMTushar Pednekar
09/19/2026, 10:29 PMcould not write to COPY program is emitted on the source when the program behind COPY TO PROGRAM exits — so the destination-side helper went away. At --copy-jobs=8 with the source pegged at 100% CPU, the likely chain is: source stalls → connection sits idle → something between the clusters (conntrack, NAT, LB) drops the flow → helper discovers it on the next write. Worth trying --compression to cut wire time, OS keepalives on both sides, and --connection-mode=pull if your firewall rules are asymmetric.
On the duplicate key. GPDB 7.3.3 → CB 2.1.0 is a version mismatch, which means Copy On Segment is off the table — you'll be on Copy On External Table, which redistributes data on the way in. That makes distribution policy the thing I'd check first. Two specific things:
1. Compare DISTRIBUTED BY on source and destination for that table, exactly. Unique enforcement in GPDB/CBDB is per-segment, and it only equals global uniqueness because the unique columns must contain the distribution key. If the destination landed on a different key (or randomly distributed), rows that never collided on the source can land together on the destination and collide. This would reproduce on a fresh schema on a different partition every time, which matches exactly what you're seeing.
2. Confirm the copy set isn't picking up both the root partitioned table and its children. If both get copied, every row goes in twice.
On atomicity — there isn't a cross-segment atomic retry. Per-partition is the right call at 900M rows: smaller blast radius, and you can resume from the cbcopy_failed_$timestamp list. Truncate the specific child partition, confirm it's at zero rows, then copy.
If you can share two things I can probably narrow it further: the DISTRIBUTED BY clause from \d+ on both sides, and the copy strategy line for that table from a --debug run.
— Tushar, Synx Data LabsYasir Arfat
09/19/2026, 11:02 PMYasir Arfat
09/19/2026, 11:08 PM