Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEoLV-0006wC-Ry for pgsql-bugs@postgresql.org; Thu, 20 Sep 2012 21:31:42 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEoLT-0003Zt-Jk for pgsql-bugs@postgresql.org; Thu, 20 Sep 2012 21:31:41 +0000 Received: from awork2.localnet (p5DDC770F.dip.t-dialin.net [93.220.119.15]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MS0Vu-1T3M1a47EA-00Tfhj; Thu, 20 Sep 2012 23:31:37 +0200 From: Andres Freund Organization: 2ndquadrant.com To: pgsql-bugs@postgresql.org Subject: Re: BUG #7562: could not read block 0 in file "base/16385/16585": read only 0 of 8192 bytes Date: Thu, 20 Sep 2012 23:31:35 +0200 User-Agent: KMail/1.13.7 (Linux/3.6.0-rc6-andres-00066-g2682cc4-dirty; KDE/4.8.4; x86_64; ; ) Cc: Tom Lane , mayank.mittal.1982@hotmail.com References: <25722.1348161317@sss.pgh.pa.us> In-Reply-To: <25722.1348161317@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209202331.35967.andres@2ndquadrant.com> X-Provags-ID: V02:K0:XNXDhimMg+YkrzZJ1D8sPpFbQEXC5ha5gvpqUVTQl3m PZX03XoDPJoDyI2toLy4bJ2fCQfyh1nQr+W7FmP5yWSd6zrh8L gRQr4h6ffVXOxI6VK26oKgkwUBV1uOVbVLD87dSlf7Db3BnCDY p4TWmhGmaUAbVq5CFuW0B3dmBoVwSn3D+iY17JhX0hFxC+WIHO X6TDa1/qQk0TJTHFnkyTjrQWeXmTBsUjFvFj8DpoU9GZu989t2 gz3pPIGG33FNxOUNrK6NSO+ykejeYXt2fi+AdNslTUQXbc1GKo cqTv8JXEXHMySvj8OErTMTqypeF9Yw+JxsSVYzQ3vDklbBnSo1 lPW/prZyH7QFa8y+8Rv3diWWxPCHRvTphysLakWoILUZvhmStH IR4x4xclcoAKQ== X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/234 X-Sequence-Number: 34228 On Thursday, September 20, 2012 07:15:17 PM Tom Lane wrote: > mayank.mittal.1982@hotmail.com writes: > > The following bug has been logged on the website: > > Bug reference: 7562 > > Logged by: Mayank Mittal > > Email address: mayank.mittal.1982@hotmail.com > > PostgreSQL version: 9.1.5 > > Operating system: Debian Linux 6.0 > > Description: > > > > We are using 2 node set-up of PostgreSQL 9.1.5 in which one is master and > > other is slave which is in sync of master with streaming replication. > > The design is in such a way that in case of master node failure the slave > > node has to take master role. I'm controlling this behaviour using > > Corosync and Heartbeat. > > My application is requirement needs heavy database updates. Upon > > fail-over I've noticed that database indexes got corrupted. What kind of indexes are you using? Hash indexes by any chance? As you say downthread the failures are frequent could you provide a bit more details about your setup (including configuration, initial setup etc) and the logs on both machines? > Hmm. There is a fix for a slave-side-index-corruption problem in 9.1.6, > which is due to be announced Monday. I am not certain whether this is > the same thing though; that bug is low-probability as far as we can > tell (it would only happen if the master had been in the middle of an > index page split or page deletion at the instant of failover). Anyway > the first thing to find out is whether 9.1.6 fixes it. I think the likelihood of that bug causing the the index file to be zero bytes - at least thats what I read from $subject - is really, really small: The index would need to be created (setting a proper BM_PERMANENT flag on the meta page), evicted from the buffer cache and thus written to the filesystem, the root page would need to split causing the meta page to be rewritten (this time without a proper BM_PERMANENT) in a very quick succession followed by a OS/HW failure loosing the data already in the OS cache. So, unless I am missing something, I don't see how that can happen. Greetings, Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services