pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Les <nagylzs@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: replication primary writting infinite number of WAL files
Date: Fri, 24 Nov 2023 15:24:44 -0800
Message-ID: <c24eac2b-cfba-4622-bb6f-9023622be465@aklaver.com> (raw)
In-Reply-To: <CAKXe9UBxKm3pTTUVmoOHMM96kGzN=Y3rHoP53dD=FytMzM8bPQ@mail.gmail.com>
References: <CAKXe9UDZKGevV6t+Y0adUgy2-k-1gMdRUi4Baz=4BMKX1Oig_A@mail.gmail.com>
	<38f7d87c-ae22-48e8-a4c4-0acde1ad6eb9@aklaver.com>
	<CAKXe9UDsS1v95W9GbGnKCmmqwcgJ0b2RatK1g68ZXRY=-kqTgw@mail.gmail.com>
	<430d83f0-65ff-47b0-9600-26094099fc17@aklaver.com>
	<1aec39e7-f64e-4afc-8ab2-3c723dec2b0b@aklaver.com>
	<CAKXe9UDXvxKpwwryUq9q+24Yv_czLO3ytOBdr1fdEFs6cPx8YQ@mail.gmail.com>
	<592a4e9d-0d12-40ac-ad2c-0ddc4caa760a@aklaver.com>
	<CAKXe9UBxKm3pTTUVmoOHMM96kGzN=Y3rHoP53dD=FytMzM8bPQ@mail.gmail.com>

On 11/24/23 14:01, Les wrote:
> 
>     A single sequence for all id columns across all tables?
> 
>     How is the sequence value landing in the id column?
> 
> In most cases it is by using "nextval(seq_name)" in the SQL statement. 
> But sometimes the sequence value is taken first, and then multiple 
> inserts are sent with fixed increasing values. (Sometimes records 
> reference each other, such records are inserted within a short 
> transaction with deferred foreign key constraints.)

Leaving the reasoning behind this alone, the important part is that in 
order for the id values to jump like they did there was intensive 
processing of queries going on.

That would be one thing you should track down, what kicked that off and why?


> It is the main app that is using the database, using jdbc. Multiple 
> instances were running when the sequence jumped.

Multiple instances of the app or something else?

What where the instances doing?


> When the dev db starts up (from the cloned data directory), it still has 
> the old repmgr conf. That config is deleted, and repmgr is disabled 
> right after the startup, but there is the possibility that the dev db 
> has connected the primary when it was cloned (7 days ago), because at 
> the beginning of startup, it is the exact clone of the standby from a 
> previous point of time.

Hmm, that does not look good.

At this point I would create a new post/thread where you organize the 
bits an pieces that you have posted over the course of this thread into 
a something more coherent. In particular a time line of the whole 
cloning/replication process.


> 
>     Laszlo

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (20+ messages)  latest in thread

Message-ID: <c24eac2b-cfba-4622-bb6f-9023622be465@aklaver.com>
Permalink:  ../c24eac2b-cfba-4622-bb6f-9023622be465@aklaver.com/
Also on:    postgresql.org/message-id/c24eac2b-cfba-4622-bb6f-9023622be465@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, nagylzs@gmail.com
  Subject: Re: replication primary writting infinite number of WAL files
  In-Reply-To: <c24eac2b-cfba-4622-bb6f-9023622be465@aklaver.com>
  References: <CAKXe9UDZKGevV6t+Y0adUgy2-k-1gMdRUi4Baz=4BMKX1Oig_A@mail.gmail.com> <38f7d87c-ae22-48e8-a4c4-0acde1ad6eb9@aklaver.com> <CAKXe9UDsS1v95W9GbGnKCmmqwcgJ0b2RatK1g68ZXRY=-kqTgw@mail.gmail.com> <430d83f0-65ff-47b0-9600-26094099fc17@aklaver.com> <1aec39e7-f64e-4afc-8ab2-3c723dec2b0b@aklaver.com> <CAKXe9UDXvxKpwwryUq9q+24Yv_czLO3ytOBdr1fdEFs6cPx8YQ@mail.gmail.com> <592a4e9d-0d12-40ac-ad2c-0ddc4caa760a@aklaver.com> <CAKXe9UBxKm3pTTUVmoOHMM96kGzN=Y3rHoP53dD=FytMzM8bPQ@mail.gmail.com> <c24eac2b-cfba-4622-bb6f-9023622be465@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox