Too rigorous assert in reorderbuffer.c
Arseny Sher <a.sher@postgrespro.ru>
From: Arseny Sher <a.sher@postgrespro.ru>
To: "pgsql-hackers" <pgsql-hackers@postgresql.org>,
Alexander Lakhin <a.lakhin@postgrespro.ru>
Date: 2019-01-31T06:21:59Z
Lists: pgsql-hackers
Attachments
Hi,
My colleague Alexander Lakhin has noticed an assertion failure in
reorderbuffer.c:1330. Here is a simple snippet reproducing it:
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
create table t(k int);
begin;
savepoint a;
alter table t alter column k type text;
rollback to savepoint a;
alter table t alter column k type bigint;
commit;
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
It is indeed too opinionated since cmax of a tuple is not stable; it can
be rewritten if subxact who tried to delete it later aborts (analogy
also holds for xmax). Attached patch removes it. While here, I had also
considered worthwhile to add a test involving DDL in aborted subxact as
it is interesting anyway and wasn't covered before.
Commits
-
Relax overly strict assertion
- f5f9a760a3bc 10.8 landed
- db02c179d7f5 9.6.13 landed
- c2e0954be363 11.3 landed
- 8c67d29fd51c 12.0 landed
- 45ed482f1a89 9.5.17 landed
- 350cdcd5e6dd 9.4.22 landed
-
Handle heap rewrites even better in logical decoding
- 325f2ec5557f 11.0 cited