摘要:
接前文初步学习pg_control文件之四,继续看何时出现 DB_IN_CRASH_RECOVERY:看下面代码就比较清楚了:如果对InArchiveRecovery 判断值为假,而且 读取出来pg_control文件的 state不是 SHUTDOWNED状态,表明当初没有来得及把SHUTDOWNED状态写入到pg_control文件,那么就是说系统已经崩溃了。/* * This must be called ONCE during postmaster or standalone-backend startup ... 阅读全文
摘要:
接前文,初步学习pg_control文件之三继续分析何时出现 DB_SHUTDOWNING状态:在正常的shutdown的时候,需要进行checkpoint,所以就在此处,设置pg_control文件的state状态为DB_SHUTDOWNING。/* * Perform a checkpoint --- either during shutdown, or on-the-fly * * flags is a bitwise OR of the following: * CHECKPOINT_IS_SHUTDOWN: checkpoint is for database shutdown... 阅读全文
摘要:
接前文,初步学习pg_control文件之二继续学习:研究 DBState,先研究DB_IN_PRODUCTION ,看它如何出现:它出现在启动Postmaster时运行的函数处:/* * This must be called ONCE during postmaster or standalone-backend startup */ void ... 阅读全文
摘要:
接前文:初步认识pg_control文件继续学习,pg_control文件在何处形成的?是在initdb的时候,运用的函数如下:/* * This func must be called ONCE on system install. It creates pg_control * and the initial XLOG segment. */voidBootStrapXLOG(void){ CheckPoint checkPoint; char *buffer; XLogPageHeader page; XLogLongPageHeader lo... 阅读全文
摘要:
这个据说是PostgreSQL的control file。到底如何呢,先看看改名后如何,把pg_control文件改名,然后启动 Postgres,运行时得到信息:[postgres@pg101 bin]$ postgres: could not find the database systemExpected to find it in the directory "/usr/local/pgsql/bin/../data",but could not open file "/usr/local/pgsql/bin/../data/global/pg_contr 阅读全文
摘要:
客户的问题是:向Slony-I运行环境中,增加新的slaveDB节点的时候发生错误。log中反复出现错误,然后再重新开始(重新开始部分的log省略):CONFIG remoteWorkerThread_1: connected to provider DBCONFIG remoteWorkerThread_1: prepare to copy table "tst"."a_tbl"CONFIG remoteWorkerThread_1: prepare to copy table "tst"."b_tbl"CONF 阅读全文
摘要:
http://slony.info/documentation/2.1/advanced.html#AEN14254.1.2. Event ConfirmationsWhen an event is processed by the slon process for a remote node, a CONFIRM message is generated byinserting a tuple into the sl_confirm table.This tuple indicates that a particular event has been confirmed by a parti 阅读全文
摘要:
客户质询的现象是:Slony-I运行中,log中发现FATAL信息:FATAL storeListen: unknown node ID 3出现了上述错误后,再看后继的log,又恢复正常运行了。客户的问题在于:如何看待这个错误信息,它是否是设计上就是这样的?言外之意,这到底是否是一个bug?设计上是否是这样,是无从知晓的,只有问Vendor。而我的想法是,先分析源代码看看:/* ----------* SlonWatchdog* ----------*/static voidSlonWatchdog(void){ … slon_log(SLON_INFO, "slon: watchd 阅读全文
摘要:
与Oracle不同的是,PostgreSQL中压根没有这种的东西。若以,如果因为写在线WAL文件是发生磁盘I/O错误,那么数据库系统就启动不了了。解决的办法,我想,在PostgreSQL中,如论如何都要启动Archive模式,否则会很惨。或者,把自己的cluster目录放在网络目录上,比如通过NFS,然后看能否把这个网络目录实际导向两个以上的目录。 阅读全文