pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. 5+ messages / 1 participants [nested] [flat]
* pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. @ 2012-02-21 20:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2012-02-21 20:04 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/593a9631a7947ab95903e87e24786d7e469cc988 Modified Files -------------- src/backend/access/nbtree/nbtpage.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. @ 2012-02-21 20:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2012-02-21 20:04 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/6182e01f18f71c48915e2aebb20362294de6e677 Modified Files -------------- src/backend/access/nbtree/nbtpage.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. @ 2012-02-21 20:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2012-02-21 20:04 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ REL9_0_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/e0eb63238a8ba66e685ac2308d1f597e15cb4216 Modified Files -------------- src/backend/access/nbtree/nbtpage.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. @ 2012-02-21 20:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2012-02-21 20:04 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ REL8_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/7b6a37f5ec2e99e70715a34916eac78bad928def Modified Files -------------- src/backend/access/nbtree/nbtinsert.c | 2 +- src/backend/access/nbtree/nbtpage.c | 10 ++++++---- src/backend/access/nbtree/nbtree.c | 2 +- src/include/access/nbtree.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. @ 2012-02-21 20:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2012-02-21 20:04 UTC (permalink / raw) To: pgsql-committers 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. Branch ------ REL8_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/2c293f25494f2d465bcff49d7aab6ec06a40e436 Modified Files -------------- src/backend/access/nbtree/nbtinsert.c | 2 +- src/backend/access/nbtree/nbtpage.c | 10 ++++++---- src/backend/access/nbtree/nbtree.c | 2 +- src/include/access/nbtree.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2012-02-21 20:04 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2012-02-21 20:04 pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. Tom Lane <tgl@sss.pgh.pa.us> 2012-02-21 20:04 pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. Tom Lane <tgl@sss.pgh.pa.us> 2012-02-21 20:04 pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. Tom Lane <tgl@sss.pgh.pa.us> 2012-02-21 20:04 pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. Tom Lane <tgl@sss.pgh.pa.us> 2012-02-21 20:04 pgsql: Don't clear btpo_cycleid during _bt_vacuum_one_page. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox