diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-21 15:03:56 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-21 15:03:56 -0500 |
| commit | 7b6a37f5ec2e99e70715a34916eac78bad928def (patch) | |
| tree | 26859d490115ad3a694cb2adf927723e872e348e /src/include | |
| parent | a863963fcdcc1d9cc3aac7e42ec696af4377cbc4 (diff) | |
Don't clear btpo_cycleid during _bt_vacuum_one_page.
When "vacuuming" a single btree page by removing LP_DEAD tuples, we are not
actually within a vacuum operation, but rather in an ordinary insertion
process that could well be running concurrently with a vacuum. So clearing
the cycleid is incorrect, and could cause the concurrent vacuum to miss
removing tuples that it needs to remove. This is a longstanding bug
introduced by commit e6284649b9e30372b3990107a082bc7520325676 of
2006-07-25. I believe it explains Maxim Boguk's recent report of index
corruption, and probably some other previously unexplained reports.
In 9.0 and up this is a one-line fix; before that we need to introduce a
flag to tell _bt_delitems what to do.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/nbtree.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 1d3e42d99bc..7656c488e11 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -537,7 +537,7 @@ extern void _bt_relbuf(Relation rel, Buffer buf); extern void _bt_pageinit(Page page, Size size); extern bool _bt_page_recyclable(Page page); extern void _bt_delitems(Relation rel, Buffer buf, - OffsetNumber *itemnos, int nitems); + OffsetNumber *itemnos, int nitems, bool inVacuum); extern int _bt_pagedel(Relation rel, Buffer buf, BTStack stack, bool vacuum_full); |
