oushu_locks#

The oushu_locks view provides access to information about the distributed locks held by all main node within OushuDB.The oushu_locks view is similar to pg_locks. pg_locks can only privide information about lock held by the node which execute pg_locks query.

Table 1. pg_catalog.oushu_locks

column

type

references

description

locktype

text

Type of the lockable object: relation, extend, page, tuple, transactionid, object, userlock, resource queue, or advisory

database

oid

pg_database.oid

OID of the database in which the object exists, zero if the object is a shared object, or NULL if the object is a transaction ID

relation

oid

pg_class_internal.oid

OID of the relation, or NULL if the object is not a relation or part of a relation

page

integer

Page number within the relation, or NULL if the object is not a tuple or relation page

tuple

smallint

Tuple number within the page, or NULL if the object is not a tuple

virtualxid

text

Virtual ID of a transaction, or NULL if the object is not a virtual transaction ID

transactionid

xid

ID of a transaction, or NULL if the object is not a transaction ID

classid

oid

pg_class_internal.oid

OID of the system catalog containing the object, or NULL if the object is not a general database object

objid

oid

any OID column

OID of the object within its system catalog, or NULL if the object is not a general database object

objsubid

smallint

For a table column, this is the column number (the classid and objid refer to the table itself). For all other object types, this column is zero. NULL if the object is not a general database object

virtualtransaction

text

Virtual ID of the transaction that is holding or awaiting this lock

ip

text

The IP address of main node

pid

integer

Process ID of the server process holding or awaiting this lock. NULL if the lock is held by a prepared transaction

mode

text

Name of the lock mode held or desired by this process

granted

boolean

True if lock is held, false if lock is awaited.

fastpath

boolean

True if lock was taken via fastpath, false if lock is taken via main lock table.

mppsessionid

integer

The id of the client session associated with this lock.

mppiswriter

boolean

Specifies whether the lock is held by a writer process.

gp_segment_id

integer

The OushuDB segment id (dbid) where the lock is held.