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 1er7JY-0004Vp-KT for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2018 19:22:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1er7JX-0004oT-2E for pgsql-admin@arkaria.postgresql.org; Wed, 28 Feb 2018 19:22:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1er7JW-0004oK-R3 for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2018 19:22:54 +0000 Received: from www.ipv6.roaringpenguin.com ([2607:f748:1200:fb:70:38:112:54] helo=colo3.roaringpenguin.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1er7JT-0008FI-SI for pgsql-admin@lists.postgresql.org; Wed, 28 Feb 2018 19:22:54 +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 w1SJMnkg031623 for ; Wed, 28 Feb 2018 14:22:49 -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 w1SJGhFX002328 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 28 Feb 2018 14:16:43 -0500 Date: Wed, 28 Feb 2018 14:16:43 -0500 From: Dianne Skoll Cc: pgsql-admin@lists.postgresql.org Subject: Re: Reliable WAL file shipping over unreliable network Message-ID: <20180228141643.40a8eb8a@hydrogen.roaringpenguin.com> In-Reply-To: <20180228135220.1cd46347@hydrogen.roaringpenguin.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> <20180228135220.1cd46347@hydrogen.roaringpenguin.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 / 01VgjmNMu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=roaringpenguin.com; h= date:from:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=canit; bh=UDq82ldbhCn5FojPGD4TZ1S5Y0hytsda5Sl8ddzTo8M=; b=WiyqEOxyodzP uwNAdhF4uRXkpg/lGQ23AlBgJjV7cSbHz1PTt/Ig/w9yQmIQLr5l0jXkCwj2Cfsh ThiDRQMIX+n71YkCMc3NS0q2bvHc4ZQFVRWFZhY/vNguoIRfrzeScj1wtUgHtxtB Tyrc955mzR4l5HbVHlFewaj3PtBROC2FYSwBjkqkaG4BjoHllNhQcsO0mbv1IWt3 dkl8Vh1xKwN4Mfm2URZf2qtj/iMsa9xN8frZj3j/TC+DzSZQjFEO7sCV3vDzpwnN AJNXeNx7MgTMgXUOb008pa2DRFtWPAJvlXQp0tYmZ7tLiMELfWLwuz+FxCFi/v4j NfY4vU8Wvw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk So, I decided to run a test. It turns out we are both wrong. My test script is as follows: #====================================================================== #!/bin/bash # Remote machine MACH=dianne.skoll.ca # Create a 10MB pseudo-random file echo "`date` Creating 10MB file" FILE=pseudo-random dd if=/dev/urandom bs=1k count=10k of=$FILE 2>/dev/null # Rsync it over at 500kB per second in the background echo "`date` Starting rsync" rsync -c --verbose --bwlimit=500k $FILE $MACH:/tmp & RSYNC_PID=$! echo "`date` rsync PID=$RSYNC_PID; sleeping for 3 seconds" # Sleep for 3 seconds sleep 3 echo "`date` Stopping rsync" # Stop the rsync kill -STOP $RSYNC_PID echo "`date` Changing source file" # Change the source file dd if=/dev/urandom bs=1k count=10k of=$FILE 2>/dev/null echo "`date` Continuing rsync" # Restart the rsync and bring it into the foreground kill -CONT $RSYNC_PID wait echo "`date` Rsync done; comparing files" ssh $MACH "cd /tmp && sha1sum $FILE" | sha1sum -c - #====================================================================== Running it produces this output: Wed Feb 28 14:14:32 EST 2018 Creating 10MB file Wed Feb 28 14:14:32 EST 2018 Starting rsync Wed Feb 28 14:14:32 EST 2018 rsync PID=24456; sleeping for 3 seconds pseudo-random Wed Feb 28 14:14:35 EST 2018 Stopping rsync Wed Feb 28 14:14:35 EST 2018 Changing source file Wed Feb 28 14:14:35 EST 2018 Continuing rsync sent 10,488,419 bytes received 19,505 bytes 488,740.65 bytes/sec total size is 10,485,760 speedup is 1.00 Wed Feb 28 14:14:53 EST 2018 Rsync done; comparing files pseudo-random: FAILED sha1sum: WARNING: 1 computed checksum did NOT match So even *with* the -c flag, rsync didn't notice the file had been changed while it was running. Interesting. Regards, Dianne.