设为首页 加入收藏

TOP

PostgreSQL启动过程中的那些事七:初始化共享内存和信号五:shmem中初始化multixact (三)
2014-11-24 03:05:20 来源: 作者: 【 】 浏览:10
Tags:PostgreSQL 启动 过程 那些 初始 共享 内存 信号 shmem multixact
cause only

* during or after acquiring a shared lockcould an XID possibly become a

* member of a MultiXact, and that MultiXactwould have to be created

* during or after the lock acquisition.)

*

* OldestVisibleMXactId[k] is the oldestMultiXactId each backend's

* current transaction(s) think is potentiallylive, or InvalidMultiXactId

* when not in a transaction or not in atransaction that's paid any

* attention to MultiXacts yet. This is computed when first needed in a

* given transaction, and cleared attransaction end. We can compute it

* as the minimum of the validOldestMemberMXactId[] entries at the time

* we compute it (using nextMXact if none areva lid). Each backend is

* required not to attempt to access any SLRUdata for MultiXactIds older

* than its own OldestVisibleMXactId[] setting;this is necessary because

* the checkpointer could truncate away suchdata at any instant.

*

* The checkpointer can compute the safetruncation point as the oldest

* valid value among all theOldestMemberMXactId[] and

* OldestVisibleMXactId[] entries, or nextMXactif none are valid.

* Clearly, it is not possible for anylater-computed OldestVisibleMXactId

* value to be older than this, and so there isno risk of truncating data

* that is still needed.

*/

MultiXactIdperBackendXactIds[1]; /* VARIABLE LENGTH ARRAY */

} MultiXactStateData;

下面看看初始化完"MultiXactOffset Ctl"、"MultiXactOffset Ctl"及"Shared MultiXact State"相关结构后在内存中的结构图

\

初始化完MultiXact相关结构的内存结构图

为了精简上图,把创建shmem的哈希表索引"ShmemIndex"时创建的HCTL结构删掉了,这个结构的作用是记录创建可扩展哈希表的相关信息。增加了左边灰色底的部分,描述共享内存/shmem里各变量物理布局概览,由下往上,由低地址到高地址。其中的"MultiXactCtl"相关机构即MultiXactOffsetCtl和MultiXactMemberCtl的相关结构图下面分别给出,要不上面的图太大太复杂了。

\

MultiXact相关结构图

首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MongoDB学习笔记--下载安装 下一篇SQL Server、Oracle、db2所提供的..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C语言中如何将结构体 (2025-12-24 22:20:09)
·纯C语言结构体成员变 (2025-12-24 22:20:06)
·C语言中,指针函数和 (2025-12-24 22:20:03)
·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)