Re: XactLockTableWait doesn't set wait_event correctly

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: XactLockTableWait doesn't set wait_event correctly
Date: 2016-12-02 00:28:15
Message-ID: CA+TgmobvNUMtE1Xz8z_R9gnZ-TXebfLif68WktLW7O-7R7gysA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 30, 2016 at 6:50 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> Obtaining a tuple lock requires two separate actions: First we do
> LockTuple() and then we do XactLockTableWait().

I think that's kind of a confusing way of looking at it. LockTuple()
waits for a "tuple" lmgr lock, and XactLockTableWait waits for a
"transaction" lmgr lock. Those two things are both part of a larger
protocol for managing access to what we refer to as tuple locks at the
SQL level. I don't think conflating those things would be a very good
idea, because it's useful to know which phase you're currently doing -
e.g. anybody waiting on a tuple lock is not first in the queue.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2016-12-02 00:31:47 Re: Proposal for changes to recovery.conf API
Previous Message Amit Kapila 2016-12-01 23:51:27 Re: Write Ahead Logging for Hash Indexes