Re: BUG #6042: unlogged table with Streaming Replication - Mailing list pgsql-bugs

From Jaime Casanova
Subject Re: BUG #6042: unlogged table with Streaming Replication
Date
Msg-id BANLkTimPMtycTh0k_jYkAkSeZbYx607bFQ@mail.gmail.com
Whole thread Raw
In response to BUG #6042: unlogged table with Streaming Replication  ("Tomonari Katsumata" <katsumata.tomonari@po.ntts.co.jp>)
Responses Re: BUG #6042: unlogged table with Streaming Replication
Re: BUG #6042: unlogged table with Streaming Replication
List pgsql-bugs
On Fri, May 27, 2011 at 12:26 AM, Tomonari Katsumata
<katsumata.tomonari@po.ntts.co.jp> wrote:
>
>
> I've checked "unlogged table" and "Streaming Replication".
> I'm thinking about using unlogged tables as work-tables on Primary.
>
> 1) construct Streaming Replication Environment.
> =A0Primary and Standby are same server with different database cluster and
> port number.
>
> 2) create unlogged table on Primary.
> =A0=3D# CREATE UNLOGGED TABLE tbl1(i int);
> =A0This table is available on primary only.
>

because streaming replication works shipping WAL records (the records
of the transactional log) to the standby but because UNLOGGED tables
are not logged to WAL i guess those always will be empty on standby,
but the table should appear on the standby, i guess


> 4) create unlogged table on Primary again.
> =A0=3D# CREATE UNLOGGED TABLE tbl2(i int);
>
> when I executed 4), any response is not back to my psql. and I canceled t=
he
> query, I got messages bellow.
> ---
> Cancel request sent
> WARNING: =A0canceling wait for synchronous replication due to user request
> DETAIL: =A0The transaction has already committed locally, but may not have
> been replicated to the standby.
> CREATE TABLE
> ---
> and the table has been created.
>
> I think It's strange behavior(a canceled table has been created).
>

actually, you're not cancelling the creation... the table has been
created and the wal is being sent to the standby (because the standby
is a synchronous standby, it keeps waiting until the standby aknlowdge
to have received the wal), so what you are cancelling now is the
primary waiting for the standby...


btw, i guess we should be defaulting to asynchronous standbys (ie:
synchronous_commit=3Dlocal)

--=20
Jaime Casanova=A0 =A0 =A0 =A0=A0 www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitaci=F3n de PostgreSQL

pgsql-bugs by date:

Previous
From: "Tomonari Katsumata"
Date:
Subject: BUG #6042: unlogged table with Streaming Replication
Next
From: Tomonari Katsumata
Date:
Subject: Re: BUG #6042: unlogged table with Streaming Replication