Potential GIN vacuum bug

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Potential GIN vacuum bug
Date: 2015-08-15 21:58:16
Message-ID: CAMkU=1xALfLhUUohFP5v33RzedLVb5aknNUjcEuM9KNBKrB6-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When ginbulkdelete gets called for the first time in a VACUUM(i.e. stats
== NULL), one of the first things it does is call ginInsertCleanup to get
rid of the pending list. It does this in lieu of vacuuming the pending
list.

This is important because if there are any dead tids still in the Pending
list, someone else could come along during the vacuum and post the dead
tids into a part of the index that VACUUM has already passed over.

The potential bug is that ginInsertCleanup exits early (ginfast.c lines
796, 860, 898) if it detects that someone else is cleaning up the pending
list, without waiting for that someone else to finish the job.

Isn't this a problem?

Cheers,

Jeff

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Johnston 2015-08-15 22:45:41 DTrace build dependency rules
Previous Message Tom Lane 2015-08-15 19:05:59 Re: Small improvement to get_base_rel_indexes()