aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2020-04-10 17:44:08 -0700
committerPeter Geoghegan <pg@bowt.ie>2020-04-10 17:44:08 -0700
commit20fbb711ef43ef70093378ff5efdf1b6e8cc10d8 (patch)
tree688ec261c8b73f55f08b5fa7efd48df64dc5de8b /contrib
parentf333d35428c1cba8d35065b6dbb2dd46e18bd929 (diff)
downloadpostgresql-20fbb711ef43ef70093378ff5efdf1b6e8cc10d8.tar.gz
postgresql-20fbb711ef43ef70093378ff5efdf1b6e8cc10d8.zip
Add contrib/amcheck debug message.
Add a DEBUG1 message indicating that verification of the index structure is underway. Also reduce the severity level of the existing "tree level" debug message to DEBUG1. It should never have been made DEBUG2. Any B-Tree index with more than a couple of levels will generally also have so many pages that the per-page DEBUG2 messages will become completely unmanageable. In passing, add a new "Tip" to the docs that advises users that run into corruption that the debug messages might provide useful additional context.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/amcheck/verify_nbtree.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c
index ceaaa271680..7792b08b5f0 100644
--- a/contrib/amcheck/verify_nbtree.c
+++ b/contrib/amcheck/verify_nbtree.c
@@ -411,6 +411,13 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
BtreeLevel current;
Snapshot snapshot = SnapshotAny;
+ if (!readonly)
+ elog(DEBUG1, "verifying consistency of tree structure for index \"%s\"",
+ RelationGetRelationName(rel));
+ else
+ elog(DEBUG1, "verifying consistency of tree structure for index \"%s\" with cross-level checks",
+ RelationGetRelationName(rel));
+
/*
* RecentGlobalXmin assertion matches index_getnext_tid(). See note on
* RecentGlobalXmin/B-Tree page deletion.
@@ -654,7 +661,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
/* Use page-level context for duration of this call */
oldcontext = MemoryContextSwitchTo(state->targetcontext);
- elog(DEBUG2, "verifying level %u%s", level.level,
+ elog(DEBUG1, "verifying level %u%s", level.level,
level.istruerootlevel ?
" (true root level)" : level.level == 0 ? " (leaf level)" : "");