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 1f3ge7-00012v-I2 for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Apr 2018 11:32:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f3ge6-0005dZ-Aw for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Apr 2018 11:32:06 +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 1f3ge6-0005dQ-4w for pgsql-bugs@lists.postgresql.org; Wed, 04 Apr 2018 11:32:06 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f3ge3-0003YN-SH for pgsql-bugs@lists.postgresql.org; Wed, 04 Apr 2018 11:32:05 +0000 Received: by mail-wm0-x244.google.com with SMTP id t67so20333777wmt.0 for ; Wed, 04 Apr 2018 04:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=8NGbZVlP2oKW3K8TETChqvbgsm2mbYVm9G3Ai4eiYV0=; b=GKben8cEjHPg2d5t5U5KYU8AjgxvYNQQBnZKtGSZcU7TfEhROYluJJdR4HWQqXSgqu 53ICVcuSfVkkWAzMdyPeRH664kUkCJWzB3x6ezHMec+OTmAgMVPGJ6/VexuHB6eSLcsJ /U4MCV/Pja1+NW80DBh0hXc6x9q03c9XHqIya/DLE3WBJZqeJ5J3EZGTH+vfknPKX4xC 4iAUsNpniYmO0qXy+hg6F3IoY54ft18jgcOTLNqhCBXdOZ3a5PVFGsPWi0esfs93UWUR DFDrOLoq1Cy4jK6pE6DGnLcV8vKp/MB/QnRS63mU3hUTRk+vN5tDdePwCEgoo7/LZArw 8nmg== 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-transfer-encoding :content-language; bh=8NGbZVlP2oKW3K8TETChqvbgsm2mbYVm9G3Ai4eiYV0=; b=eRkBVb0b0PUJ5KmqfOa5bU9TkMxTTmjtsOxSW4FCoYH1kDDRrvmc8C9TSPWHrVpPSC Un9X4c2hWiVsXo7yQh3wPs+8fqW8xgwGu6S3qXxxECB45lGZ8yUXxqoKaJcQmrMVs6mf 4almnztiEC4jR3NCRWclq7diCJAEjDFtPdlH0meomKmpViYlsBizHP3Cd86EP76XBAfn RN+R7/GAxlq+9Y2IcZa17zUnPgeKDuvN6wMHyPSxFBXKw1He/vXnojsobVJ0VPTs7F46 xuCKOirDQnA/ZAwvBx7pONKt86RsZNdWvDlif7X61qYcErki8LG5q+JuFnwlitZ7ammG nc6A== X-Gm-Message-State: ALQs6tC7+SPTFDnHbmNh1CvsEdcASGQPKNQ5et6sA/WICBC4SSalwKjY Bvt81Fhb9B7xJKlcmsMSp+lSkB9v X-Google-Smtp-Source: AIpwx4/Pd5FSZk+wqhqFsDvhS5RRNw7opvGwF8E8ko45r4WXAd1MPNVFq4j03f5rHz1gLVXVUoqKNw== X-Received: by 10.46.128.16 with SMTP id j16mr11603965ljg.26.1522841522034; Wed, 04 Apr 2018 04:32:02 -0700 (PDT) Received: from [192.168.0.69] ([91.217.67.2]) by smtp.gmail.com with ESMTPSA id q24-v6sm966740lff.14.2018.04.04.04.32.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 04:32:01 -0700 (PDT) Subject: Re: BUG #15142: ERROR: MultiXactId nnnnn has not been created yet -- apparent wraparound in v9.5 To: Tomas Vondra , 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> <328d9db3-f293-f59f-5cc7-daa5223a733b@2ndquadrant.com> From: molofeev Message-ID: <9fc8fe69-08d3-a945-0483-7c532d78c25e@gmail.com> Date: Wed, 4 Apr 2018 14:31:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <328d9db3-f293-f59f-5cc7-daa5223a733b@2ndquadrant.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Query: select * from TABLE_NAME where ctid between '(0,1)'::tid and '(1,1)'::tid; return ERROR:  MultiXactId 1048586 has not been created yet -- apparent wraparound Tuple #161 has ctid = (3220145, 81) On 04/04/2018 12:22 PM, Tomas Vondra wrote: > 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 >