pgsql: Fix assertion failure in logical decoding.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix assertion failure in logical decoding.
Date: 2015-04-16 18:51:38
Message-ID: E1Yiot0-0003Cb-OM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2015-04-16 19:42:58 pgsql: MSVC: install src/test/modules together with contrib
Previous Message Alvaro Herrera 2015-04-16 18:28:45 pgsql: MSVC: Include modules of src/test/modules in build