Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b8phN-00067k-MN for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jun 2016 14:03:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b8phN-0007RZ-9I for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jun 2016 14:03:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b8m2Y-0007ht-9y for pgsql-bugs@postgresql.org; Fri, 03 Jun 2016 10:09:18 +0000 Received: from dub004-omc4s19.hotmail.com ([157.55.2.94]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b8m2U-0007hc-SX for pgsql-bugs@postgresql.org; Fri, 03 Jun 2016 10:09:17 +0000 Received: from DUB126-W5 ([157.55.2.73]) by DUB004-OMC4S19.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 3 Jun 2016 03:09:12 -0700 X-TMN: [sEZ6Cs3Ma/UPoaRSKfQJNKWzv+s/7E75] X-Originating-Email: [timofeid@outlook.com] Message-ID: Content-Type: multipart/alternative; boundary="_a1da9fac-9bd6-4637-8c2b-0aa568e6414c_" From: Timofei Dynikov To: Andres Freund , Michael Paquier CC: PostgreSQL mailing lists Subject: Re: BUG #14171: Wrong FSM file after switching hot standby to master Date: Fri, 3 Jun 2016 13:09:11 +0300 Importance: Normal In-Reply-To: <20160602144232.33gyusj2dekzk7cp@alap3.anarazel.de> References: <20160601134819.30392.85324@wrigleys.postgresql.org>,,<20160602144232.33gyusj2dekzk7cp@alap3.anarazel.de> MIME-Version: 1.0 X-OriginalArrivalTime: 03 Jun 2016 10:09:12.0821 (UTC) FILETIME=[FA4B9A50:01D1BD7F] X-Pg-Spam-Score: -1.6 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --_a1da9fac-9bd6-4637-8c2b-0aa568e6414c_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable > Date: Thu=2C 2 Jun 2016 07:42:32 -0700 > From: andres@anarazel.de > To: michael.paquier@gmail.com > CC: timofeid@outlook.com=3B pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #14171: Wrong FSM file after switching hot standb= y to master >=20 > On 2016-06-02 16:42:35 +0900=2C Michael Paquier wrote: > > > Sometimes we have troubles with fsm-files. In case: > > > =95 master instance is switching to another node(failover or switcho= ver) on > > > highload > > > =95 Hot standby node restart and run as master succesfully. > > > =95 After that we sometimes get FSM files pointing to non-existent b= locks in > > > the table=2C so subsequent insert operations on such tables fails wit= h error > > > message like following: 'could not read block XX in file "base/YYYY/Z= ZZZZ"'. > > > The issue can be resolved by either deleting of wrong FSM file (while > > > database is stopped) or performing VACUUM FULL on erroneous table. Th= e > > > problem is usually observed on relatively small tables (e.g. up to 30 > > > blocks) which are often cleaned out (having most rows deleted). > > > Does anybody already faced such behavior? What can be the root cause = of such > > > problems? Are there any recommendations on how to avoid them? > >=20 > > Andres=2C do you think that c6ff84b0 can help here? Those symptoms look > > rather similar to some missing invalidation messages on the standby. >=20 > If there was a restart involved=2C it seems unlikely that that'll be > relevant. Timofei=2C do I understand correctly that the problem persists > across restarts? >=20 > Regards=2C >=20 > Andres Yes=2C problem persists across restarts. We can resolve problem only by per= forming VACUUM FULL or delete inconsistent FSM file. Regards=2CTimofei Dynikov=20 = --_a1da9fac-9bd6-4637-8c2b-0aa568e6414c_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
>=3B Date: Thu=2C 2 Jun 2016 0= 7:42:32 -0700
>=3B From: andres@anarazel.de
>=3B To: michael= .paquier@gmail.com
>=3B CC: timofeid@outlook.com=3B pgsql-bugs@postgre= sql.org
>=3B Subject: Re: [BUGS] BUG #14171: Wrong FSM file after swit= ching hot standby to master
>=3B
>=3B On 2016-06-02 16:42:35 +09= 00=2C Michael Paquier wrote:
>=3B >=3B >=3B Sometimes we have trou= bles with fsm-files. In case:
>=3B >=3B >=3B =95 master instance = is switching to another node(failover or switchover) on
>=3B >=3B &g= t=3B highload
>=3B >=3B >=3B =95 Hot standby node restart and run= as master succesfully.
>=3B >=3B >=3B =95 After that we sometime= s get FSM files pointing to non-existent blocks in
>=3B >=3B >=3B = the table=2C so subsequent insert operations on such tables fails with erro= r
>=3B >=3B >=3B message like following: 'could not read block XX = in file "base/YYYY/ZZZZZ"'.
>=3B >=3B >=3B The issue can be resolv= ed by either deleting of wrong FSM file (while
>=3B >=3B >=3B data= base is stopped) or performing VACUUM FULL on erroneous table. The
>= =3B >=3B >=3B problem is usually observed on relatively small tables (e= .g. up to 30
>=3B >=3B >=3B blocks) which are often cleaned out (h= aving most rows deleted).
>=3B >=3B >=3B Does anybody already face= d such behavior? What can be the root cause of such
>=3B >=3B >=3B= problems? Are there any recommendations on how to avoid them?
>=3B &g= t=3B
>=3B >=3B Andres=2C do you think that c6ff84b0 can help here? = Those symptoms look
>=3B >=3B rather similar to some missing invalid= ation messages on the standby.
>=3B
>=3B If there was a restart = involved=2C it seems unlikely that that'll be
>=3B relevant. Timofei= =2C do I understand correctly that the problem persists
>=3B across re= starts?
>=3B
>=3B Regards=2C
>=3B
>=3B Andres

= Yes=2C problem persists across restarts. We can resolve problem only by per= forming VACUUM FULL or delete inconsistent FSM file.


Regards=2C=

Timofei Dynikov


= = --_a1da9fac-9bd6-4637-8c2b-0aa568e6414c_--