Re: [HACKERS] [streaming replication] 9.1.3 streaming replication bug ?

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: qiaozhiqiang(at)leadcoretech(dot)com, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] [streaming replication] 9.1.3 streaming replication bug ?
Date: 2012-04-11 15:55:15
Message-ID: CAOzAqu+JZNEVOSoMjwMsrP=anbJOY3o3QjRB14Xh70LHEoM6yA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 4/11/12, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Michael Nolan <htfoot(at)gmail(dot)com> wrote:
>> On 4/11/12, 乔志强 <qiaozhiqiang(at)leadcoretech(dot)com> wrote:
>
>>> But when a transaction larger than 1GB...
>>
>> Then you may need WAL space larger than 1GB as well. For
>> replication to work, it seems likely that you may need to have
>> sufficient WAL space to handle a row, possibly the entire
>> transaction.. But since a single statement can update thousands
>> or millions of rows, do you always need enough WAL space to hold
>> the entire transaction?
>
> No.
>
>>> Does master send WAL to standby before the transaction commit ?
>
> Yes.
>
>> A related question is what happens if there is a rollback?
>
> PostgreSQL doesn't use a rollback log; WAL files can be reclaimed as
> soon as the work they represent has been persisted to the database
> by a CHECKPOINT, even if it is not committed. Because there can be
> multiple versions of each row in the base table, each with its own
> xmin (telling which transaction committed it) and xmax (telling
> which transaction expired it) visibiliity checking can handle the
> commits and rollbacks correctly. It also uses a commit log (CLOG),
> hint bits, and other structures to help resolve visibility. It is a
> complex topic, but it does work.

Thanks, Kevin. That does lead to a question about the problem that
started this thread, though. How does one determine how big the WAL
space needs to be to not cause streaming replication to fail? Or
maybe this is a bug after all?
--
Mike Nolan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2012-04-11 15:56:11 Re: [streaming replication] 9.1.3 streaming replication bug ?
Previous Message Kevin Grittner 2012-04-11 15:06:48 Re: [HACKERS] [streaming replication] 9.1.3 streaming replication bug ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua Berkus 2012-04-11 15:55:56 Re: Last gasp
Previous Message Alvaro Herrera 2012-04-11 15:49:04 Re: Last gasp