Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id CB6D8B5DC1E for ; Fri, 27 May 2011 02:53:44 -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 57049-09 for ; Fri, 27 May 2011 05:53:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id 5329EB5DC1D for ; Fri, 27 May 2011 02:53:37 -0300 (ADT) Received: by wya21 with SMTP id 21so990888wya.19 for ; Thu, 26 May 2011 22:53:36 -0700 (PDT) Received: by 10.216.236.28 with SMTP id v28mr6686638weq.12.1306475616092; Thu, 26 May 2011 22:53:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.154.130 with HTTP; Thu, 26 May 2011 22:53:21 -0700 (PDT) In-Reply-To: <201105270526.p4R5Qlxs072183@wwwmaster.postgresql.org> References: <201105270526.p4R5Qlxs072183@wwwmaster.postgresql.org> From: Jaime Casanova Date: Fri, 27 May 2011 00:53:21 -0500 X-Google-Sender-Auth: _GzuOKUztDw8qU1ApdszNNe5l0w Message-ID: Subject: Re: BUG #6042: unlogged table with Streaming Replication To: Tomonari Katsumata Cc: pgsql-bugs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.429 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72, T_FRT_BELOW2=0.01 X-Spam-Level: ** X-Archive-Number: 201105/196 X-Sequence-Number: 30335 On Fri, May 27, 2011 at 12:26 AM, Tomonari Katsumata 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 an= d > 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 reques= t > DETAIL: =A0The transaction has already committed locally, but may not hav= e > 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