Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flEHn-0004fe-10 for pgsql-general@arkaria.postgresql.org; Thu, 02 Aug 2018 14:09:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flEHl-0007Xx-8r for pgsql-general@arkaria.postgresql.org; Thu, 02 Aug 2018 14:09:01 +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.89) (envelope-from ) id 1flEHk-0007Xq-Oh for pgsql-general@lists.postgresql.org; Thu, 02 Aug 2018 14:09:01 +0000 Received: from smtp34.i.mail.ru ([94.100.177.94]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flEHg-0001pT-Ac for pgsql-general@postgresql.org; Thu, 02 Aug 2018 14:08:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:References:Reply-To:To:From:Subject; bh=skip3C6+tXOaRFMwaYWuSXOKOyO6hVp24zqwXKyBsHg=; b=dafDUMoZodoxHIouaRgSEisHu7a1gDgXtOwdWJA/+b0WE31H4yOcg7r2SzE58efGRJwzuvthhkslm0YH51eO9eHaXogir8Qe+DxzhARcABkd+4/2wX6oqmPYGcC6tUqAvSJf5DQQgVYckcL12NslBivhDQKT5ciQpc9GEPVvMNM=; Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1flEHc-000204-3d for pgsql-general@postgresql.org; Thu, 02 Aug 2018 17:08:52 +0300 Subject: Re: ERROR: found xmin 54230249 from before relfrozenxid 61349053 From: rihad To: pgsql-general General Reply-To: rihad References: <8a43c0c2-8e1b-2ffa-89e1-83978db7e3cd@mail.ru> Message-ID: <01d83080-83ef-ada4-1581-17cca5b3d9a4@mail.ru> Date: Thu, 2 Aug 2018 18:08:49 +0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8a43c0c2-8e1b-2ffa-89e1-83978db7e3cd@mail.ru> Content-Type: multipart/alternative; boundary="------------68621C3B6981B4A47D21941B" Content-Language: en-US Authentication-Results: smtp34.i.mail.ru; auth=pass smtp.auth=rihad@mail.ru smtp.mailfrom=rihad@mail.ru X-7FA49CB5: 0D63561A33F958A5C71CAF80FA70A17601F2536A53BD61287065B419536C65008941B15DA834481F8AA50765F790063783E00425F71A4181389733CBF5DBD5E9B5C8C57E37DE458B4DA2F55E57A558BE49FD398EE364050F4B6963042765DA4BBA3038C0950A5D36B5C8C57E37DE458B4C7702A67D5C33162DBA43225CD8A89F890A246B268E114EEDB1088E9FA99F9C4F7908B91599AEE243847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148F53FDB0A1CE3EC88B3B503F486389A921A5CC5B56E945C8DA X-Mailru-Sender: B19AB4DAF1EA2FB5E3D61D0EC887F74FB54CC5FF83EDCE8470C1E17AA7329077A033CBB7CDB34F37ABBFE0CF075BC50BFB559BB5D741EB96004FA9CEFBA991DA3A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------68621C3B6981B4A47D21941B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 08/02/2018 05:34 PM, rihad wrote: > On 08/02/2018 04:38 PM, rihad wrote: >> Hi all. We see such errors on one of our own (non-system) tables on >> Postgres 10.3. They stop both automatic vacuum & automatic analyze >> not only on that table, but on all tables & databases (manual >> vacuuming works though). Luckily it's a small (but important) table - >> less than 1000 rows. Any quick way of fixing it with no downtime? >> Thanks. >> > > BTW, it's a materialized view, not a table. "refresh materialized view > concurrently" is being run on it regularly, but apparently doesn't fix > the problem. > > Answering to myself: this probably relates to this issue: https://www.postgresql.org/docs/9.4/static/release-9-4-17.html * Repair pg_upgrade's failure to preserve relfrozenxid for materialized views (Tom Lane, Andres Freund) This oversight could lead to data corruption in materialized views after an upgrade, manifesting as "could not access status of transaction" or "found xmin from before relfrozenxid" errors. The problem would be more likely to occur in seldom-refreshed materialized views, or ones that were maintained only with REFRESH MATERIALIZED VIEW CONCURRENTLY. If such corruption is observed, it can be repaired by refreshing the materialized view (without CONCURRENTLY). Fixed on 2018-03-01, so the bug existed not only for 9.4.17, but for all major versions too. --------------68621C3B6981B4A47D21941B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On 08/02/2018 05:34 PM, rihad wrote:
On 08/02/2018 04:38 PM, rihad wrote:
Hi all. We see such errors on one of our own (non-system) tables on Postgres 10.3. They stop both automatic vacuum & automatic analyze not only on that table, but on all tables & databases (manual vacuuming works though). Luckily it's a small (but important) table - less than 1000 rows. Any quick way of fixing it with no downtime? Thanks.


BTW, it's a materialized view, not a table. "refresh materialized view concurrently" is being run on it regularly, but apparently doesn't fix the problem.


Answering to myself: this probably relates to this issue:

https://www.postgresql.org/docs/9.4/static/release-9-4-17.html

  • Repair pg_upgrade's failure to preserve relfrozenxid for materialized views (Tom Lane, Andres Freund)

    This oversight could lead to data corruption in materialized views after an upgrade, manifesting as "could not access status of transaction" or "found xmin from before relfrozenxid" errors. The problem would be more likely to occur in seldom-refreshed materialized views, or ones that were maintained only with REFRESH MATERIALIZED VIEW CONCURRENTLY.

    If such corruption is observed, it can be repaired by refreshing the materialized view (without CONCURRENTLY).


Fixed on 2018-03-01, so the bug existed not only for 9.4.17, but for all major versions too.

--------------68621C3B6981B4A47D21941B--