pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: nitesh@datacoral.co
Subject: BUG #15744: Replication slot peak query throwing error for wrong sequence entry for toast chunk
Date: Tue, 09 Apr 2019 20:09:19 +0000
Message-ID: <15744-ca657d03603b8220@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15744
Logged by:          Nitesh Yadav
Email address:      nitesh@datacoral.co
PostgreSQL version: 9.6.3
Operating system:   x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.3 2
Description:        

Hi, 

Postgres Server setup: 
  Postgres server is running as AWS rds instance. 
  Server Version is PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc
(GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit
  With the following parameters group rds.logical_replication is set to
1.Which internally set the following flags: wal_level, max_wal_senders,
max_replication_slots, max_connections.
  We are using test_decoding module for retrieving/read the WAL data through
the logical decoding mechanism.

Application setup: 
  Periodically we run the peek command to retrieve the data from the slot:
eg SELECT * FROM pg_logical_slot_peek_changes('pgldpublic_cdc_slot', NULL,
NULL, 'include-timestamp', 'on') LIMIT 200000 OFFSET 0; 
  From the above query result, we use location of last transaction to remove
the data from the slot: eg SELECT location, xid FROM 
  pg_logical_slot_get_changes('pgldpublic_cdc_slot', 'B92/C7394678', NULL,
'include-timestamp', 'on') LIMIT 1; 
  We runs Step 1 & 2 in the loop for reading data in the chunk of 200K
records at a time in a given process. 

Behavior reported (Bug)
  We have a replication slot running for successfully but recently we
encountered following error: 

error: got sequence entry 2 for toast chunk 30954054 instead of seq 0
at Connection.parseE
(/var/task/node_modules/datacoral-utils/node_modules/pg/lib/connection.js:555:11)
at Connection.parseMessage
(/var/task/node_modules/datacoral-utils/node_modules/pg/lib/connection.js:380:19)
at TLSSocket.<anonymous>
(/var/task/node_modules/datacoral-utils/node_modules/pg/lib/connection.js:120:22)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:607:20)

Temporary resolution
    After running the query 2-3 times, the error went away. But this causes
the whole process to shut down. 

Is there any permanent resolution for the issue or is it resolved in the
higher version of postgres? 

Regards,
Nitesh



view thread (3+ messages)  latest in thread

Message-ID: <15744-ca657d03603b8220@postgresql.org>
Permalink:  ../15744-ca657d03603b8220@postgresql.org/
Also on:    postgresql.org/message-id/15744-ca657d03603b8220@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, nitesh@datacoral.co
  Subject: Re: BUG #15744: Replication slot peak query throwing error for wrong sequence entry for toast chunk
  In-Reply-To: <15744-ca657d03603b8220@postgresql.org>
  References: <15744-ca657d03603b8220@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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