[BUG] Assert always fails while checking whether local buffer is dirty of is exclusively locked

From: Daniil Davydov <3danissimo(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [BUG] Assert always fails while checking whether local buffer is dirty of is exclusively locked
Date: 2024-12-05 08:13:08
Message-ID: CAJDiXggGznOttwREfyZRE4f7oLRz1=jTA4xA7u-t6_8CX7j=0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Commit 00d7fb5e2e39198387ae00af8dd18b787b6a4d63 adds
BufferIsExclusiveLocked and BufferIsDirty functions.
They take into account that they can also be called for temporary
tables, but they both have assert, that will always fail
for temporary tables :
***
Assert(LWLockHeldByMeInMode(BufferDescriptorGetContentLock(bufHdr),
LW_EXCLUSIVE));
***

They fails because LockBuffer function just skip acquiring lock for
temporary table :
***
if (BufferIsLocal(buffer))
return;
***

I suppose that fix can be done as in the attached to this email patch
(for REL_17_STABLE)

--
Best regards,
Daniil Davydov

Attachment Content-Type Size
0001-Fix-isDirty-and-isLocked-for-temp-tables.patch text/x-patch 1.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-12-05 08:13:13 Re: shared-memory based stats collector - v70
Previous Message Aleksander Alekseev 2024-12-05 08:11:55 Re: [PATCH] Refactor bytea_sortsupport()