1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Change locktype "speculative token" to "spectoken".

It's just weird that this name wasn't chosen to look like an
identifier.  The suspicion that it wasn't thought about too
hard is reinforced by the fact that it wasn't documented in
the pg_locks view (until I did so, a day or two back).

Update, and add a comment reminding future adjusters of this
array to fix the docs too.

Do some desultory wordsmithing on various entries in the wait
events tables.

Discussion: https://postgr.es/m/24595.1589326879@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2020-05-15 21:47:21 -04:00
parent 1d3743023e
commit 474e7da648
5 changed files with 58 additions and 56 deletions

View File

@ -22,7 +22,10 @@
#include "utils/builtins.h"
/* This must match enum LockTagType! */
/*
* This must match enum LockTagType! Also, be sure to document any changes
* in the docs for the pg_locks view and for wait event types.
*/
const char *const LockTagTypeNames[] = {
"relation",
"extend",
@ -30,7 +33,7 @@ const char *const LockTagTypeNames[] = {
"tuple",
"transactionid",
"virtualxid",
"speculative token",
"spectoken",
"object",
"userlock",
"advisory"

View File

@ -362,16 +362,16 @@ step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
locktype IN ('speculative token', 'transactionid')
locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted
isolation/insert-conflict-specconflict-s1speculative tokenShareLock f
isolation/insert-conflict-specconflict-s1spectoken ShareLock f
isolation/insert-conflict-specconflict-s1transactionid ExclusiveLock t
isolation/insert-conflict-specconflict-s2speculative tokenExclusiveLock t
isolation/insert-conflict-specconflict-s2spectoken ExclusiveLock t
isolation/insert-conflict-specconflict-s2transactionid ExclusiveLock t
step controller_unlock_2_4: SELECT pg_advisory_unlock(2, 4);
pg_advisory_unlock
@ -384,7 +384,7 @@ step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
locktype IN ('speculative token', 'transactionid')
locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
@ -406,7 +406,7 @@ step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
locktype IN ('speculative token', 'transactionid')
locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;

View File

@ -64,7 +64,7 @@ step "controller_print_speculative_locks" {
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
locktype IN ('speculative token', 'transactionid')
locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;