Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0H1C-0004G2-Tg for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Mar 2018 01:33:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0H1A-0006XS-Ed for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Mar 2018 01:33:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0H19-0006XI-T1 for pgsql-hackers@lists.postgresql.org; Mon, 26 Mar 2018 01:33:48 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0H12-0008EW-5h for pgsql-hackers@postgresql.org; Mon, 26 Mar 2018 01:33:46 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id A31B720C11; Sun, 25 Mar 2018 21:33:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 25 Mar 2018 21:33:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=DnP1Ud ol3RoyRzSQkm/9/IJlFDwkkzf/yzZtydI7Lfo=; b=NZb8gq1iC7Le9CEQ87WLLL UFocluDe4gGMY+4Y1kz+MqNgw+Is4H4YzI77wqeonFkct8fQN8aUNbGoV+KCSA8O k+/VfGQwWN5NjSSVrwUxE0iot226qBzHkNe46f/B3mCz0A5hGkrqo7PwfJ9QKwxy 5Q+91QP/lRGsb2/GgnL3uMngRKEIkDsTUVNaoG3inbQyS31mW+yY4wdP5jTnDGVq zxkTjHXIeMqOtLuNBFOYfwa6yl5PrJZyrG+7Tl2MHjp+r7M2poKEiDC144q4plbK 9wNguu7MkNo7Q8DtIRry7awDEjUG4K8VzBJvDe9myeZlIj79hJ3CbxfbWTXMAsxw == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 6ECE6E50B5; Sun, 25 Mar 2018 21:33:38 -0400 (EDT) Subject: Re: file cloning in pg_upgrade and CREATE DATABASE To: Michael Paquier References: <20180319070636.GA4633@paquier.xyz> <20180319071415.GB4633@paquier.xyz> <20180320025849.GB4963@paquier.xyz> <678999c6-0967-d22a-e7d1-2a3aff83a77b@2ndquadrant.com> <20180322023831.GG2490@paquier.xyz> Cc: pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <9380bebc-3c16-42f0-d0e1-da7c235f8a58@2ndquadrant.com> Date: Sun, 25 Mar 2018 21:33:38 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180322023831.GG2490@paquier.xyz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/21/18 22:38, Michael Paquier wrote: > At least on Linux it is possible to rely on sync_file_range which is > called via pg_flush_data, so it seems to me that we ought to roughly > keep the loop working on FLUSH_DISTANCE, and replace the calls of > read/write by copy_file_range. copyfile is only able to do a complete > file copy, so we would also lose this property as well on Linux. I have shown earlier in the thread that copy_file_range in one go is still better than doing it in pieces. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services