Potential GIN vacuum bug - Mailing list pgsql-hackers

From Jeff Janes
Subject Potential GIN vacuum bug
Date
Msg-id CAMkU=1xALfLhUUohFP5v33RzedLVb5aknNUjcEuM9KNBKrB6-Q@mail.gmail.com
Whole thread Raw
Responses Re: Potential GIN vacuum bug
List 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small improvement to get_base_rel_indexes()
Next
From: Noah Misch
Date:
Subject: Re: Autonomous Transaction is back