pgsql: Fix assertion failure in logical decoding. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix assertion failure in logical decoding.
Date
Msg-id E1Yiot0-0003Cb-OM@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix assertion failure in logical decoding.

Logical decoding set SnapshotData's regd_count field to avoid the
snapshot manager from prematurely freeing snapshots that are generated
by the decoding system. That was always an abuse of the field, as it was
never supposed to be used outside the snapshot manager. Commit 94028691
made snapshot manager's tracking of the snapshots smarter, and that scheme
fell apart. The snapshot manager got confused and hit the assertion, when
a snapshot that was marked with regd_count==1 was not found in the heap,
where the snapshot manager tracks registered the snapshots.

To fix, don't abuse the regd_count field like that. Logical decoding still
abuses the active_count field for similar purposes, but that's currently
harmless.

The assertion failure was first reported by Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e2999abcd14540e66b72deeff75662c1672d7744

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c |    4 ++--
src/backend/replication/logical/snapbuild.c     |   10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: MSVC: Include modules of src/test/modules in build
Next
From: Alvaro Herrera
Date:
Subject: pgsql: MSVC: install src/test/modules together with contrib