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 1er7nU-0006iX-Mx for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2018 19:53:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1er7nT-0004cN-HR for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2018 19:53:51 +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 1er7nQ-0004Al-Uh for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2018 19:53:49 +0000 Received: from www.ipv6.roaringpenguin.com ([2607:f748:1200:fb:70:38:112:54] helo=colo3.roaringpenguin.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1er7nN-00017P-AP for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2018 19:53:47 +0000 Received: from vanadium.roaringpenguin.com ([192.168.10.23]) by colo3.roaringpenguin.com (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id w1SJrfOt008969 for ; Wed, 28 Feb 2018 14:53:42 -0500 Received: from hydrogen.roaringpenguin.com (dfs@hydrogen.roaringpenguin.com [192.168.10.1]) by vanadium.roaringpenguin.com (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id w1SJrfHR014265 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 28 Feb 2018 14:53:41 -0500 Date: Wed, 28 Feb 2018 14:53:41 -0500 From: Dianne Skoll To: pgsql-admin@lists.postgresql.org Subject: Re: Reliable WAL file shipping over unreliable network Message-ID: <20180228145341.0fdf5414@hydrogen.roaringpenguin.com> In-Reply-To: <33220469-5BB2-4A40-8F56-8F4F392C95B3@icloud.com> References: <400AC9CD-1E43-422C-A689-70BDBAFF231E@elevated-dev.com> <37C5A42B-4CDD-4F01-8F1E-1B185C1819B9@icloud.com> <20180228132620.2c882f84@hydrogen.roaringpenguin.com> <33220469-5BB2-4A40-8F56-8F4F392C95B3@icloud.com> Organization: Roaring Penguin Software Inc. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: CanIt (www . roaringpenguin . com) X-Scanned-By: MIMEDefang 2.80 on 192.168.10.23 X-Spam-Score: undef - relay 192.168.10.23 marked with skip_spam_scan X-CanIt-Geo: No geolocation information available for 192.168.10.23 X-CanItPRO-Stream: outgoing (inherits from default) X-CanIt-Archive-Cluster: SQVyZJxqklY5buiWXYCN4T/BjiM X-CanIt-Archived-As: base/20180228 / 01VgjRFNz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=roaringpenguin.com; h= date:from:to:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=canit; bh=mOcAMcB4ySiILwgwML6mR2+pOt9AjAn9RJf9L+WAaaQ=; b=JzJYKzzaspbe p+4S1ekBsSWjIDUifyGgB/j4l60KxsQBgGA6BhwYaB3P3dpC2/aW3BjBLHigDGgw mfqyqhW7iKiUcCKhwUGxllzW52d3JaEFE7uj07SqAx5CP+5q2wLRPQ49tIwAV7Zp 7GA8IKM+Qc4i7SqvKfQnJ3lmMTkowI2jirXuknqS96c8xAtaK1TsrdlGoGuXuwed hLfQnfh7MaidTZC/1wQcHe5LCNJtp0Ye/dnw8SdPUyolkPfGxMDLm4fiGbZCAQWZ Sb6EzA3ycSfbMxCR9bz5q6DyGnHM5Tc1QR0bOI4aGtgU5yyLxbrE8k5NLsLBWe0J te8zShuh4w== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 28 Feb 2018 13:49:33 -0500 Rui DeSousa wrote: > Really? I think you really need to think about it. You are dealing > with a race condition. You are not correct. 1) rsync copies the source file to a temporary file on the destination. 2) If and only if step (1) is successful, rsync renames the temporary file to the final filename. 3) If and only if step (2) is successful, rsync sets the timestamp on the destination file to match that of the source file, assuming the --archive or similar command-line option was given. There is no possible sequence of events that could give you a destination file with the same size and timestamp as the source file and yet be incorrect (just so long as the source file has stayed the same.) Regards, Dianne.