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 1fLEh8-0003Fa-5x for pgsql-hackers@arkaria.postgresql.org; Tue, 22 May 2018 21:19:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fLEh6-0006sO-9m for pgsql-hackers@arkaria.postgresql.org; Tue, 22 May 2018 21:19:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLEh6-0006sE-2S for pgsql-hackers@lists.postgresql.org; Tue, 22 May 2018 21:19:44 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLEh2-0002DS-Pl for pgsql-hackers@postgresql.org; Tue, 22 May 2018 21:19:43 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A3A9B21BEE; Tue, 22 May 2018 17:19:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 22 May 2018 17:19:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=jDxmz3HtMHpL4BFWtSdzIbURn4pCF3L374zSO7yIG1k=; b=VxxHfw1G olNAtXJURZIUgq8siy1ghoXqFuTVEDaTW0yUO8CQeKIAUjcsJ2Y9KzTTkrO5KKEN Ji5HxkviN2Xy3tWEth+JTb4RI3Tvt0NgdY4E19xFDpu83XVnEVxTGjPhEEPIxauy VNA2F1I0ZAw+ujoya/jXpHrz9la7Q9kVM/IiJcWowj+uMZPZPnkdUjFAo2tzOqbr /8w4NrTAv+KvWCJgoyYpUN5BdpJwVkP0865Li+kmgzb+vcFGjrEmtGwPLztZbcJt uY6bZoDVO3X8VsiUueicru0weNgBRvd8XXkrEFLxNntKK5WVhTDYmsvob1426yRw NlWBFdRBgu5g3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=jDxmz3HtMHpL4BFWtSdzIbURn4pCF 3L374zSO7yIG1k=; b=CXr9orqoedBGLVBBJfdzU51YCyr/68KtdeRplRF+Q4zRD Kl/LqwQkpaGPZVEMzoVRzRB+mEbj2Nvoyv91Zcy2l/aMsgIDZ8IvgnQRxFOje4Oq bEevjC8+0QAi020ih5w5QAfS4tQhVnFWl3ZhTpFj8bOIkP7J+4NtAEd2G+gBlCcP ASRV+Y/k7MOlkDO+M2qPxE0j9Fnr+XYCRgcRR4DxY61DMxywIezjkv7STudUtJse uPG5nnd+2V753YRDvNQ4k9KFCYC46WNw5rwgj8uPtMNlKVISKj3KkyItsveaNrSa zlfwJtGxN8OVRPApfD8wuu2Ec3PywA4HAKMzDi07Q== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 373BF10262; Tue, 22 May 2018 17:19:38 -0400 (EDT) Date: Tue, 22 May 2018 14:19:37 -0700 From: Andres Freund To: Paolo Crosato Cc: pgsql-general@lists.postgresql.org, pgsql-hackers@postgresql.org Subject: Re: Error on vacuum: xmin before relfrozenxid Message-ID: <20180522211937.bfotr476fkn3rav6@alap3.anarazel.de> References: <20180522164911.lczs6qsod23tx6eb@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018-05-22 21:43:01 +0200, Paolo Crosato wrote: > > Could you report the result of > > select ctid, xmin, xmax from pg_authid ; > > > > This is the result: > > postgres=# select ctid, xmin, xmax from pg_authid ; > (0,16) | 3031994631 | 0 > 16 | 6496 | 1 | 144 | 3031994631 | 0 | 0 | (0,16) > | 32779 | 10507 | 32 | 1111111111000000 | 675851 | > \x6e6167696f73000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000001000000ffffffff496d64356333633236616163636439616665346437383061396239613464663634653639 > postgres=# select relfrozenxid from pg_class where relname='pg_authid'; > relfrozenxid > -------------- > 400011439 That tuple looks, to me, like it indeed shouldn't exist, given the relfrozenxid. Decoding infomask (10507 / 0x290B), if I did it right, shows: HEAP_HASNULL HEAP_HASVARWIDTH HEAP_HASOID HEAP_XMIN_COMMITTED HEAP_XMAX_INVALID HEAP_UPDATED so it's not frozen. That suggests there's either a bug, or you had corruption in your cluster. Could you give a bit of "history" about that postgres instance? What version of postgres was it run on earliest? Was it ever pg_upgraded? Were there any OS crashes? Other hardware issues? Was the cluster ever used with fsync=off or full_page_writes=off? Greetings, Andres Freund