Re: Excessive LOG messages from replication slot sync worker

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Excessive LOG messages from replication slot sync worker
Date: 2025-08-12 08:57:45
Message-ID: CAHGQGwGO0b9iKb450BNLVG+ycHQ2ZpH9dkj-ffyQ5SO83tYRpQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 12, 2025 at 4:38 PM Japin Li <japinli(at)hotmail(dot)com> wrote:
>
> On Tue, Aug 12, 2025 at 12:24:10PM +0530, shveta malik wrote:
> > It looks like commit 2633dae (mistakenly) introduced a change ([1]) in
> > SnapBuildSnapshotExists(), altering the format used for snapshot file
> > names during the search. However, SnapBuildSerialize still uses the
> > old format ("%s/%X-%X.snap"), which led to the slot-sync worker being
> > unable to locate existing snapshot files.

Thanks for the investigation!

> Sorry, it's my fault. I forgot to update the format in SnapBuildSerialize().
>
> I'd prefer to update the format in SnapBuildSerialize() instead of reverting
> this change.

+1.
If we make this change, we should also update other places using "%X-%X"?

$ git grep -E "%X-%X.(snap|tmp)"
contrib/pg_logicalinspect/pg_logicalinspect.c: if (sscanf(filename,
"%X-%X.snap", &hi, &lo) != 2)
contrib/pg_logicalinspect/pg_logicalinspect.c: sprintf(tmpfname,
"%X-%X.snap", hi, lo);
src/backend/replication/logical/snapbuild.c: sprintf(path, "%s/%X-%X.snap",
src/backend/replication/logical/snapbuild.c: sprintf(tmppath,
"%s/%X-%X.snap.%d.tmp",
src/backend/replication/logical/snapbuild.c: sprintf(path, "%s/%X-%X.snap",
src/backend/replication/logical/snapbuild.c: if
(sscanf(snap_de->d_name, "%X-%X.snap", &hi, &lo) != 2)

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-08-12 09:01:17 Re: Conflict detection for update_deleted in logical replication
Previous Message Amit Kapila 2025-08-12 08:51:30 Re: Conflict detection for update_deleted in logical replication