Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D123F1337BE0 for ; Sun, 10 Apr 2011 23:30:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 53807-01 for ; Mon, 11 Apr 2011 02:29:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174]) by mail.postgresql.org (Postfix) with ESMTP id EA0381337BCF for ; Sun, 10 Apr 2011 23:29:25 -0300 (ADT) Received: by gxk21 with SMTP id 21so2003640gxk.19 for ; Sun, 10 Apr 2011 19:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UjKOghw6gredepdm6JQ4qK2VqyQhdVCcYn1Zqf9oQdg=; b=VCTFyopDLFhAGPJcrLltrJa24Zih6jQl3v7bEVlRvDfGQaiCU2jm5oBEkANrySNpUQ fZgGEN2wTEmrrtvw9nT6I9VgmMSj1RD8OlwT81wkTEqjCLkJalw6t0z5WxEw/XvmoPWl RLfWZBonqd1vhDreiQD0xGPuX69tdjISzjBa4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DqLxOCnMBaqLsN6vtWGmVYkFrShXCbvC7J1tRWxGsfZB5Zws/b2Wr93Yq8YwzFr7md nI1JakYu8OuMnJsRBh9WpSIyFt6xItWDD/4yiN8K9l1qMnpgV3rSNoGjDX20JJFTa5AQ h9vGJVscrsqWkX35hZQ3/B2YlapfLAovsm0II= MIME-Version: 1.0 Received: by 10.236.79.34 with SMTP id h22mr5515629yhe.407.1302488965603; Sun, 10 Apr 2011 19:29:25 -0700 (PDT) Received: by 10.236.111.46 with HTTP; Sun, 10 Apr 2011 19:29:25 -0700 (PDT) In-Reply-To: <20110403105251.GF4116@tamriel.snowman.net> References: <20110401010336.GB4116@tamriel.snowman.net> <20110401013853.GC4116@tamriel.snowman.net> <20110401022209.GD4116@tamriel.snowman.net> <20110401023555.GE4116@tamriel.snowman.net> <20110403105251.GF4116@tamriel.snowman.net> Date: Mon, 11 Apr 2011 10:29:25 +0800 Message-ID: Subject: Re: Too many WAL(s) despite low transaction From: Selva manickaraja To: Stephen Frost Cc: Benjamin Krajmalnik , pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=20cf300fb18b1e60e104a09b5873 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.345 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201104/76 X-Sequence-Number: 37257 --20cf300fb18b1e60e104a09b5873 Content-Type: text/plain; charset=ISO-8859-1 We have let the production DB to run for about one week and monitor the situation. As days passed the DB began to settle down and the log shipping was more consistent. So as suggested by Stephen, we did a tape restore of the base backup and wal-backup from the previous backup done. We have scheduled a backup of base+wal(s) every 12 hours. So this was the steps taken to test whether our backup is good or not. 1. Our primary MachineA is replicated to MachineB for pass one week. And WAL(s) are also shipped to Machine C from where all backups are done. 2. Backup (base+wal) restored from tape to MachineD. 3. Use a home-written scripts to unzip and untar the base and wal to the appropriate directories. 4. Database started in MachineD as a secondary to MachineA. 5. Database in MachineD started and attempted to replicate from MachineA. But unable to replicate because state of base is inconsistent with MachineA. 6. We pushed the un-backedup WAL(s) from MachineC to the archive directory in MachineD. 7. It was a great sight to witness as and when the WAL(S) arrive in MachineC it attempts to restore and replicate with MachineA. 8. Finally after the last WAL was restored the MachineD was in-synch as MachineA in full replication mode. We suppose our backup(s) can be restored if this worked. Comments are welcomed. Our next plan of action is 1. To do a PITR from these backups. 2. Implement pg_compress, or pg_lesslog, pg_clearxlogtail to WAL(S) to reduce the size of WALs. There are other DB issues that I would like to highlight but that it's better to begin another thread for everyone's clarity. Thank you. Regards, Selvam On Sun, Apr 3, 2011 at 6:52 PM, Stephen Frost wrote: > * Selva manickaraja (mavles78@gmail.com) wrote: > > Next actions to do: > > > > 1. Implement pg_compress, or pg_lesslog, pg_clearxlogtail > > 2. Check on how well autovacuum is running and how much to tune it. > > Have you tested that you can do a restore using the base backup and > WALs? Have you made sure the database is consistent/correct after doing > such a restore? If you change to using pg_compress or anything else, > you should be sure to repeat that testing to make sure everything works > as expected. > > Thanks, > > Stephen > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAk2YUYMACgkQrzgMPqB3kijQfgCeJ9F4HPrpNdRePlR4SwJ2A89W > ikUAoIM9cM23J43vvX/wuW7Iq1UqQsac > =JnLy > -----END PGP SIGNATURE----- > > --20cf300fb18b1e60e104a09b5873 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We have let the production DB to run for about one week and monitor the sit= uation. As days passed the DB began to settle down and the log shipping was= more consistent. So as suggested by Stephen, we did a tape restore of the = base backup and wal-backup from the previous backup done. We have scheduled= a backup of base+wal(s) every 12 hours.

So this was the steps taken to test whether our backup is good or not.<= br>
  1. Our primary MachineA is replicated to MachineB for pass one = week. And WAL(s) are also shipped to Machine C from where all backups are d= one.
  2. Backup (base+wal) restored from tape to MachineD.
  3. Use a home-wr= itten scripts to unzip and untar the base and wal to the appropriate direct= ories.
  4. Database started in MachineD as a secondary to MachineA.
  5. Database in MachineD started and attempted to replicate from MachineA. = But unable to replicate because state of base is inconsistent with MachineA= .
  6. We pushed the un-backedup WAL(s) from MachineC to the archive dir= ectory in MachineD.
  7. It was a great sight to witness as and when the WAL(S) arrive in Machin= eC it attempts to restore and replicate with MachineA.
  8. Finally afte= r the last WAL was restored the MachineD was in-synch as MachineA in full r= eplication mode.
We suppose our backup(s) can be restored if this worked. Comments are = welcomed.

Our next plan of action is

1. To do a PITR from th= ese backups.
2. Implement pg_compress, or pg_lesslog, pg_clearxlogtail = to WAL(S) to reduce the size of WALs.

There are other DB issues that I would like to highlight but that it= 9;s better to begin another thread for everyone's clarity.

Thank= you.

Regards,

Selvam


On Sun, Apr 3, 2011 at 6:52 PM, Stephen Frost <sfrost@snowman.net> wrote:
=
* Selva manickaraja (mavles78@gmail.com) wrote:
> Next actions to do:
>
> =A0 =A01. Implement pg_compress, or pg_lesslog, pg_clearxlogtail
> =A0 =A02. Check on how well autovacuum is running and how much to tune= it.

Have you tested that you can do a restore using the base backup and
WALs? =A0Have you made sure the database is consistent/correct after doing<= br> such a restore? =A0If you change to using pg_compress or anything else,
you should be sure to repeat that testing to make sure everything works
as expected.

=A0 =A0 =A0 =A0Thanks,

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Stephen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk2YUYMACgkQrzgMPqB3kijQfgCeJ9F4HPrpNdRePlR4SwJ2A89W
ikUAoIM9cM23J43vvX/wuW7Iq1UqQsac
=3DJnLy
-----END PGP SIGNATURE-----


--20cf300fb18b1e60e104a09b5873--