接前文  初步学习pg_control文件之十四

再看如下这个:

int            MaxConnections;

应该说,它是一个参考值,在global.c中有如下定义

/*
* Primary determinants of sizes of shared-memory structures. MaxBackends is
* MaxConnections + autovacuum_max_workers + 1 (it is computed by the GUC
* assign hooks for those variables):
*/
int NBuffers = ;
int MaxBackends = ;
int MaxConnections = ;
/*
* This must be called ONCE during postmaster or standalone-backend startup
*/
void
StartupXLOG(void)
{

/*
* If any of the critical GUCs have changed, log them before we allow
* backends to write WAL.
*/
LocalSetXLogInsertAllowed();
XLogReportParameters(); …
}
/*
* Check if any of the GUC parameters that are critical for hot standby
* have changed, and update the value in pg_control file if necessary.
*/
static void
XLogReportParameters(void)
{
if (wal_level != ControlFile->wal_level ||
MaxConnections != ControlFile->MaxConnections ||
max_prepared_xacts != ControlFile->max_prepared_xacts ||
max_locks_per_xact != ControlFile->max_locks_per_xact)
{
ControlFile->MaxConnections = MaxConnections;
ControlFile->max_prepared_xacts = max_prepared_xacts;
ControlFile->max_locks_per_xact = max_locks_per_xact;
ControlFile->wal_level = wal_level;
UpdateControlFile();
}
}

它就是一个参考值:

/*
* This must be called ONCE during postmaster or standalone-backend startup
*/
void
StartupXLOG(void)
{
… /* REDO */
if (InRecovery)
{

/* Check that the GUCs used to generate the WAL allow recovery */
CheckRequiredParameterValues(); …
if (record != NULL)
{

/*
* main redo apply loop
*/
do
{

/*
* If we are attempting to enter Hot Standby mode, process
* XIDs we see
*/
if (standbyState >= STANDBY_INITIALIZED &&
TransactionIdIsValid(record->xl_xid))
RecordKnownAssignedTransactionIds(record->xl_xid); RmgrTable[record->xl_rmid].rm_redo(EndRecPtr, record);
… } while (record != NULL && recoveryContinue);

}

}

}
/*
* XLOG resource manager's routines
*
* Definitions of info values are in include/catalog/pg_control.h, though
* not all record types are related to control file updates.
*/
void
xlog_redo(XLogRecPtr lsn, XLogRecord *record)
{

if (info == XLOG_NEXTOID)
{

}

else if (info == XLOG_PARAMETER_CHANGE)
{

/* Check to see if any changes to max_connections give problems */
CheckRequiredParameterValues();
}
}

再看下面:

/*
* Check to see if required parameters are set high enough on this server
* for various aspects of recovery operation.
*/
static void
CheckRequiredParameterValues(void)
{
... if (InArchiveRecovery && EnableHotStandby)
{
.../* We ignore autovacuum_max_workers when we make this test. */
RecoveryRequiresIntParameter("max_connections",
MaxConnections,
ControlFile->MaxConnections);
...

}
}

最新文章

  1. iOS KVC valueForKeyPath学习心得
  2. SQL语句:find_in_set的使用方法
  3. H5标签-canvas实现颜色拾取功能
  4. [SQL]SUTFF内置函数的用法
  5. oracle的表名、字段名、constraint名的长度限制分别是多少?
  6. cocos2d-x 3.1.1 学习笔记[3]Action 动作
  7. 【线段树/数学/扩展欧几里得】 Bzoj 3913:奇数国
  8. SQL Server2008数据库如何改名
  9. 第一节 UPC 码
  10. CC Subarray LCM (数学)
  11. Linux下find命令具体解释
  12. shell-改变分隔符
  13. Java学习笔记之static
  14. c#之时间戳与DateTime的相互转换
  15. 走近webpack(5)--devtool及babel的使用
  16. Asianux 7.3安装Oracle 11.2.0.4单实例体验
  17. Qt Installer Framework 使用说明(二)
  18. matlab 获取网卡MAC地址
  19. Oracle - 为子查询提供动态结果集
  20. 【CodeForces】915 E. Physical Education Lessons 线段树

热门文章

  1. oracle数据库中创建表空间和临时表空间,以及用户和密码以及设置密码永不过期
  2. python入门5 运算符
  3. Jmeter入门12 __time函数 jmeter获取当前系统时间
  4. 2018中国大学生程序设计竞赛 - 网络选拔赛 1010 YJJ's Salesman 【离散化+树状数组维护区间最大值】
  5. python-实现登录接口
  6. <head> 中的 JavaScript 函数
  7. android 界面控件 textview 全解
  8. HTML中id和class选择器
  9. Django-rest-framework(六)filter,ordering,search
  10. Git push提示pre-receive hook declined