Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc623e85

Browse files
Reduce scope of heap vacuum per_buffer_data
Move lazy_scan_heap()'s per_buffer_data variable into a tighter scope.In lazy_scan_heap()'s phase I heap vacuuming, the read stream APIreturns a pointer to the next block number to vacuum. As long asread_stream_next_buffer() returns a valid buffer, per_buffer_data shouldalways be valid.Move per_buffer_data into a tighter scope and make sure it is reset toNULL on each iteration so that we get a core dump instead of bogus datafrom a previous block if something goes wrong in the read stream API.Suggested-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/626104.1739729538%40sss.pgh.pa.us
1 parent95ef3d9 commitc623e85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/heap/vacuumlazy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,6 @@ lazy_scan_heap(LVRelState *vacrel)
11921192
BlockNumberrel_pages=vacrel->rel_pages,
11931193
blkno=0,
11941194
next_fsm_block_to_vacuum=0;
1195-
void*per_buffer_data=NULL;
11961195
BlockNumberorig_eager_scan_success_limit=
11971196
vacrel->eager_scan_remaining_successes;/* for logging */
11981197
Buffervmbuffer=InvalidBuffer;
@@ -1231,6 +1230,7 @@ lazy_scan_heap(LVRelState *vacrel)
12311230
Pagepage;
12321231
uint8blk_info=0;
12331232
boolhas_lpdead_items;
1233+
void*per_buffer_data=NULL;
12341234
boolvm_page_frozen= false;
12351235
boolgot_cleanup_lock= false;
12361236

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp