Re: Improve WAIT FOR read-your-writes consistency doc

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Improve WAIT FOR read-your-writes consistency doc
Date: 2026-09-10 11:31:06
Message-ID: CABPTF7WuzHpStM0JcBf0Ag9_YFp3HSVFrB-tdH8mzw+ea0TB6Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 9, 2026 at 9:57 PM Sami Imseih <samimseih(dot)pg(at)gmail(dot)com> wrote:
>
> Thanks for the feedback.
>
> > Thanks for raising this! I agree this may need to be harnessed. If we change this line, we might also want to modify the read-your-writes-consistency chapter.
> > <sect2 id="read-your-writes-consistency">
> > <title>Read-Your-Writes Consistency</title>
>
> Yes, that needs to mention the COMMIT LSN explicitly.
>
> > I am also wondering whether a example like this is helpful, though it is somehow duplicated with the existing one:
> > postgres=# BEGIN;
> > BEGIN
> > postgres=*# UPDATE movie SET genre = 'Dramatic' WHERE genre = 'Drama';
> > UPDATE 100
> > postgres=*# COMMIT;
> > COMMIT
> > postgres=# SELECT pg_current_wal_insert_lsn();
>
> Rather than change the example, just updated the explanation of the
> example with the proper commit wording.
>
> WDYT of the attached?

Just a trivial comment:

+ This is achieved by the following steps. After committing the write
+ operations on the primary, the application retrieves a WAL location
+ that is at or after the transaction's <literal>COMMIT</literal> record,
+ using a function call like this.

We might need to specify the word 'end' clearly to avoid
misunderstanding the LSN position as the beginning of the commit
record.

at or after the *end* of the write transaction’s COMMIT record.

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-09-10 11:41:14 RE: Review items for EXCEPT TABLE publication
Previous Message Amit Kapila 2026-09-10 11:18:52 Re: Review items for EXCEPT TABLE publication