Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyQX6-0000ms-3J for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Apr 2017 22:14:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cyQX5-0007a6-Mx for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Apr 2017 22:14:35 +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 1cyQWL-0006Hb-3C for pgsql-bugs@postgresql.org; Wed, 12 Apr 2017 22:13:49 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cyQWG-0007Lz-QJ for pgsql-bugs@postgresql.org; Wed, 12 Apr 2017 22:13:46 +0000 Received: from localhost (localhost [127.0.0.1]) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTP id F09E580329; Thu, 13 Apr 2017 10:13:31 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at cat-porwal-prod-mail1.servers.catalyst.net.nz Received: from cat-porwal-prod-mail1.catalyst.net.nz ([127.0.0.1]) by localhost (cat-porwal-prod-mail1.servers.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OgyWtwWwqjyt; Thu, 13 Apr 2017 10:13:30 +1200 (NZST) Received: from [192.168.1.64] (222-152-213-179.jetstream.xtra.co.nz [222.152.213.179]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id AF61480324; Thu, 13 Apr 2017 10:13:30 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catalyst.net.nz; s=catalyst; t=1492035210; bh=1R3+Pw1C7cHT3AVoLGFABJU61lh/Lxy1w02gEqJv9pI=; h=Subject:To:References:From:Date:In-Reply-To; b=LEwsPmpaWSBZB1YwZWpe0UyvJ4G5SnpC21kc93efeVAabQR0XZWL2NIQHubUkI5RP 4AUlSKqIGOHfqoaVt65KRBbUueNGhritYiQPEGZ3thcy8JDALJlVIU0ANbwYNQGRgX XBg+ZeJcNZm+Al3n+4vnSa1kLc8vOeucVrYPA+r8= Subject: Re: Missing PRIMARY KEYs and duplicated rows To: Chris Pacejo , pgsql-bugs@postgresql.org References: From: Mark Kirkwood Message-ID: <7c077ec8-7dcb-9e92-09f3-8890ecd2bc9e@catalyst.net.nz> Date: Thu, 13 Apr 2017 10:13:30 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.3 (----) 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 On 13/04/17 08:46, Chris Pacejo wrote: > Hi all, we're encountering a very strange issue lately on a 9.4.5 server. > > We recently performed a dump & restore of the entire cluster to > migrate to a new server. All but one of the databases seem fine. > That one is encountering a very strange issue. > > It seems that periodically, the primary keys (and underlying indexes) > of all tables in the database disappear, and every row in each table > gets duplicated. This appears to occur at the storage level, as the > duplicated rows get their own ctids (so it's not just a query > artifact). I've seen this happen twice in the past week. > > I can delete the duplicate rows (by their ctid). In the first > instance, I was unable to re-add the primary key, as it had reappeared > by the time I issued the statement. In the most recent instance, I > did re-add the primary key to a table, and the other primary keys have > not yet re-appeared. > > All indexes are b-tree indexes. They were not created using > CONCURRENTLY. They are in the default tablespace. The installation > is on an Intel CentOS machine using the PGDG RPMs. I've checked the > release notes for all 9.4 bugfixes and do not see anything which could > relate to this issue. > > Any insight into this issue? We will probably just drop and recreate > the database from the recent dump, as it is on a production server and > we'd rather not take chances tinkering around with it. But it would > be nice to know why/how we've encountered this to ensure it won't > happen again, because frankly it's quite a scary issue. > > I'd be inclined to suspect the hardware with weird behaviour like that (memory and disk errors in particular). Cheers Mark -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs