Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3ecp-000061-I3 for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Apr 2018 09:22:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f3eco-000219-Di for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Apr 2018 09:22:38 +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 1f3ecn-000210-RM for pgsql-bugs@lists.postgresql.org; Wed, 04 Apr 2018 09:22:38 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f3ecj-0000vX-PW for pgsql-bugs@lists.postgresql.org; Wed, 04 Apr 2018 09:22:36 +0000 Received: by mail-wm0-x242.google.com with SMTP id i3so16724978wmf.3 for ; Wed, 04 Apr 2018 02:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=65952+yYVeVjFct6TagFDrihRDuSJ9gx0G2hs6yWulk=; b=bpZoMXWg7FcKwtVhRYe+/fUhiTnjZJmXDMH/lSH+/CSccZry6jJeW02R/KKL4gMn0V ddn0Rt3bBgRulzpKcA2m+a8E3s8xIffg/XSMgoebmxLZNkpkMqVZmdiYZJNhOETQNtGG DqOQyQEYOAqOnqhQV2MWF7u/yRxH8DTDASmypyK5u2Ntm8KxdwvxJe6JxRSx/eLefaT4 Uovi4vK7PprUEC801976GiaMNIHtTdTs/bW9ziv11rHYVrGJXUfyxw3E5euPSpOT8ENU +cmNNpPM3yJTLqv1M/dZtCIXdtxpmMYPMkGpDRzRA+ekIHtN0MwwKzm3o+gwqHZc9IPs NSnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=65952+yYVeVjFct6TagFDrihRDuSJ9gx0G2hs6yWulk=; b=bVTz0wns4w8m+hjNyfTaDa7wQ4KjmnZ0Tb2g5aaIMbryNvhqQMPUDIZk84MEQD0f/S bxevxF4oMuI0rMVxiS072Z5fqg9RekDjNx+eVH7LrZ0Mi9dptKTFJYIG91D2EBwwTkD2 ImkaZIpmmssXpXzP3S2lkJshjDnd0Lv5EqjMEm2L3si4RsPyGDI3ftmTicBOvULV45Um Nbl4+8ZtTnr1JGNda9z8f8S0AxOAl5FebXb77Q4NL9h1uCW3h5lRVzRaXB581shg4G/F hh4ryemFtfbf6ArfhsrwOAZMOD1bd9pL3wajv1590vSSSitqVwxhSL1mMwOfahBeeLZ+ YlvQ== X-Gm-Message-State: ALQs6tDpkuBulRmJ2KfKsTQ9sKhcKfzcG4KET59830/fOI4zNX2JhTIN kwdqQh3KFHktUTI7TqN7orIMbawF2WXRVGU8nbJP+X1RTxGCyM9zbe+7B46jbmTPUHwucthxWHH 6pkbIfzBSrJ5GYWJAD02XeDCYHLVDf62efXQWYoPBMW7zbcChSLfzbozUi0JJdLxlK3DhvwkLQO 24Ssiw3s7zA209 X-Google-Smtp-Source: AIpwx4+6jtTQvmKhkGfBNBzMMJ4Di8NAI7qxuMAXsnfPlZdQ4ZLocjrr7CCfAiu7U2LqTcqBXJr6lg== X-Received: by 10.28.50.130 with SMTP id y124mr6151461wmy.22.1522833751415; Wed, 04 Apr 2018 02:22:31 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id f54sm5146191wra.80.2018.04.04.02.22.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 02:22:28 -0700 (PDT) Subject: Re: BUG #15142: ERROR: MultiXactId nnnnn has not been created yet -- apparent wraparound in v9.5 To: molofeev , Alvaro Herrera Cc: pgsql-bugs@lists.postgresql.org References: <20180403132319.e2wtdc26ks54qbqt@alvherre.pgsql> <8883c05f-a737-5a14-301b-06d469ff9853@gmail.com> <957ebcc3-26c9-3ddd-f430-904d9a55505f@gmail.com> From: Tomas Vondra Message-ID: <328d9db3-f293-f59f-5cc7-daa5223a733b@2ndquadrant.com> Date: Wed, 4 Apr 2018 11:22:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <957ebcc3-26c9-3ddd-f430-904d9a55505f@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/04/2018 10:20 AM, molofeev wrote: > Any ideas? > > > On 04/03/2018 04:36 PM, molofeev wrote: >> The last query that working is - select * from TABLE_NAME limit 1 >> offset 160; >> >> the next query >> >> select * from TABLE_NAME limit 1 offset 162; >> >> return - ERROR: MultiXactId 1048586 has not been created yet -- >> apparent wraparound >> SQL state: XX000 >> Well, as Alvaro mentioned, we need to see the page that contains the record with that multixactid. You now know which table it is, and you know it's tuple #162. We still don't know which page is it exactly, but you can determine that by using CTID: select * from TABLE_NAME where ctid between '(13,1)'::tid and '(14,0)'::tid; You'll need to start on page 0 and increase it until you get the error again. This will scan the whole table, though. Then you know which page has the broken data, and you can inspect it using pageinspect - extract it using raw_page, inspect it using various functions in that extension. I don't know how sensitive the data in that table is, but perhaps you may share the 8kB page. FWIW this seems to be some sort of data corruption, where the XID got overwritten by a bogus value in some way. The bigger question is how many other such cases are there. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services