]> granicus.if.org Git - postgresql/commit
Relax overly strict assertion
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 12 Feb 2019 21:42:37 +0000 (18:42 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 12 Feb 2019 21:42:37 +0000 (18:42 -0300)
commitf5f9a760a3bc2be95f8716e476150ce128efa22b
tree9cdefa07ea7782a6e22b1f4419838acae9e25f51
parent2a0edae47af453ef27ef7ff013beb7201f8549d8
Relax overly strict assertion

Ever since its birth, ReorderBufferBuildTupleCidHash() has contained an
assertion that a catalog tuple cannot change Cmax after acquiring one.  But
that's wrong: if a subtransaction executes DDL that affects that catalog
tuple, and later aborts and another DDL affects the same tuple, it will
change Cmax.  Relax the assertion to merely verify that the Cmax remains
valid and monotonically increasing, instead.

Add a test that tickles the relevant code.

Diagnosed by, and initial patch submitted by: Arseny Sher
Co-authored-by: Arseny Sher
Discussion: https://postgr.es/m/874l9p8hyw.fsf@ars-thinkpad
contrib/test_decoding/expected/ddl.out
contrib/test_decoding/sql/ddl.sql
src/backend/replication/logical/reorderbuffer.c