Different table schema in logical replication crashes

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Different table schema in logical replication crashes
Date: 2017-04-13 03:04:59
Message-ID: CAHE3wgj+2YpFyrg7SAV=-oqTpP2AggT-nRKbR3nkDAt0TA2V6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

If a certain table has different schemas and the subscriber table has an
unmatched column with a not null constraint, the logical replication
crashes with the above stack trace.

-- publisher
CREATE TABLE test (a integer, b varchar not null, c numeric not null,
PRIMARY KEY(a));
-- subscriber
CREATE TABLE test (a integer, b varchar not null, c numeric not null, d
integer not null, PRIMARY KEY(a));

Program terminated with signal SIGSEGV, Segmentation fault.
#0 list_nth_cell (n=0, list=0x0) at list.c:411
411 {
(gdb) bt
#0 list_nth_cell (n=0, list=0x0) at list.c:411
#1 list_nth (list=0x0, n=0) at list.c:413
#2 0x00000000005ddc6b in ExecConstraints
(resultRelInfo=resultRelInfo(at)entry=0xf96868,
slot=slot(at)entry=0xf984d8, estate=estate(at)entry=0xfc3808) at execMain.c:1881
#3 0x000000000057b0ba in CopyFrom (cstate=0xf980c8) at copy.c:2652
#4 0x00000000006ae3bb in copy_table (rel=<optimized out>) at
tablesync.c:682
#5 LogicalRepSyncTableStart (origin_startpos=0x7ffe9c340640) at
tablesync.c:789
#6 0x00000000006afb0f in ApplyWorkerMain (main_arg=<optimized out>) at
worker.c:1521
#7 0x0000000000684813 in StartBackgroundWorker () at bgworker.c:838
#8 0x000000000068f6a2 in do_start_bgworker (rw=0xf0cbb0) at
postmaster.c:5577
#9 maybe_start_bgworker () at postmaster.c:5761
#10 0x0000000000690195 in sigusr1_handler (postgres_signal_arg=<optimized
out>) at postmaster.c:5015
#11 <signal handler called>
#12 0x00007fcd075f6873 in __select_nocancel () at
../sysdeps/unix/syscall-template.S:81
#13 0x0000000000476c0c in ServerLoop () at postmaster.c:1693
#14 0x0000000000691342 in PostmasterMain (argc=argc(at)entry=1,
argv=argv(at)entry=0xee4eb0)
at postmaster.c:1337
#15 0x0000000000478684 in main (argc=1, argv=0xee4eb0) at main.c:228

Are we prepared to support different schemas in v10? Or should we disallow
it for v10 and add a TODO?

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
<http://www.timbira.com.br>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2017-04-13 03:11:33 Re: Remove pg_stat_progress_vacuum from Table 28.2
Previous Message Corey Huinker 2017-04-13 02:59:00 Re: delta relations in AFTER triggers