Re: Bugs in TOAST handling, OID assignment and redo recovery
Pavan Deolasee <pavan.deolasee@gmail.com>
From: Pavan Deolasee <pavan.deolasee@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-11T18:43:18Z
Lists: pgsql-hackers
Attachments
- 0002-Do-more-extensive-search-while-looking-for-duplicate.patch (application/octet-stream) patch 0002
- 0001-Do-not-overwrite-the-nextOid-counter-while-replaying.patch (application/octet-stream) patch 0001
On Wed, Apr 11, 2018 at 8:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Pavan Deolasee <pavan.deolasee@gmail.com> writes: > > Or may be we simply err on the side of caution and scan the toast table > > with SnapshotAny while looking for a duplicate? That might prevent us > from > > reusing an OID for a known-dead tuple, but should save us a second index > > scan and still work. > > +1. We really don't want to expend two indexscans on this. > > Ok. I propose attached patches, more polished this time. I also changed toastrel_valueid_exists() to use SnapshotAny, but I don't have any proofs to claim that's a needed change. But it seems harmless and given the number of toast related, hard to chase bugs we have seen over the years, may it's worth making it full proof too. Thanks, Pavan -- Pavan Deolasee http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Ignore nextOid when replaying an ONLINE checkpoint.
- efbe36a2c1b0 9.5.13 landed
- 6943fb9275a5 9.4.18 landed
- 66d4b6bb8065 9.3.23 landed
- 060bb38d0750 9.6.9 landed
- d1e9079295e9 11.0 landed
- 08e6cda1c536 10.4 landed
-
Do not select new object OIDs that match recently-dead entries.
- 7448e7e23799 9.3.23 landed
- 5b3ed6b7880b 9.4.18 landed
- 3767216fbdb3 9.5.13 landed
- 8bba10f7e834 9.6.9 landed
- 5a11bf970705 10.4 landed
- 0408e1ed599b 11.0 landed