GBase 8c 事务ID和快照(二)
以下的函数在一个输出形式中提供服务器事务信息。这些函数的主要用途是为了确定在两个快照之间有哪个事务提交。
txid_current()
描述:获取当前事务ID。
返回类型:bigint
gs_txid_oldestxmin()
描述:获取当前最小事务id的值oldesxmin。
返回类型:bigint
txid_current_snapshot()
描述:获取当前快照。
返回类型:txid_snapshot
txid_snapshot_xip(txid_snapshot)
描述:在快照中获取正在进行的事务ID。
返回类型:setof bigint
txid_snapshot_xmax(txid_snapshot)
描述:获取快照的xmax。
返回类型:bigint
txid_snapshot_xmin(txid_snapshot)
描述:获取快照的xmin。
返回类型:bigint
txid_visible_in_snapshot(bigint, txid_snapshot)
描述:在快照中事务ID是否可见(不使用子事务ID)。
返回类型:Boolean
get_local_prepared_xact()
描述:获取当前节点两阶段残留事务信息,包括事务id,两阶段gid名称,prepared的时间,owner的oid,database的oid及当前节点的node_name。
返回类型:xid, text, timestamptz, oid, oid,text
get_remote_prepared_xacts()
描述:获取所有远程节点两阶段残留事务信息,包括事务id,两阶段gid名称,prepared的时间,owner的名称,database的名称及node_name。
返回类型:xid, text, timestamptz, name, name,text
global_clean_prepared_xacts(text, text)
描述:并发清理两阶段残留事务,仅gs_clean工具可以调用清理,其他用户调用均返回false。
返回类型:Boolean
gs_get_next_xid_csn()
描述:返回全局所有节点上的next_xid和next_csn值。
返回值如下:
表1 gs_get_next_xid_csn返回参数说明
字段名 | 描述 |
nodename | 节点名称。 |
next_xid | 当前节点下一个事务id号。 |
next_csn | 当前节点下一个csn号。 |
评论
热门帖子
- 12025-12-01浏览数:182759
- 22023-05-09浏览数:25044
- 42023-09-25浏览数:18519
- 52020-05-11浏览数:17526