Re: any wait event for a commit in sync replication?

From: qihua wu <staywithpin(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: any wait event for a commit in sync replication?
Date: 2023-01-31 08:22:10
Message-ID: CAPoYtoKVRh4AzENLFx0OgNEnMTo0zzK+jwDXEOvuTgzKYU9QPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry, the pg_stat_activity sql was executed from a session connecting to a
wrong postgresql. It DOES show in the view, and the wait event is SyncRep.

postgres=# select * from pg_stat_activity where application_name='psql' and
datname='example';
-[ RECORD 1 ]----+--------------------------------------
....
wait_event_type | IPC
wait_event | SyncRep
state | active
....

On Tue, Jan 31, 2023 at 3:35 PM qihua wu <staywithpin(at)gmail(dot)com> wrote:

> We are using sync replication, if a session runs an insert, and then
> commit, the client is actually waiting for commit to complete, but looks
> like this wait doesn't show in pg_stat_activity.
>
> In one session I inserted a row (auto commit), it hangs there.
>
> example=# insert into test_timteout select '1';
> ^CCancel request sent
> WARNING: canceling wait for synchronous replication due to user request
> DETAIL: The transaction has already committed locally, but might not have
> been replicated to the standby.
> INSERT 0 1
> example=# select pg_backend_pid();
> pg_backend_pid
> ----------------
> 19325
> (1 row)
>
>
> During the hung period.
> postgres=# select * from pg_stat_activity where pid=19325;
> (0 rows)
>
> postgres=#
>
>
> If there is no event for such commit, anyway to find out such session
> which pending on commit(sync replication)
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hirose shigeo (廣瀬 繁雄 □SWC○ACT) 2023-01-31 09:31:43 Re: How to control pg_catalog results for each users?
Previous Message Giovanni Biscontini 2023-01-31 08:02:53 Best Open Source OS for Postgresql