aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2016-04-28 16:21:42 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2016-04-28 16:21:42 +0300
commite2c79e14d998cd31f860854bc9210b37b457bb01 (patch)
treebedcad1d73d8998217847c495220f4b4b7220b35 /src/backend/access/gist
parentad520ec4acb8f0cdb143b63519be95a9549fa826 (diff)
downloadpostgresql-e2c79e14d998cd31f860854bc9210b37b457bb01.tar.gz
postgresql-e2c79e14d998cd31f860854bc9210b37b457bb01.zip
Prevent multiple cleanup process for pending list in GIN.
Previously, ginInsertCleanup could exit early if it detects that someone else is cleaning up the pending list, without waiting for that someone else to finish the job. But in this case vacuum could miss tuples to be deleted. Cleanup process now locks metapage with a help of heavyweight LockPage(ExclusiveLock), and it guarantees that there is no another cleanup process at the same time. Lock is taken differently depending on caller of cleanup process: any vacuums and gin_clean_pending_list() will be blocked until lock becomes available, ordinary insert uses conditional lock to prevent indefinite waiting on lock. Insert into pending list doesn't use this lock, so insertion isn't blocked. Also, patch adds stopping of cleanup process when at-start-cleanup-tail is reached in order to prevent infinite cleanup in case of massive insertion. But it will stop only for automatic maintenance tasks like autovacuum. Patch introduces choice of limit of memory to use: autovacuum_work_mem, maintenance_work_mem or work_mem depending on call path. Patch for previous releases should be reworked due to changes between 9.6 and previous ones in this area. Discover and diagnostics by Jeff Janes and Tomas Vondra Patch by me with some ideas of Jeff Janes
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions