]> granicus.if.org Git - postgresql/commit
Fix assertion failure in logical decoding.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 16 Apr 2015 18:00:55 +0000 (21:00 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 16 Apr 2015 18:50:07 +0000 (21:50 +0300)
commite2999abcd14540e66b72deeff75662c1672d7744
tree659a6849cc1b15a4db35214b18838882f23aa274
parent90898af30bb287a512bef743253770fc24886da6
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
src/backend/replication/logical/reorderbuffer.c
src/backend/replication/logical/snapbuild.c