Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kK84l-0002k0-0B for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Sep 2020 22:44:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kK84i-0001ZJ-DV for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Sep 2020 22:44:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kK84i-0001ZA-3j for pgsql-hackers@lists.postgresql.org; Sun, 20 Sep 2020 22:44:52 +0000 Received: from mail-io1-xd43.google.com ([2607:f8b0:4864:20::d43]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kK84f-0000zh-1F for pgsql-hackers@postgresql.org; Sun, 20 Sep 2020 22:44:50 +0000 Received: by mail-io1-xd43.google.com with SMTP id r25so13531119ioj.0 for ; Sun, 20 Sep 2020 15:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qstzYyygxz+nsbb3ibQf3FXYZ72iwhbVdWagCY9BCg8=; b=WppEuyThpfcWsQooDSDFZuxahPp6BVwYYktpctTz5OJ4ituUKQsqZYamBtPMrf7TuE ltVBDcrzK5MlwNw8GBGhpvZhh/j+KdV2HQ9tsXpQPcBvReFPbJwz8yVLNBcg8EnVKs8N PQmfQW9aKgpU2vb62l5jloKQAUl6Zae/C/tL9Uvzhgdfg22B/1mG5DdD7jXgWYdCrIB2 rgvnE0joKjTWZyx3dOjOHvO8Vk2b4fjR/7KUyUo5rKlQyZsf05M0WNfL4r1QvSf7g2vJ hCEGhaZImgYO98K9uKSw5SgDEH7CBXD4+TAquanOf+jDFTh9eAzmGk8FsdRN6fz1pvr/ wQfA== 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:user-agent; bh=qstzYyygxz+nsbb3ibQf3FXYZ72iwhbVdWagCY9BCg8=; b=hyc0ajC9LO898MxMhaH4JOr/gS0sMApp3QbNzJXOP8kHaW7gyi9qGF+6utzD9Ox2vy rSCIqwZekuecd8Z793iKVwLUU0j/k9DeKao4HyG/EiEJ1tbm4zF7cDU5q48U//8zbvgr 745P3s8NesycfbMheHXr+ASGDTaoNYhI0A6DU/17mo/eNtOI2ZVYcb47nnUgTYgGzpdz ZgLKWJZnH/sZ93cICyJVJ4WEbAbiLThvDmPMV0mAGuysuOie0T9Sth0LXzbIneJsLZaK pHWQJ7n3tCEuEAWWx1251+BBHGtEQihCcoeF24PR6msgbBE9Kajsq/ovYgH4UXVyo62j USlw== X-Gm-Message-State: AOAM5334KQAncdTSeD/N/PS38XQPUAhFTNSG4VByTxvtPAt9QPKcLwKm T0gXlCCm0+F7PuTSXHHtOWgpsQ== X-Google-Smtp-Source: ABdhPJydNFZ61ZhDxMmmAy9fQx85P2UaSb5t0A4r5U71QP/tAIXaKkhkmtDlifoR0YRNN5dWW6yZUA== X-Received: by 2002:a5d:9d5a:: with SMTP id k26mr33650138iok.207.1600641887901; Sun, 20 Sep 2020 15:44:47 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id y7sm5942387ily.58.2020.09.20.15.44.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Sep 2020 15:44:47 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 3C02B800740; Sun, 20 Sep 2020 17:44:46 -0500 (CDT) Date: Sun, 20 Sep 2020 17:44:46 -0500 From: Justin Pryzby To: Tom Lane Cc: Heikki Linnakangas , "Andrey M. Borodin" , Darafei =?utf-8?Q?Kom=D1=8Fpa?= Praliaskouski , Pavel Borisov , Thomas Munro , Michael Paquier , Alexander Korotkov , pgsql-hackers@postgresql.org Subject: Re: Yet another fast GiST build Message-ID: <20200920224446.GF30557@telsasoft.com> References: <7d9158ca-d7cb-88f0-dbbd-1d5cec32b1ae@iki.fi> <8516B6A8-11B2-41A8-B7EB-D0C38ADD06C3@yandex-team.ru> <50e03197-6e75-faec-16dc-41a2a38f080c@iki.fi> <123F5F32-9A85-4D0B-9C7A-1686E6BBE15D@yandex-team.ru> <85df399a-e8a4-2369-f723-fd1a3a872575@iki.fi> <884200.1600634472@sss.pgh.pa.us> <891385.1600636205@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <891385.1600636205@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Sep 20, 2020 at 05:10:05PM -0400, Tom Lane wrote: > I wrote: > > It appears that hyrax (CLOBBER_CACHE_ALWAYS) is not very happy > > with this: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hyrax&dt=2020-09-19%2021%3A27%3A23 > > I reproduced that and traced it to a missing RelationOpenSmgr call. > Fixed now. This also appears to break checksums. postgres=# CREATE TABLE pvactst (i INT, a INT[], p POINT) with (autovacuum_enabled = off); postgres=# CREATE INDEX gist_pvactst ON pvactst USING gist (p); postgres=# INSERT INTO pvactst SELECT i, array[1,2,3], point(i, i+1) FROM generate_series(1,1000) i; WARNING: page verification failed, calculated checksum 34313 but expected 0 ERROR: invalid page in block 0 of relation base/12859/16389 I was able to make this work like so: @@ -449,6 +450,7 @@ gist_indexsortbuild(GISTBuildState *state) /* Write out the root */ PageSetLSN(pagestate->page, GistBuildLSN); + PageSetChecksumInplace(pagestate->page, GIST_ROOT_BLKNO, state->indexrel->rd_smgr); smgrwrite(state->indexrel->rd_smgr, MAIN_FORKNUM, GIST_ROOT_BLKNO, pagestate->page, true); if (RelationNeedsWAL(state->indexrel)) @@ -555,6 +557,7 @@ gist_indexsortbuild_flush_ready_pages(GISTBuildState *state) PageSetLSN(page, GistBuildLSN); + PageSetChecksumInplace(page, state->pages_written, state->indexrel->rd_smgr); smgrextend(state->indexrel->rd_smgr, MAIN_FORKNUM, state->pages_written++, -- Justin