aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-07-19 16:25:53 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-07-19 16:25:53 -0500
commit1c15aac53f3421fd38ae145118d3204f055ba955 (patch)
tree9e8c992c305397eec8a77ba7c90928e8abe00d49 /src
parentb11e9bbc41d1906360f1fbaab133118e703de75a (diff)
downloadpostgresql-1c15aac53f3421fd38ae145118d3204f055ba955.tar.gz
postgresql-1c15aac53f3421fd38ae145118d3204f055ba955.zip
Add comment & docs about no vacuum truncation with sto.
Omission noted by Andres Freund.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/vacuumlazy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index 4075f4d1c92..231e92d8e46 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -1663,6 +1663,15 @@ lazy_cleanup_index(Relation indrel,
* Don't even think about it unless we have a shot at releasing a goodly
* number of pages. Otherwise, the time taken isn't worth it.
*
+ * Also don't attempt it if we are doing early pruning/vacuuming, because a
+ * scan which cannot find a truncated heap page cannot determine that the
+ * snapshot is too old to read that page. We might be able to get away with
+ * truncating all except one of the pages, setting its LSN to (at least) the
+ * maximum of the truncated range if we also treated an index leaf tuple
+ * pointing to a missing heap page as something to trigger the "snapshot too
+ * old" error, but that seems fragile and seems like it deserves its own patch
+ * if we consider it.
+ *
* This is split out so that we can test whether truncation is going to be
* called for before we actually do it. If you change the logic here, be
* careful to depend only on fields that lazy_scan_heap updates on-the-fly.