Subject: RE: Patch for migration of the pg_commit_ts directory

From: "Hayato Kuroda (Fujitsu)" <[email-masked]>
Date: Wed, 27 May 2026 05:24:54 +0000

Dear Sergey,

While considering the feature once again, I came up with another issue.

When pg_upgrade migrates objects to a new instance, it normally checks whether
the new instance does not have existing objects. E.g., check_new_cluster_is_empty()
checks if no tables exist, and check_new_cluster_replication_slots() ensures
there are no logical slots.

Based on that, how should we handle the commit timestamp? Since the patch simply
copies the pg_commit_ts subdir, existing entries in the new cluster will be overwritten.
So we may have to check if the commit_ts entries are empty when the pg_upgrade
command runs, but not sure how to do that.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

---

From: ls7777 <[email-masked]>
Date: Fri, 29 May 2026 21:08:56 +0500

Hi,

During copying, the copy_subdir_files function cleans up the target directory with the remove_new_subdir(new_subdir, true) function.

----------------

Кому: 'ls7777' ([email-masked]);

Копия: [email-masked], [email-masked], [email-masked], Masahiko Sawada ([email-masked]);

Тема: Patch for migration of the pg_commit_ts directory;

27.05.2026, 10:25, "Hayato Kuroda (Fujitsu)" <[email-masked]>:

Dear Sergey,

Best regards,
Hayato Kuroda
FUJITSU LIMITED

---

From: "Hayato Kuroda (Fujitsu)" <[email-masked]>
Date: Mon, 1 Jun 2026 01:25:31 +0000

Dear Sergey,

> During copying, the copy_subdir_files function cleans up the target
> directory with the remove_new_subdir(new_subdir, true) function.

Correct, the function can discard existing directory. But my point was that how
do we ENSURE it's OK to remove.

Best regards,
Hayato Kuroda
FUJITSU LIMITED