debug-free-space.patch
application/octet-stream
Filename: debug-free-space.patch
Type: application/octet-stream
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/access/heap/hio.c | 4 | 0 |
| src/backend/storage/freespace/freespace.c | 4 | 0 |
diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index d854a84bf3..d2da5e2e6e 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -526,10 +526,14 @@ loop: * Update FSM as to condition of this page, and ask for another page * to try. */ +elog(DEBUG1, "Not enough space on block %u", targetBlock); targetBlock = RecordAndGetPageWithFreeSpace(relation, targetBlock, pageFreeSpace, len + saveFreeSpace); +if (targetBlock != InvalidBlockNumber) + elog(DEBUG1, "Now trying block %u", targetBlock); + } /* diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c index 46b95158db..762c1a9347 100644 --- a/src/backend/storage/freespace/freespace.c +++ b/src/backend/storage/freespace/freespace.c @@ -216,6 +216,8 @@ RecordAndGetPageWithFreeSpace(Relation rel, BlockNumber oldPage, rel->rd_rel->relkind == RELKIND_TOASTVALUE) && rel->fsm_local_map->map[oldPage] == FSM_LOCAL_AVAIL); +elog(DEBUG1, "Updating local map for block %u", oldPage); + rel->fsm_local_map->map[oldPage] = FSM_LOCAL_NOT_AVAIL; return fsm_local_search(rel); } @@ -235,6 +237,8 @@ RecordAndGetPageWithFreeSpace(Relation rel, BlockNumber oldPage, /* Normal FSM logic follows */ +elog(DEBUG1, "Updating FSM for block %u", oldPage); + old_cat = fsm_space_avail_to_cat(oldSpaceAvail); search_cat = fsm_space_needed_to_cat(spaceNeeded);