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 1fxfjw-0003p1-T2 for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Sep 2018 21:53:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxfjv-0002Wd-5a for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Sep 2018 21:53:31 +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 1fxfju-0002WV-Sg for pgsql-hackers@lists.postgresql.org; Wed, 05 Sep 2018 21:53:30 +0000 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxfjr-0008Dm-9b for pgsql-hackers@postgresql.org; Wed, 05 Sep 2018 21:53:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1536184407; x=1567720407; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=iG5LR872O1SKomnaticNJmyfXD4jrREbd2nN1jDtqmI=; b=L2slKZT5SwSqz5BpI0sslykogFR1g2kqHIuz7Emn900U+8z+ab42ZTL5 dCB21yeIEH8zi+v5xHzQq8qn8NIy/L1duaTVDysPweBlPDgdha7pYENWQ XlitzEt5vGIb1Wv8OWXSULBcm7EJrfRwtGPrN3lsXlXxx5Oq8PYc75QID I=; X-IronPort-AV: E=Sophos;i="5.53,334,1531785600"; d="scan'208";a="757090115" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1d-f273de60.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Sep 2018 21:50:52 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-f273de60.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w85LmxcD029597 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 5 Sep 2018 21:49:06 GMT Received: from EX13D08UWB003.ant.amazon.com (10.43.161.186) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 5 Sep 2018 21:49:05 +0000 Received: from EX13D08UWB001.ant.amazon.com (10.43.161.104) by EX13D08UWB003.ant.amazon.com (10.43.161.186) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 5 Sep 2018 21:49:05 +0000 Received: from EX13D08UWB001.ant.amazon.com ([10.43.161.104]) by EX13D08UWB001.ant.amazon.com ([10.43.161.104]) with mapi id 15.00.1367.000; Wed, 5 Sep 2018 21:49:05 +0000 From: "R, Siva" To: Alexander Korotkov , "sawada.mshk@gmail.com" CC: pgsql-hackers Subject: Re: Bug in ginRedoRecompress that causes opaque data on page to be overrun Thread-Topic: Bug in ginRedoRecompress that causes opaque data on page to be overrun Thread-Index: AQHURITWziSocye1S0ygUmXh1SVXsaTgquEAgAANUlGAALPkAIAAJPwAgAAo8QCAAHJWAIAACpEY Date: Wed, 5 Sep 2018 21:49:05 +0000 Message-ID: <1536184145340.65860@amazon.com> References: <1536091151804.6588@amazon.com> <1536101117759.63175@amazon.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.162.43] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Precedence: Bulk List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Sep 5, 2018 at 08:55 PM, Alexander Korotkov wrote:=0A= > Finally I managed to reproduce the bug. The scenario is following.=0A= > Underlying idea is that when insertion of multiple tuples goes to the=0A= > beginning of the page and this insertion succeed only thanks to=0A= > collapse of some short segments together, then this insertion wouldn't=0A= > fit to the page if given alone.=0A= =0A= Sorry for the late reply.=0A= Thank you so much for working on this and reproducing the issue!=0A= Like you mentioned, the WAL record where we detected this problem=0A= has future segments deleted due to compaction and written out=0A= as an insert segment.=0A= =0A= > alter index test_idx set (fastupdate =3D on);=0A= Just curious why does this help with the repro? This is related to only=0A= using the Gin pending list vs the posting tree.=0A= =0A= I will try to reproduce the issue with the above workload and=0A= also test the fix with the same and report back.=0A= =0A= On Wed, Sep 5, 2018 at 5:24 PM, Masahiko Sawada wro= te:=0A= > Hmm, could you share the sequence of what kind of WAL has applied to=0A= > the broken page? I suspect the segment list contains=0A= > GIN_SEGMENT_REPLACE before GIN_SEGMENT_INSERT.=0A= =0A= These are the segment operations on the WAL in sequence:=0A= - 1 Replace action on segment N=0A= - 5 Insert actions after segment N - the 5th insert action is essentially= =0A= replacing the last 3 remaining segments with a new one.=0A= - 3 delete actions on the remaining segments.=0A= =0A= Best=0A= Siva=0A=