Re: 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2 - Mailing list pgsql-general

From Jim Nasby
Subject Re: 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2
Date
Msg-id 65fc964b-a5f5-8c9b-37d6-a74ccd80feed@BlueTreble.com
Whole thread Raw
In response to Re: 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2  (David Gibbons <david@dgibbons.net>)
Responses Re: 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
On 9/2/16 11:44 AM, David Gibbons wrote:
> rsync -va /var/lib/pgsql/ /var/lib/pgsql2/
> service postgres stop
> rsync -va /var/lib/pgsql/ /var/lib/pgsql2/
>
> The second rsync will only copy the deltas from the first, it still has
> to go in and determine what needs to be copied/what changed but the bulk
> of it can be prepared/migrated before the actual downtime window.

That is NOT safe. The problem is it allows rsync to use mtime alone to
decide that a file is in sync, and that will fail if Postgres writes to
a file in the same second that the first rsync reads from it (assuming
Postgres writes after rsync reads). You need to add the --checksum flag
to rsync (which means it will still have to read everything that's in
/var/lib/pgsql).
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461


pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Re: Postgres UPGRADE from 9.2 to 9.4
Next
From: Ken Tanzer
Date:
Subject: Re: How to assemble all fields of (any) view into a string?