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 1kxkcI-00025t-4R for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jan 2021 05:47:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxkcH-00018b-1V for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jan 2021 05:47:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxkcG-00018U-Kb for pgsql-hackers@lists.postgresql.org; Fri, 08 Jan 2021 05:47:16 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kxkcB-0006bQ-TK for pgsql-hackers@lists.postgresql.org; Fri, 08 Jan 2021 05:47:15 +0000 Received: by mail-pj1-x102b.google.com with SMTP id m5so5544356pjv.5 for ; Thu, 07 Jan 2021 21:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=KJwzUbKavMDxSi7FUAQaNeGkoEPVRlFmFSxyLpklKzQ=; b=con18zS+/GnFclJ836VsGvokLK4YFQShDmwp6Y/R49IRLjIkOHpOEOhXNtF0aujGC1 Th/LvBrLOUt7EUC0LSjrorsMqVJJOjFbg8baehGxZwhdxmi/h5u2HtOaaI6mu5QDb5A7 qhoWLF8UlZNkvNTLruzZcir2U7C07B2L1DGXUL6SoL2u9gGttN+/3Ipu1oC2lM1vtLN/ /FnzuknuXUb0oyUvPOnRHU/0+UdhleFHjB3GXzPng/akwt9sVg6LFpz/Qu9HhpR+lxiM y4SUxjWNEp0ust8T933aPILR2/BZLi5NOi/YX+lHThwSwoIL3ZheDOnpvMno7ESX99QV yMYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=KJwzUbKavMDxSi7FUAQaNeGkoEPVRlFmFSxyLpklKzQ=; b=mRee7E61sSXxw6VDxVXNxbJlXfS0SmiHfqaJY8eHZrfZvsgRKBUyt4afKH6OaQpF4E 3y9vX4GTJapnsWS8Ew20I0xCcP5uIR5pmV+W7eAssa3t5hyz1Yspakf4coc8YR3WYCXB LMRav+Yqo4Ls7pTXDs9QPDAr4zDBAbhxil8uEQcONXoC3Ay6hi6GWGVJfQVANuznf8Uu OT2z3NHmjrxjmOvshSZFDZ4IRrdGJh49x37b0Xkof+zvxEteA+8ghSUtz8aJ0IJrFsNS REHpVnTK4x3Ygv8ZcAEqkTl/LUvunBnm8Ka8AaYPn9R+n9tdhmzgjs8uIdbuJcTL+3rT mdCQ== X-Gm-Message-State: AOAM532sopBIZ1cVgZM6BhrO5CumrpdhZef3ZaBZE7C5W2C/lSQJDZcZ PFfRVgZZ5k3JEFuYi92sNaQ= X-Google-Smtp-Source: ABdhPJwpq95nyRoC/2xZQNeoHLQ+y/KVadHnQl5Gdvdjhbx24KGQOE3yvKg/grPZ+EvJIm2p72tgeQ== X-Received: by 2002:a17:902:b606:b029:da:c8ed:7c2e with SMTP id b6-20020a170902b606b02900dac8ed7c2emr2256764pls.5.1610084829740; Thu, 07 Jan 2021 21:47:09 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id s33sm6922598pjj.56.2021.01.07.21.47.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 07 Jan 2021 21:47:08 -0800 (PST) Date: Fri, 08 Jan 2021 14:47:05 +0900 (JST) Message-Id: <20210108.144705.337065613222682471.horikyota.ntt@gmail.com> To: tsunakawa.takay@fujitsu.com Cc: osumi.takamichi@fujitsu.com, sfrost@snowman.net, masao.fujii@oss.nttdata.com, ashutosh.bapat.oss@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: In-placre persistance change of a relation From: Kyotaro Horiguchi In-Reply-To: <20201225.091252.53717619425847881.horikyota.ntt@gmail.com> References: <20201224.170220.34532914782663309.horikyota.ntt@gmail.com> <20201225.091252.53717619425847881.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Jan__8_14_47_05_2021_579)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ----Next_Part(Fri_Jan__8_14_47_05_2021_579)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Fri, 25 Dec 2020 09:12:52 +0900 (JST), Kyotaro Horiguchi wrote in > Hello. > > At Thu, 24 Dec 2020 17:02:20 +0900 (JST), Kyotaro Horiguchi wrote in > > The patch is attached to the next message. > > The reason for separating this message is that I modified this so that > it could solve another issue. > > There's a complain about orphan files after crash. [1] > > 1: https://www.postgresql.org/message-id/16771-cbef7d97ba93f4b9@postgresql.org > > That is, the case where a relation file is left alone after a server > crash that happened before the end of the transaction that has created > a relation. As I read this, I noticed this feature can solve the > issue with a small change. > > This version gets changes in RelationCreateStorage and > smgrDoPendingDeletes. > > Previously inittmp fork is created only along with an init fork. This > version creates one always when a relation storage file is created. As > the result ResetUnloggedRelationsInDbspaceDir removes all forks if the > inttmp fork of a logged relations is found. Now that pendingDeletes > can contain multiple entries for the same relation, it has been > modified not to close the same smgr multiple times. > > - It might be better to split 0001 into two peaces. > > - The function name ResetUnloggedRelationsInDbspaceDir is no longer > represents the function correctly. As pointed by Robert in another thread [1], persisntence of (at least) GiST index cannot be flipped in-place due to incompatibility of fake LSNs with real ones. This version RelationChangePersistence() is changed not to choose in-place method for indexes other than btree. It seems to be usable with all kind of indexes other than Gist, but at the mement it applies only to btrees. 1: https://www.postgresql.org/message-id/CA+TgmoZEZ5RONS49C7mEpjhjndqMQtVrz_LCQUkpRWdmRevDnQ@mail.gmail.com regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Fri_Jan__8_14_47_05_2021_579)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v3-0001-In-place-table-persistence-change.patch"