Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j2Zun-0005Qb-I3 for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Feb 2020 12:17:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j2Zul-0001Mv-BV for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Feb 2020 12:17:47 +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_SHA1:256) (Exim 4.89) (envelope-from <9erthalion6@gmail.com>) id 1j2Zul-0001Mn-00 for pgsql-hackers@lists.postgresql.org; Fri, 14 Feb 2020 12:17:47 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1j2Zue-0000AP-C4 for pgsql-hackers@postgresql.org; Fri, 14 Feb 2020 12:17:46 +0000 Received: by mail-wr1-x441.google.com with SMTP id r11so10635654wrq.10 for ; Fri, 14 Feb 2020 04:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gf4fJjEe0NNcVIPAag5SGy5Xum847SZbYbHu0z1daCo=; b=W8lHybtfxynjXLDhJZLb4VQ9bLbtY8QaICYerulAR4x6PyII0Y9Ic4xE/OvAuTDpbV ssbhv7UOERMOIseLimeDapWAVzvqHPo1XkNcWz4VecgzAY5DYCTwt4w+pnQj7ZkZwZRI dZRadClxLIi0OLYzA+wLwTlFpucf2FCscLtg9+NITW71tXmDK0wTUTQEYahg50AJ0Iud soBuKwAqLqjCW31cOwb3WgtJCqsT89q9398Q9jeLlKSA5AQpACUacB20YdzdsHOz7f9W lYf/5rZV9WTr6FgttuohIC8E/ihVYubMZAlgluaCyY7wIL+94H87HHvpkCBVbQVMXduy 2/PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gf4fJjEe0NNcVIPAag5SGy5Xum847SZbYbHu0z1daCo=; b=sFY45vS6wXLGg4g7m+wxaylrMx5ReszaDmCFm5FUZZuNwkw17REC414B2qJFEXAmGL xr2Z+qHJaoYbaQMOawvO1bRUJ+h2J8tdxuX0ctGaVis9lFgtnuzhQPK+Wlgu/eVx/Q2n 8TpaQ7NEWZ7a2GRDvosB04iBIV3FvtLRLZwPiDchWO0ZI5vs9tinMff4A7W4fXNZ4FZ/ VMcLERJV/U+6YzysLr3iIzfy9u5RXu7VK7iEBW/LnwG8b9+wtXT74NdWspovduh8Udf9 myE6tl4D1fvIQu4jhlm+CDzZO8LzTmfAYTq3+lEv+etnkyK9AO7FKRHAZnqqRGqjOd58 rtyQ== X-Gm-Message-State: APjAAAW2fGgitqrREYv6PSRF5t8Tj/EyJAfIrSW+6jSuO/xUnglW+e9A xcHaaetnBoW4804g1rRNGPI= X-Google-Smtp-Source: APXvYqxrzK9Xy1VxJj6tsVeATaEfmP8AjM70xYB2dh9bHUWZN36nvCiucnQbDzSJ4u5KgNMV3eOBUQ== X-Received: by 2002:adf:e88f:: with SMTP id d15mr3674938wrm.186.1581682658659; Fri, 14 Feb 2020 04:17:38 -0800 (PST) Received: from localhost ([185.85.220.202]) by smtp.gmail.com with ESMTPSA id p12sm6398389wrx.10.2020.02.14.04.17.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2020 04:17:37 -0800 (PST) Date: Fri, 14 Feb 2020 13:18:20 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Kyotaro Horiguchi Cc: tomas.vondra@2ndquadrant.com, florisvannee@optiver.com, pg@bowt.ie, jesper.pedersen@redhat.com, david.rowley@2ndquadrant.com, alvherre@2ndquadrant.com, thomas.munro@gmail.com, jtc331@gmail.com, rafia.pghackers@gmail.com, jeff.janes@gmail.com, bhushan.uparkar@gmail.com, pgsql-hackers@postgresql.org, a.korotkov@postgrespro.ru Subject: Re: Index Skip Scan Message-ID: <20200214121820.xvvrkdbykkygfs65@localhost> References: <20200206.212220.642002310227620136.horikyota.ntt@gmail.com> <20200207162543.zlj2tvcwy7jku6vu@localhost> <20200208131159.5sjcbcjnwdj4q7fa@development> <20200214.172313.259958375378013155.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214.172313.259958375378013155.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Fri, Feb 14, 2020 at 05:23:13PM +0900, Kyotaro Horiguchi wrote: > The first attached (renamed to .txt not to confuse the cfbots) is a > small patch that makes sure if _bt_readpage is called with the proper > condition as written in its comment, that is, caller must have pinned > and read-locked so->currPos.buf. This patch reveals many instances of > breakage of the contract. Thanks! On top of which patch version one can apply it? I'm asking because I believe I've addressed similar issues in the last version, and the last proposed diff (after resolving some conflicts) breaks tests for me, so not sure if I miss something. At the same time if you and Tomas strongly agree that it actually makes sense to make moving forward/reading backward case work with dead tuples correctly, I'll take a shot and try to teach the code around _bt_skip to do what is required for that. I can merge your changes there and we can see what would be the result.