Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anp2Y-0000Fw-Fu for pgsql-committers@arkaria.postgresql.org; Wed, 06 Apr 2016 15:06:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1anp2X-0005vB-Rv for pgsql-committers@arkaria.postgresql.org; Wed, 06 Apr 2016 15:06:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1anp2L-0005hP-Ce for pgsql-committers@postgresql.org; Wed, 06 Apr 2016 15:06:29 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1anp2I-0007sk-MV for pgsql-committers@postgresql.org; Wed, 06 Apr 2016 15:06:28 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E24DE21AAF for ; Wed, 6 Apr 2016 11:06:25 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Wed, 06 Apr 2016 11:06:25 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=fKIJvGH1GuBjR0y b18XZ70WZEPM=; b=OusOdu+P62cG94JowTPZ9svYZN23xpvO/LDXdjmziJfLkuh OqrdFqtf3wxQbmg+NMpW+eJzqw7NPmk8bo9f7AfAYALRfg3ooKw76EYWWP7MCRFw 7k7GiRqZ0ML+NLkHW2vRfY4N+anq6m1FdJ6vblAPZGOHryp9aCvd95ZIhzgY= X-Sasl-enc: pwjNA42BxCzRLkTwrC0W6i9Csl/cqmjlZb4OqOY0X/xK 1459955185 Received: from [10.28.141.178] (tmo-096-17.customers.d1-online.com [80.187.96.17]) by mail.messagingengine.com (Postfix) with ESMTPA id EEB9868014F; Wed, 6 Apr 2016 11:06:24 -0400 (EDT) User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: pgsql: Generic Messages for Logical Decoding From: Andres Freund Date: Wed, 06 Apr 2016 17:06:25 +0200 To: Fujii Masao ,Simon Riggs CC: pgsql-committers Message-ID: X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On April 6, 2016 5:00:54 PM GMT+02:00, Fujii Masao wrote: >On Wed, Apr 6, 2016 at 6:08 PM, Simon Riggs >wrote: >> Generic Messages for Logical Decoding >> >> API and mechanism to allow generic messages to be inserted into WAL >that are >> intended to be read by logical decoding plugins. This commit adds an >optional >> new callback to the logical decoding API. > >When I specify very long text message, pg_xlogdump failed to dump >correctly the WAL file which should contain that inserted text message. >Isn't this a bug? > >You can reproduce the problem by the following steps. > >=# SELECT pg_xlogfile_name(pg_switch_xlog()); > pg_xlogfile_name >-------------------------- > 000000010000000000000003 >(1 row) > >=# SELECT pg_xlogfile_name(pg_current_xlog_location()); > pg_xlogfile_name >-------------------------- > 000000010000000000000003 >(1 row) > >=# SELECT pg_logical_emit_message(true, 'test', >repeat('0123456789ABCDEFG', 1024*1024)); > pg_logical_emit_message >------------------------- > 0/510CD40 >(1 row) > >=# SELECT pg_xlogfile_name(pg_current_xlog_location()); > pg_xlogfile_name >-------------------------- > 000000010000000000000005 >(1 row) > >=# insert into t values(0,0); >INSERT 0 1 >postgres=# SELECT pg_xlogfile_name(pg_current_xlog_location()); > pg_xlogfile_name >-------------------------- > 000000010000000000000005 >(1 row) > >The WAL record of pg_logical_emit_message() should be stored in >000000010000000000000004 and 000000010000000000000005. >The WAL record of last insertion should be stored in >000000010000000000000005. >But the results of pg_xlogdump were wrong as follows. > >$ pg_xlogdump data/pg_xlog/000000010000000000000004 >rmgr: Standby len (rec/tot): 24/ 50, tx: 0, lsn: >0/04000028, prev 0/030146F8, desc: RUNNING_XACTS nextXid 863 >latestCompletedXid 862 oldestRunningXid 863 > >$ pg_xlogdump data/pg_xlog/000000010000000000000005 >pg_xlogdump: FATAL: could not find a valid record after 0/5000000 If you specify a file it only looks at records in that file. Try with -s. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers