pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6042: unlogged table with Streaming Replication
5+ messages / 4 participants
[nested] [flat]
* BUG #6042: unlogged table with Streaming Replication
@ 2011-05-27 05:26 Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 05:53 ` Re: BUG #6042: unlogged table with Streaming Replication Jaime Casanova <jaime@2ndquadrant.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tomonari Katsumata @ 2011-05-27 05:26 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged online:
Bug reference: 6042
Logged by: Tomonari Katsumata
Email address: katsumata.tomonari@po.ntts.co.jp
PostgreSQL version: 9.1beta1
Operating system: RHEL5.3 x86_64
Description: unlogged table with Streaming Replication
Details:
Hi,
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.
Primary and Standby are same server with different database cluster and
port number.
2) create unlogged table on Primary.
=# CREATE UNLOGGED TABLE tbl1(i int);
This table is available on primary only.
3) Stop Standby.
[standby]$ pg_ctl stop
4) create unlogged table on Primary again.
=# CREATE UNLOGGED TABLE tbl2(i int);
when I executed 4), any response is not back to my psql. and I canceled the
query, I got messages bellow.
---
Cancel request sent
WARNING: canceling wait for synchronous replication due to user request
DETAIL: The 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).
Is this the same problem with "BUG #6041"?
regards,
----
Tomonari Katsumata
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #6042: unlogged table with Streaming Replication
2011-05-27 05:26 BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
@ 2011-05-27 05:53 ` Jaime Casanova <jaime@2ndquadrant.com>
2011-05-27 06:15 ` Re: BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-06-01 18:34 ` Re: BUG #6042: unlogged table with Streaming Replication Robert Haas <robertmhaas@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: Jaime Casanova @ 2011-05-27 05:53 UTC (permalink / raw)
To: Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>; +Cc: 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.
> Primary and Standby are same server with different database cluster and
> port number.
>
> 2) create unlogged table on Primary.
> =# CREATE UNLOGGED TABLE tbl1(i int);
> This 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.
> =# CREATE UNLOGGED TABLE tbl2(i int);
>
> when I executed 4), any response is not back to my psql. and I canceled the
> query, I got messages bellow.
> ---
> Cancel request sent
> WARNING: canceling wait for synchronous replication due to user request
> DETAIL: The 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=local)
--
Jaime Casanova www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #6042: unlogged table with Streaming Replication
2011-05-27 05:26 BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 05:53 ` Re: BUG #6042: unlogged table with Streaming Replication Jaime Casanova <jaime@2ndquadrant.com>
@ 2011-05-27 06:15 ` Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 10:27 ` Re: BUG #6042: unlogged table with Streaming Replication Simon Riggs <simon@2ndQuadrant.com>
1 sibling, 1 reply; 5+ messages in thread
From: Tomonari Katsumata @ 2011-05-27 06:15 UTC (permalink / raw)
To: pgsql-bugs
Hi, Jaime
thank you for your answer.
I understand it.
I turned synchronous_commit to "local",
I get desirable behavior.
I've thought that if there are no standby,
the primary would behave like stand-alone...
sorry, this is my misunderstanding.
regards,
(2011/05/27 14:53), Jaime Casanova wrote:
> 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.
>> Primary and Standby are same server with different database cluster and
>> port number.
>>
>> 2) create unlogged table on Primary.
>> =# CREATE UNLOGGED TABLE tbl1(i int);
>> This 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.
>> =# CREATE UNLOGGED TABLE tbl2(i int);
>>
>> when I executed 4), any response is not back to my psql. and I canceled the
>> query, I got messages bellow.
>> ---
>> Cancel request sent
>> WARNING: canceling wait for synchronous replication due to user request
>> DETAIL: The 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=local)
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #6042: unlogged table with Streaming Replication
2011-05-27 05:26 BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 05:53 ` Re: BUG #6042: unlogged table with Streaming Replication Jaime Casanova <jaime@2ndquadrant.com>
2011-05-27 06:15 ` Re: BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
@ 2011-05-27 10:27 ` Simon Riggs <simon@2ndQuadrant.com>
0 siblings, 0 replies; 5+ messages in thread
From: Simon Riggs @ 2011-05-27 10:27 UTC (permalink / raw)
To: Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>; +Cc: pgsql-bugs
On Fri, May 27, 2011 at 7:15 AM, Tomonari Katsumata
<katsumata.tomonari@po.ntts.co.jp> wrote:
> I've thought that if there are no standby,
> the primary would behave like stand-alone...
> sorry, this is my misunderstanding.
It is a common misunderstanding. The programmed behaviour leads to the
most trusted level of robustness.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #6042: unlogged table with Streaming Replication
2011-05-27 05:26 BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 05:53 ` Re: BUG #6042: unlogged table with Streaming Replication Jaime Casanova <jaime@2ndquadrant.com>
@ 2011-06-01 18:34 ` Robert Haas <robertmhaas@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Robert Haas @ 2011-06-01 18:34 UTC (permalink / raw)
To: Jaime Casanova <jaime@2ndquadrant.com>; +Cc: Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>; pgsql-bugs
On Fri, May 27, 2011 at 1:53 AM, Jaime Casanova <jaime@2ndquadrant.com> wrote:
> btw, i guess we should be defaulting to asynchronous standbys (ie:
> synchronous_commit=local)
By default, synchronous_standby_names is empty, which makes
synchronous_commit=on equivalent to synchronous_commit=local. So I
think the current default is good, because it means you only need to
change ONE parameter to switch from async rep to sync rep (namely,
synchronous_standby_names).
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2011-06-01 18:34 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27 05:26 BUG #6042: unlogged table with Streaming Replication Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 05:53 ` Jaime Casanova <jaime@2ndquadrant.com>
2011-05-27 06:15 ` Tomonari Katsumata <katsumata.tomonari@po.ntts.co.jp>
2011-05-27 10:27 ` Simon Riggs <simon@2ndQuadrant.com>
2011-06-01 18:34 ` Robert Haas <robertmhaas@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox