X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 82BF811F66DE for ; Sat, 15 Apr 2006 15:09:13 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.116 X-Spam-Level: X-Spam-Status: No, score=0.116 required=5 tests=[AWL=0.116] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id enpeCMhlbjBJ for ; Sat, 15 Apr 2006 15:09:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 3EA8711F6677 for ; Sat, 15 Apr 2006 15:09:09 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k3FI96M06462; Sat, 15 Apr 2006 14:09:06 -0400 (EDT) From: Bruce Momjian Message-Id: <200604151809.k3FI96M06462@candle.pha.pa.us> Subject: Re: Proposed doc-patch: Identifying the Current WAL file In-Reply-To: <20274.1145123863@sss.pgh.pa.us> To: Tom Lane Date: Sat, 15 Apr 2006 14:09:06 -0400 (EDT) CC: Jeff Frost , Richard Huxton , pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200604/15 X-Sequence-Number: 3514 Tom Lane wrote: > Bruce Momjian writes: > > Also, what happens if the log switch happens, and some data change is > > written to the new WAL file in the first second, but nothing happens to > > the database after that for a minute? Your test would still show the > > old log file. > > You seem to be assuming that ls will sort on the basis of the truncated > mtime that it displays, which is not the actual behavior of ls AFAIK. No, I am not: $ touch x1 x2; touch x2 $ sleep 2; ls -lt total 0 -rw-r--r-- 1 root postgres 0 Apr 15 14:04 x1 -rw-r--r-- 1 root postgres 0 Apr 15 14:04 x2 If the write to x2 happens in the first second, but no later writes happen, you still see x1 as first, even though x2 is the new one and might have WAL data in it. The point is that the test does not have a one-second window of showing the wrong answer, meaning I could wait for 60 seconds, and still see the wrong WAL file at the top. -- Bruce Momjian http://candle.pha.pa.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +