Fix showing XID of a spectoken lock in an incorrect field of pg_locks view.

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Fix showing XID of a spectoken lock in an incorrect field of pg_locks view.
Дата
Msg-id CAD21AoCEKxZztULP1CDm45aSNNR1QO-Bh1q6LMTspQ78PBuJrw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fix showing XID of a spectoken lock in an incorrect field of pg_locks view.  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Hi,

I realized that pg_locks view shows the transaction id of a
speculative token lock in the database field:

postgres(1:509389)=# select * from pg_locks where locktype = 'spectoken';
 locktype  | database | relation | page | tuple | virtualxid |
transactionid | classid | objid | objsubid | virtualtransaction |  pid
  |     mode      | granted | fastpath | waitstart

-----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+--------+---------------+---------+----------+-----------
 spectoken |      741 |          |      |       |            |
      |       3 |     0 |        0 | 3/5                | 509314 |
ExclusiveLock | t       | f        |
(1 row)

It seems to be confusing and the user won't get the result even if
they search it by transactionid = 741. So I've attached the patch to
fix it. With the patch, the pg_locks views shows like:

 locktype  | database | relation | page | tuple | virtualxid |
transactionid | classid | objid | objsubid | virtualtransaction |  pid
  |     mode      | granted | fastpath | waitstart

-----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+--------+---------------+---------+----------+-----------
 spectoken |          |          |      |       |            |
  746 |         |     1 |          | 3/4                | 535618 |
ExclusiveLock | t       | f        |
(1 row)

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: pgsql: Delay commit status checks until freezing executes.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Delay commit status checks until freezing executes.