visible_debug.patch
application/octet-stream
Filename: visible_debug.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| ../../postgresql-9.0.3/src/backend/commands/vacuumlazy.c | 11 | 2 |
--- backend/commands/vacuumlazy.c 2011-01-27 20:21:31.000000000 -0600
+++ ../../postgresql-9.0.3/src/backend/commands/vacuumlazy.c 2011-03-03 08:55:08.000000000 -0600
@@ -349,6 +349,7 @@ lazy_scan_heap(Relation onerel, LVRelSta
Size freespace;
bool all_visible_according_to_vm = false;
bool all_visible;
+ char *reason;
/*
* Skip pages that don't require vacuuming according to the visibility
@@ -500,6 +501,7 @@ lazy_scan_heap(Relation onerel, LVRelSta
* requiring freezing.
*/
all_visible = true;
+ reason = "";
nfrozen = 0;
hastup = false;
prev_dead_count = vacrelstats->num_dead_tuples;
@@ -538,6 +540,7 @@ lazy_scan_heap(Relation onerel, LVRelSta
{
lazy_record_dead_tuple(vacrelstats, &(tuple.t_self));
all_visible = false;
+ reason = "dead item";
continue;
}
@@ -573,6 +576,7 @@ lazy_scan_heap(Relation onerel, LVRelSta
else
tupgone = true; /* we can delete the tuple */
all_visible = false;
+ reason = "dead heaptuple";
break;
case HEAPTUPLE_LIVE:
/* Tuple is good --- but let's do some validity checks */
@@ -597,6 +601,7 @@ lazy_scan_heap(Relation onerel, LVRelSta
if (!(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED))
{
all_visible = false;
+ reason = "!HEAP_XMIN_COMMITTED";
break;
}
@@ -608,6 +613,7 @@ lazy_scan_heap(Relation onerel, LVRelSta
if (!TransactionIdPrecedes(xmin, OldestXmin))
{
all_visible = false;
+ reason = "OldestXmin";
break;
}
}
@@ -620,14 +626,17 @@ lazy_scan_heap(Relation onerel, LVRelSta
*/
nkeep += 1;
all_visible = false;
+ reason = "RecentlyDead";
break;
case HEAPTUPLE_INSERT_IN_PROGRESS:
/* This is an expected case during concurrent vacuum */
all_visible = false;
+ reason = "InsertInProgress";
break;
case HEAPTUPLE_DELETE_IN_PROGRESS:
/* This is an expected case during concurrent vacuum */
all_visible = false;
+ reason = "DeleteInProgress";
break;
default:
elog(ERROR, "unexpected HeapTupleSatisfiesVacuum result");
@@ -705,8 +714,8 @@ lazy_scan_heap(Relation onerel, LVRelSta
}
else if (PageIsAllVisible(page) && !all_visible)
{
- elog(WARNING, "PD_ALL_VISIBLE flag was incorrectly set in relation \"%s\" page %u",
- relname, blkno);
+ elog(WARNING, "PD_ALL_VISIBLE flag was incorrectly set in relation \"%s\" page %u via %s",
+ relname, blkno, reason);
PageClearAllVisible(page);
SetBufferCommitInfoNeedsSave(buf);