Re: Strange decreasing value of pg_last_wal_receive_lsn()

2020-06-03 Thread godjan
I got it should be LSN + MAXALIGN(xlogrecord length)  Thanks a lot. > On 2 Jun 2020, at 19:11, Jehan-Guillaume de Rorthais wrote: > > Nope, just sum the xlogrecord length.

Re: Strange decreasing value of pg_last_wal_receive_lsn()

2020-06-01 Thread godjan
Hi, sorry for 2 weeks latency in answer :) >> It fixed out trouble, but there is one another. Now we should wait when all >> ha alive hosts finish replaying WAL to failover. It might take a while(for >> example WAL contains wal_record about splitting b-tree). > > Indeed, this is the concern I

Re: Strange decreasing value of pg_last_wal_receive_lsn()

2020-05-13 Thread godjan
52, Jehan-Guillaume de Rorthais wrote: > > > (too bad the history has been removed to keep context) > > On Fri, 8 May 2020 15:02:26 +0500 > godjan • wrote: > >> I got it, thank you. >> Can you recommend what to use to determine which quorum standby should be &

Re: Strange decreasing value of pg_last_wal_receive_lsn()

2020-05-10 Thread godjan
synchronous_standby_names=ANY 1(host1, host2) synchronous_commit=on So to understand which standby wrote last data to disk I should know receive_lsn or write_lsn. Sent from my iPhone > On 9 May 2020, at 13:48, Michael Paquier wrote: > > On Fri, May 08, 2020 at 03:02:26PM +050

Is it possible to find out write_lsn on standby?

2020-05-08 Thread godjan
On primary I can execute ’SELECT write_lsn FROM pg_stat_replication;’ and get write_lsn of standby. I didn’t find function like "pg_last_write_lsn()” to get write_lsn on standby. Is it possible?

Re: Strange decreasing value of pg_last_wal_receive_lsn()

2020-05-08 Thread godjan
I got it, thank you. Can you recommend what to use to determine which quorum standby should be promoted in such case? We planned to use pg_last_wal_receive_lsn() to determine which has fresh data but if it returns the beginning of the segment on both replicas we can’t determine which standby

Strange decreasing value of pg_last_wal_receive_lsn()

2020-05-08 Thread godjan
PG12 Steps to reproduce on 3 nodes cluster with quorum commit. 1. Cut off network on master with everything. 2. Pkill -9 PostgreSQL on each node. 3. Start PostgreSQL on each node. What was strange? I check every second pg_last_wal_replay_lsn() and pg_last_wal_receive_lsn(). All time it was the

Verify true root on replicas with amcheck

2020-01-09 Thread godjan
Hi, we have trouble to detect true root corruptions on replicas. I made a patch for resolving it with the locking meta page and potential root page. I heard that amcheck has an invariant about locking no more than 1 page at a moment for avoiding deadlocks. Is there possible a deadlock