Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 5A7A71FFFD21 for ; Tue, 3 Jul 2012 13:40:28 -0300 (ADT) Received: from moutng.kundenserver.de ([212.227.126.171]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sm69L-00035X-Rl for pgsql-admin@postgresql.org; Tue, 03 Jul 2012 16:40:28 +0000 Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M6yZd-1RrxK74BiX-00xI3x; Tue, 03 Jul 2012 18:40:07 +0200 Message-ID: <4FF32066.5070000@2ndQuadrant.com> Date: Tue, 03 Jul 2012 12:40:06 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: Rob Cowell CC: "'pgsql-admin@postgresql.org'" Subject: Re: replication recovery/startup question References: <1SjBRT-0000RM-TA@eq1.mail.transversal.net> In-Reply-To: <1SjBRT-0000RM-TA@eq1.mail.transversal.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:vMvvxr6A8vx4OU4aoy2EO3ItnT4DhgnARyJYj6lbL7Z M9YZNQ2UR4mHl5AcKWu9LY9EPwk81VMTE7WEXeMsaUt0O1JpqF 4KQ4tFWlWwX61Sk1TCe2fumbT8HMHdXTa+GspigL7nHDvGyA/v o6bhAYud9Cr/+W7HxDuNjrfUS0CONX3d+v0vWS/vDtvxEUSYv8 mnW9Age4QcBRMpPRxwxIoNY+Ul+Aq4UJu6Qgh+QteBviGU+AYz 0TOtTOB0HZMQwRnmTKuIk9VMKQO6oo5+qaPP/99+BYIRUccYhF /rMqAYDTstpMgwppcwKeJyPLvV14wtsyDUm/0OSq4DPdnBj7Re nKTuabAaPyjUqbURWFAg= X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/9 X-Sequence-Number: 39726 On 06/25/2012 11:40 AM, Rob Cowell wrote: > Why would the output from ‘ls’ show older filenames (0....1....3D...xx) > as newer in date than the “0....1....3F...xx” filenames? > > Does Postgres re-cycle old log filenames ? It recycles old log files. If you turn on log_checkpoints, you can see how many and how often. It will list a count of recycled WAL files at each checkpoint, along with how many of the old ones were just deleted instead. The weird pattern in the timestamps you're seeing is a state in the middle of doing that, and yes they look quite weird sometimes. The files are noteed as reusable, get re-initialized to hold new data (they're not overwritten completely with zeros like new WAL files are), and renamed to a new segment number. And each of those steps has a corresponding flush to disk step which makes sure the filesystem metadata is updated. Some of the middle states there are unusual. > Does the output from ‘ps’ mean the master/slave are in sync, or is the > slave really still playing catchup (based on the names of the logfiles > in pg_xlog) ? Your example was in sync, with the file names just being odd due to the implementation of WAL file recycling. You might also check pg_stat_replication to get an easier view of things, rather than relying on ps. ps is correct, it's just harder to check. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com