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: sbernikov@gmail.com
Subject: BUG #17055: Logical replication worker crashes when applying update of row that dose not exist in target partiti
Date: Thu, 10 Jun 2021 09:36:36 +0000
Message-ID: <17055-9ba800ec8522668b@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17055
Logged by:          Sergey Bernikov
Email address:      sbernikov@gmail.com
PostgreSQL version: 13.3
Operating system:   Ubuntu 18.04.4
Description:        

This error happens when logical replication target is partitioned table.

Steps to reproduce:
1. in source DB: create table and add to publication
	create table test_replication (
	  id int not null,
	  value varchar(100),
	  primary key (id)
	);
create publication test_publication for table test_replication;

2. in target DB: create partitioned table and start replication
	create table test_replication (
	  id int not null,
	  value varchar(100),
	  primary key (id)
	) partition by range (id);
	create table test_replication_p_1 partition of test_replication
	   for values from (0) to (10);
	create table test_replication_p_2 partition of test_replication
	   for values from (10) to (20);
 
	create subscription test_subscription CONNECTION '...' publication
test_publication;
 
3. in source DB: insert data
	insert into test_replication(id, value) values (1, 'a1');

4. in target DB: delete data
	delete from test_replication where id = 1;

5. in source DB: update data
	update test_replication set value = 'a2' where id = 1;

Result: logical replication worker on target server crashes with different
error message:

Fragment of log output:
2021-06-07 19:51:13.480 +06 [82800] DEBUG:  logical replication did not find
row for update in replication target relation "test_replication_p_1"
2021-06-07 19:51:13.491 +06 [82800] ERROR:  could not access status of
transaction 1226709024
2021-06-07 19:51:13.491 +06 [82800] DETAIL:  Could not open file
"pg_subtrans/491E": No such file or directory.
2021-06-07 19:51:13.493 +06 [82797] DEBUG:  starting logical replication
worker for subscription "test_subscription"
2021-06-07 19:51:13.493 +06 [80587] DEBUG:  registering background worker
"logical replication worker for subscription 781420"
2021-06-07 19:51:13.493 +06 [80587] DEBUG:  starting background worker
process "logical replication worker for subscription 781420"
2021-06-07 19:51:13.501 +06 [28356] LOG:  logical replication apply worker
for subscription "test_subscription" has started
2021-06-07 19:51:13.501 +06 [28356] DEBUG:  connecting to publisher using
connection string "....."
2021-06-07 19:51:13.508 +06 [80587] DEBUG:  unregistering background worker
"logical replication worker for subscription 781420"
2021-06-07 19:51:13.508 +06 [80587] LOG:  background worker "logical
replication worker" (PID 82800) exited with exit code 1
2021-06-07 19:51:13.563 +06 [28356] DEBUG:  logical replication did not find
row for update in replication target relation "test_replication_p_1"
2021-06-07 19:52:31.575 +06 [80587] LOG:  background worker "logical
replication worker" (PID 28356) was terminated by signal 11: Segmentation
fault
2021-06-07 19:52:31.575 +06 [80587] LOG:  terminating any other active
server processes



view thread (17+ messages)  latest in thread

Message-ID: <17055-9ba800ec8522668b@postgresql.org>
Permalink:  ../17055-9ba800ec8522668b@postgresql.org/
Also on:    postgresql.org/message-id/17055-9ba800ec8522668b@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, sbernikov@gmail.com
  Subject: Re: BUG #17055: Logical replication worker crashes when applying update of row that dose not exist in target partiti
  In-Reply-To: <17055-9ba800ec8522668b@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