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 1kzGRW-0002Ny-Mq for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jan 2021 09:58:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzGRU-0004mz-OK for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jan 2021 09:58:24 +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 1kzGRU-0004mr-9x for pgsql-hackers@lists.postgresql.org; Tue, 12 Jan 2021 09:58:24 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kzGRL-00021l-K4 for pgsql-hackers@lists.postgresql.org; Tue, 12 Jan 2021 09:58:23 +0000 Received: by mail-pj1-x102d.google.com with SMTP id cq1so1092459pjb.4 for ; Tue, 12 Jan 2021 01:58:15 -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=3MYGeyfZb8RworG9X7eT80Uwp4pZjiFqzx6rnprU318=; b=KQ+OxVWXCMi66MWGt3zBfoYJz8gztRO7aEJJD5DwWfWEhws7p8RAUU9PSh9LYSYQPb ZwKsX5XWljVSCjZO85JYFklnCGvWCabCigQbZJ1Ha2tIODxi3LBuZ/DriAX8dy145hl3 qMBCa5KJVWFipwgikJW6uqzmnCgfW7AH+uTwJPpDdhsfsrheLPCqY7iTn75M3r7P+XXB sInb51sHs8JYn4M1C9QAJWRKK5SxiHBOxDTu+JjCCxcuFljOCNqvktmrxmMB2++G3sQq D3PT2LL3raRK7cYyRitJZbx1LniLeTGEwI/CjlDu9iPDnT63bYv3dA3M7+/SCNwn6ZL1 0ZJA== 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=3MYGeyfZb8RworG9X7eT80Uwp4pZjiFqzx6rnprU318=; b=LEFY+uG+3kNe1S5BbUiwGM3tOulJopc1p23D8y4OsNzhIVzcIMe7g46fXzhbRTY8Yv pyssxUUPB3LQMjz61z6GyFHAVjOAPWOWQZHoHnWfaD3u55xvEfpYOGwB13aZ++Vmdl67 0O2S7oU5Qhk17suohKD4t4ZUHPHoGNBHHRGuCj06dfaWY90KvoL3ebXmuPhrFz14Uje0 9ivS7AbBnQJpUTmesyL3n8loyD/r6DUflpYtDgrB4TQ7qkwN9WAipywkT8XWlUR6mjPU 87cc16zC1S1t0TpfstJWfCTbwRV45N42uaisFOwH+ybd3OA39Rf4LQvR6w4okkvbNurv kd+Q== X-Gm-Message-State: AOAM5302x9sqoBxJGIYtQqMZgbcKVNTQZuiWjhn3BA84nLWDc4P1/6Ta sjZSYWxjqovD65VsYD91oGw= X-Google-Smtp-Source: ABdhPJy5p7fpkOSVElT9uPXgY7GIvT5bh+O0+FmqH1SW/4+6qskPWJR7AYPyqJ7gW7QFswE8nNC/gw== X-Received: by 2002:a17:902:a60c:b029:da:e036:5dbe with SMTP id u12-20020a170902a60cb02900dae0365dbemr3929135plq.43.1610445493221; Tue, 12 Jan 2021 01:58:13 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id h24sm2734426pfq.13.2021.01.12.01.58.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Jan 2021 01:58:11 -0800 (PST) Date: Tue, 12 Jan 2021 18:58:08 +0900 (JST) Message-Id: <20210112.185808.926258436521829536.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: <20210108.175221.1020658670277126419.horikyota.ntt@gmail.com> References: <20201225.091252.53717619425847881.horikyota.ntt@gmail.com> <20210108.144705.337065613222682471.horikyota.ntt@gmail.com> <20210108.175221.1020658670277126419.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(Tue_Jan_12_18_58_08_2021_481)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ----Next_Part(Tue_Jan_12_18_58_08_2021_481)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Fri, 08 Jan 2021 17:52:21 +0900 (JST), Kyotaro Horiguchi wrote in > At Fri, 08 Jan 2021 14:47:05 +0900 (JST), Kyotaro Horiguchi wrote in > > 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 > > Hmm. This is not wroking correctly. I'll repost after fixint that. I think I fixed the misbehavior. ResetUnloggedRelationsInDbspaceDir() handles file operations in the wrong order and with the wrong logic. It also needed to drop buffers and forget fsync requests. I thought that the two cases that this patch is expected to fix (orphan relation files and uncommited init files) can share the same "cleanup" fork but that is wrong. I had to add one more additional fork to differentiate the cases of SET UNLOGGED and of creation of UNLOGGED tables... The attached is a new version, that seems working correctly but looks somewhat messy. I'll continue working. regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Tue_Jan_12_18_58_08_2021_481)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v4-0001-In-place-table-persistence-change.patch"