Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1224437BF1F for ; Wed, 8 Oct 2008 08:43:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 09401-04 for ; Wed, 8 Oct 2008 08:43:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by postgresql.org (Postfix) with ESMTP id B78CE37BA34 for ; Wed, 8 Oct 2008 08:43:07 -0300 (ADT) Received: by ey-out-2122.google.com with SMTP id 6so1299340eyi.61 for ; Wed, 08 Oct 2008 04:43:05 -0700 (PDT) Received: by 10.210.35.5 with SMTP id i5mr9768725ebi.114.1223466185364; Wed, 08 Oct 2008 04:43:05 -0700 (PDT) Received: from ?80.222.33.27? (dsl-hkibrasgw2-fe21de00-27.dhcp.inet.fi [80.222.33.27]) by mx.google.com with ESMTPS id i3sm9358377nfh.14.2008.10.08.04.43.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Oct 2008 04:43:04 -0700 (PDT) Message-ID: <48EC9CC5.6060803@enterprisedb.com> Date: Wed, 08 Oct 2008 14:43:01 +0300 Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Simon Riggs CC: pgsql-hackers Subject: Re: [PATCHES] Infrastructure changes for recovery (v8) References: <1222815151.4445.1397.camel@ebony.2ndQuadrant> In-Reply-To: <1222815151.4445.1397.camel@ebony.2ndQuadrant> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Heikki Linnakangas X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/305 X-Sequence-Number: 125322 Simon Riggs wrote: > * optional recovery_safe_start_location parameter now provided in > recovery.conf, to allow a consistency point to be manually defined if a > base backup was not taken using standard pg_start/stop backup functions Do we want to cater for that? It only seems safe if you have full_page_writes turned on, and you perform a checkpoint first. But if you do that, why don't you just use pg_start_backup()? > Other Changes > * log_restartpoints removed, use log_checkpoints in postgresql.conf Is this something that would make sense regardless of the rest of the patch? If so, we could apply that separately, which would make this patch a little less overwhelming to review. > * additional function signature for pg_start_backup('label', true | > false) to allow definition of immediate checkpoint/not Wouldn't this need a new entry in pg_proc.h? Again, perhaps we should do this as a separate patch. > * fixes bug discovered while other testing: if pg_stop_backup() is run > when xlogswitch has just occurred then we do not switch log files, yet > we return current filename even though nothing of value in it. If > archive_timeout not enabled we would wait forever for pg_stop_backup() > to return. > * Substantial comments throughout These comments on CheckPointLock seem contradictory: > --- 247,256 ---- > * ControlFileLock: must be held to read/update control file or create > * new log file. > * > ! * CheckpointLock: must be held to do a checkpoint or restartpoint, ensuring > ! * we get just one of those at any time. In 8.4+ recovery, both startup and > ! * bgwriter processes may take restartpoints, so this locking must be strict > ! * to ensure there are no mistakes. > * > *---------- > */ and > --- 5901,5916 ---- > XLogRecPtr recptr; > XLogCtlInsert *Insert = &XLogCtl->Insert; > XLogRecData rdata; > uint32 _logId; > uint32 _logSeg; > TransactionId *inCommitXids; > int nInCommit; > + bool leavingArchiveRecovery = false; > > /* > * Acquire CheckpointLock to ensure only one checkpoint happens at a time. > ! * That shouldn't be happening, but checkpoints are an important aspect > ! * of our resilience, so we take no chances. > */ > LWLockAcquire(CheckpointLock, LW_EXCLUSIVE); > If I've understood the patch correctly, only bgwriter does checkpoints and restart points now? There's a trivial merge conflict in bgwriter.c, due to the FSM patch. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com