Re: Data duplication when moving datafiles from one server to another.

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: IñigoMartinez Lasala <imartinez(at)vectorsf(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Data duplication when moving datafiles from one server to another.
Date: 2010-12-21 17:50:24
Message-ID: 4D10948002000025000388C3@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

IñigoMartinez Lasala <imartinez(at)vectorsf(dot)com> wrote:

> Data duplication happened on source server (that is, on production
> environment). This data duplication affected only on some tables,
> with some duplicated PKs and altered sequences (sequences value
> didn't match "select max()" and we had to fix it manually).

We rsync from production servers all the time, and have never seen
such problems. Maybe someone else has ideas beyond my long shots
(below).

> Postgres version is 8.2.7 64bit on Ubuntu Server 8.04 LTS

There have been 12 bug fix releases for the 8.2 major release since
8.2.7. It's not impossible that you somehow hit a bug which has
been fixed in the last 33 months.

http://www.postgresql.org/support/versioning

http://www.postgresql.org/docs/8.2/static/release.html

> Rsync command was:
> rsync -avt -lHpogDtx /srv/postgresql/8.2/main/
> root(at)destination_server:/srv/postgresql/8.2/main/

Did it run successfully on the first try, or might there have been
an attempt where the target was mis-specified? A space instead of a
colon between the target server and path might have caused the kind
of corruption you're seeing.

Also -- I would avoid using root for such things. We have remote
root login disabled entirely on our machines, and limit the use of
that login to situations where there is no reasonable alternative.

> and was launched from source server.

I find it's harder to accidentally damage the remote copy, so I run
rsync from the target where possible.

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2010-12-21 17:53:42 Re: size of the database
Previous Message Zoran muljevski 2010-12-21 17:41:10 size of the database