Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wh2pm-00012D-31 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 10:15:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wh2ol-000JcW-2B for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 10:14:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wh2ol-000JcO-0p for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 10:14:20 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wh2oj-000000000TK-3yrt for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 10:14:18 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-c1269e4721aso468889866b.0 for ; Tue, 07 Jul 2026 03:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783419256; cv=none; d=google.com; s=arc-20260327; b=YwvzNSoIvcapqombuLt8HGjizDr+U7TE0VV7GTPmXwFo0XaF8s8otHzqlK4KgZvs/c 8ySbvoBIU9Hl+ghFSizAolwd0LvIKPJ1AGkRaI+IDlvmbS9KgH6XaDfr7NWTnu2s6edU 2O30JnnHiX/smk5yk1pziap5Jrwx9sQoaPbo5IngYTJLSJnV7xBHJBQVnjAN9xNE/nTG e2D/EFvuO1c75P6qlgObzVnWFWikfttZ7+qHh7GX967wxXDxi5KDFJuvO2QtWwhvnSJN B0enthE7c6qVglLx09QU2QSl5dpEaKZdZkTtltXmqmtr6WKAxhb9f51c27AxUANWUHd5 dS5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=rW72cVRMhpcjAQCfSbknwltZR5ra4J3BKvIMXaUzGEo=; fh=5ZKeTiQ227Noo89Hyej1lXUfBIBgJ7AkJ9fmxqngB1o=; b=rbQIuZI+7cLCB9XC36B2ULNTJAAPDRLWABvyfGDv6skymb2V/u4sUHWMcDuAsWQgio e5lpvz0XjRaUfF8IFMsd7MoEOe55gT4Vh5H2mcRWL1p68p7Wxv568NjRDLZvNMLTiIyO K1axnQBglq9J9o4tXSrHxCXRC0u7Wz09THUUikYGWV+wLbbR9ZlUAy5yiHtkykqxINGP YGnjJ1QAnSRBy1578MrK4vaLy6CihuvKsJPNf7m8iksauyC461DaLbuwETU16YpHF4We DxqeaIPKxPYje2Zgxeu7Mwxad+fqSC1xlBgVb6no8Y0eeBoeFbjIqCZzGSrQi82w6TKd 1y1w==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783419256; x=1784024056; darn=lists.postgresql.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=rW72cVRMhpcjAQCfSbknwltZR5ra4J3BKvIMXaUzGEo=; b=SK8w5BnW2nniG1C0HhFgA2t4t4xAf3HdeRblkvw7qnPqHinIWtukV7wdWgQ0oKK9c8 7HhwobAIz2kgqWpt1RUVNE+5Tzdsyp/R38DSngKX10pntbUSoq/aqlexuk5DKZI1CDFr Gj6y8Z+NCHj1UgUMGNYcguYvIr0c8MrwHZQcRZ2EJODhDsOMi5GAxDnP+zruZiFWRyFd SYMQSkzLhdXhgyQLjF+LQPAR8vyOyLoe0yh9pyXxixuTO3JH5DbS+p3ppHdED1Tf2diL q/sI2vCeXXDPDFpjOTvi9NV2gQ4ogaxBoO5PeKOkgAZgq23iS0TqbLdepeOdQzheSCfI nj8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783419256; x=1784024056; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=rW72cVRMhpcjAQCfSbknwltZR5ra4J3BKvIMXaUzGEo=; b=U4oi6mUhc15QcgnNZp9S9h61btjHaqlTek+M7/E3R/JAn6fRXzZLac8n1rN7pW8dpJ RV2bnlnnp/xYSGQIrUNNlddxDp/DH6W/SxkU9qfIGzyozdgjkAJ9/H4607B0SijA6fQd c5bnL3r1CxfYpqnQK5TPQviYzqf7BtAap+VtAIZqRpN1g31H6ZdQjmXn117gN76EMRb6 IVFT+62LwJGHS+x7pBc9fMBoo2FdXrVGmOJ5xoVkJkYJqQ9YvV4RVjwghJhXMWTOqBdI qQjrfS/yEpU4gOS47/8h9xN06KqOX1JzLv8taaJJZZBqhpHVjYMEj46nrsKAipKGATQJ lAng== X-Forwarded-Encrypted: i=1; AHgh+RrUqlrai+RAhDmc28xmzfb8Ub9NsMbHW0oDlHJ3iv+hhZ+VuHCUaKiBLI3Lsf8TLem77oJkVmroAB1p/z4X@lists.postgresql.org X-Gm-Message-State: AOJu0YytdjQMrdPLhSNSyefR4DeJkG0cq5K39qeTD0DW2EzOrliaUnWm AMIKedRWiMToEc3BoCniCLep7/Uzta0cBLxoJvWLlDOvEE/vNRUbgXx3H2RGUkj6gOkVvyrvCxQ p1ZQeyCo3aCpLQbsDCoyASve6Xwv+uDc= X-Gm-Gg: AfdE7cnVzKSBCQiI3gtodC7zFpX0BBhER6BdgP5788Yldv2Mqph2KI5jbFlf4xPjQxP 2KR7Y9FtojAsL2hABz90ResHBIeWNNfYeiYkUgXF9wtHbfMv/01XASmzG7CWsZ6/Rlcm/SNQMQh 9JtEgpfvwe47jMP/I6xv6apDrsuSZ1hiUrnDqYB2MkMyEilqVN967N2Y6p7fmkOEnw11sNMM+ie hLyhhwbHRvr/026eZ19ONuxBhDvoGQ7stMqQghZ/9nK2modaxSodQ1c92/P6HKoPypJXARF2uU9 hpFdmVtqirlgjqDK6a1ocyFxfKlJkzDa5BbJhRdbWSLhZAKj7fVB X-Received: by 2002:a17:907:9612:b0:c12:3ccd:7c0 with SMTP id a640c23a62f3a-c15a671b211mr252099666b.23.1783419255862; Tue, 07 Jul 2026 03:14:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kouber Saparev Date: Tue, 7 Jul 2026 13:13:59 +0300 X-Gm-Features: AVVi8Cdv1TTH3LkuUqunEvHDekLmumTEUFN5ginG5pkyxibvxp4EFEBvLCgs6sM Message-ID: Subject: Re: BF mamba failure To: Michael Paquier Cc: Bertrand Drouvot , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000003b3ca0065602a7dd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003b3ca0065602a7dd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable We had this issue again, the database just stopped - PostgreSQL 17.6. FATAL,XX000,"trying to drop stats entry already dropped: kind=3Drelation dboid=3D16420 objoid=3D3885511363 refcount=3D1 generation=3D0" There is no such object present in the database. Do you think the issue might be fixed in PostgreSQL 18.4?... Or PostgreSQL 19 eventually? =D0=9D=D0=B0 =D1=81=D1=80, 17.09.2025=E2=80=AF=D0=B3. =D0=B2 6:33 Michael P= aquier =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0: > On Tue, Sep 16, 2025 at 02:45:03PM +0300, Kouber Saparev wrote: > > =D0=9D=D0=B0 =D0=BF=D1=82, 12.09.2025=E2=80=AF=D0=B3. =D0=B2 3:37 Micha= el Paquier > =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0: > >> With which process has this cascading standby been created? > >> Does the workload of the primary involve a high consumption of OIDs > >> for relations, say many temporary tables? > > > > Yes, we have around 150 entries added and deleted per second in pg_clas= s, > > and around 800 in pg_attribute. So something is actively creating and > > dropping tables all the time. > > The number of relations would most likely matter, I doubt that > pg_attribute contributes a lot in the frictions. One of the test > scenarios I am running is exactly that: a bunch of CREATE/DROP tables > running concurrently with backends in a cascading standby accessing > them, while tweaking the OID generated in the control file to force > wraparounds. I am failing to re-create your problem, for now at > least. > > > > Another thing that may help is the WAL record history. Are you for > > > example seeing attempts to drop twice the same pgstats entry in WAL > > > records? Perhaps the origin of the problem is in this area. A > > > refcount of 2 is relevant, of course. > > > > > > > How could we dig into this, i.e. inspecting such attempts in the WAL > > records? > > Yeah, with pg_walinspect or pg_waldump, but I doubt that you retain > enough WAL history to be able to ping at something specific. One > pattern I am looking for is duplicated drops initiated from the WAL > records, when wraparound hits, or at least if there's a window small > enough that two WAL records are generated and attempt to generate the > same entry drop. That's just an assumption at this stage. > > > > Is it enough to upgrade the replicas or we need to upgrade the primary = as > > well? > > That would be both. There are always reasons to update to the latest > minor version of Postgres. See the release notes for a bunch of them, > that's usually convincing enough especially with CVEs addressed. :) > -- > Michael > --0000000000003b3ca0065602a7dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
We had this issue again, the database just stopped - Postg= reSQL 17.6.

FATAL,XX000,"trying to drop stats entry= already dropped: kind=3Drelation dboid=3D16420 objoid=3D3885511363 refcoun= t=3D1 generation=3D0"

There is no such object= present in the database.

Do you think the issue might be fixed in P= ostgreSQL 18.4?... Or PostgreSQL 19 eventually?

=D0=9D=D0=B0 =D1=81=D1=80, 17.09.2025=E2=80=AF=D0=B3. =D0=B2 6:33 Michael= Paquier <michael@paquier.xyz= > =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0:
On Tue, Sep 16, 2025 at 02:45:03PM +0300, Kouber= Saparev wrote:
> =D0=9D=D0=B0 =D0=BF=D1=82, 12.09.2025=E2=80=AF=D0=B3. =D0=B2 3:37 Mich= ael Paquier <mi= chael@paquier.xyz> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0:
>> With which process has this cascading standby been created?
>> Does the workload of the primary involve a high consumption of OID= s
>> for relations, say many temporary tables?
>
> Yes, we have around 150 entries added and deleted per second in pg_cla= ss,
> and around 800 in pg_attribute. So something is actively creating and<= br> > dropping tables all the time.

The number of relations would most likely matter, I doubt that
pg_attribute contributes a lot in the frictions.=C2=A0 One of the test
scenarios I am running is exactly that: a bunch of CREATE/DROP tables
running concurrently with backends in a cascading standby accessing
them, while tweaking the OID generated in the control file to force
wraparounds.=C2=A0 I am failing to re-create your problem, for now at
least.

> > Another thing that may help is the WAL record history.=C2=A0 Are = you for
> > example seeing attempts to drop twice the same pgstats entry in W= AL
> > records?=C2=A0 Perhaps the origin of the problem is in this area.= =C2=A0 A
> > refcount of 2 is relevant, of course.
> >
>
> How could we dig into this, i.e. inspecting such attempts in the WAL > records?

Yeah, with pg_walinspect or pg_waldump, but I doubt that you retain
enough WAL history to be able to ping at something specific.=C2=A0 One
pattern I am looking for is duplicated drops initiated from the WAL
records, when wraparound hits, or at least if there's a window small enough that two WAL records are generated and attempt to generate the
same entry drop.=C2=A0 That's just an assumption at this stage.


> Is it enough to upgrade the replicas or we need to upgrade the primary= as
> well?

That would be both.=C2=A0 There are always reasons to update to the latest<= br> minor version of Postgres.=C2=A0 See the release notes for a bunch of them,=
that's usually convincing enough especially with CVEs addressed.=C2=A0 = :)
--
Michael
--0000000000003b3ca0065602a7dd--