Re: Lost FOR KEY SHARE lock

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Lost FOR KEY SHARE lock
Date: 2026-11-17 02:10:05
Message-ID: CAGRkXqRoCKT78XbSDoBbdS_KTJHkLGEEoymfGpMCz3kC9h-VFQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Heikki,

Thanks for the report. Any update that moves the row to a new page
hits this too, no TOAST needed. In a short pgbench run it left orphaned
FK rows on master, and none with the patch.

0001 does what you suggested. It drops our own lock and adds us back
as the updater, only when the xmax changed. 0002 is your test with a
few more cases.

The fix goes back to 15

Thanks,
Shihao

Attachment Content-Type Size
v1-0002-Add-test-for-KEY-SHARE-locks-taken-while-heap_update.patch application/octet-stream 10.9 KB
v1-0001-Don-t-lose-KEY-SHARE-locks-taken-while-heap_update-h.patch application/octet-stream 7.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Ayush Tiwari 2026-11-17 01:45:04 Re: BUG #19906: Backend crash (signal 11) creating a LANGUAGE sql function that returns a composite type from a sub-