Re: replication consistency checking

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Igor Neyman <ineyman(at)perceptron(dot)com>
Cc: hydra <hydrapolic(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: replication consistency checking
Date: 2015-06-05 14:56:54
Message-ID: D9E31A4B-66EB-426D-A418-2C29578E305E@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Jun 5, 2015, at 8:42 AM, Igor Neyman <ineyman(at)perceptron(dot)com> wrote:
>
> The problem I see with “checksum utility” is that for it to work both compared servers should be “static”: not transactions while it does its job.

Indeed, and that was brought up before and OP seems to be ignoring it. What magic does MySQL (supposedly) use to compare databases without interfering with updates?

One could imagine a built-in feature in PG which depends on using MVCC and having both sides look at the same snapshot. (Which would require repeatable reads.)

But for an external utility, that's quite a bit harder. One suggestion which would involve minimal interruption to processing: if you have a snapshottable file system, shut down master, take snapshot, shut down replica, bring master back up, snapshot replica, bring it back up. You *still* have the issue of making sure that at the moment you take master down all changes have been streamed to replica, and the (easier) issue of making sure replica has applied them before taking its snapshot... But if you can manage to pull that off, then you can checksum & compare as much as you want, *IF* you can actually pull that off correctly ;-)

--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message sinasaharkhiz 2015-06-05 16:47:40 Decreasing the data loss after failover
Previous Message Igor Neyman 2015-06-05 14:42:47 Re: replication consistency checking