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

Commitcd38b7e

Browse files
Assert that cutoffs are provided if freezing will be attempted
heap_page_prune_and_freeze() requires the caller to initializePruneFreezeParams->cutoffs so that the function can correctly evaluatewhether tuples should be frozen. This requirement previously existedonly in comments and was easy to miss, especially after “cutoffs” wasconverted from a direct function parameter to a field of the newlyintroduced PruneFreezeParams struct (added in1937ed7). Adding anassert makes this requirement explicit and harder to violate.Also, fix a minor typo while we're at it.Author: Chao Li <li.evan.chao@gmail.com>Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>Discussion:https://postgr.es/m/0AC177F5-5E26-45EE-B273-357C51212AC5%40gmail.com
1 parent3b9c118 commitcd38b7e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ heap_page_will_freeze(Relation relation, Buffer buffer,
461461
* 'new_relmin_mxid' arguments are required when freezing. When
462462
* HEAP_PAGE_PRUNE_FREEZE option is passed, we also set presult->all_visible
463463
* and presult->all_frozen after determining whether or not to
464-
*opporunistically freeze, to indicate if the VM bits can be set. They are
464+
*opportunistically freeze, to indicate if the VM bits can be set. They are
465465
* always set to false when the HEAP_PAGE_PRUNE_FREEZE option is not passed,
466466
* because at the moment only callers that also freeze need that information.
467467
*
@@ -504,6 +504,9 @@ heap_page_prune_and_freeze(PruneFreezeParams *params,
504504
prstate.vistest=params->vistest;
505505
prstate.mark_unused_now=
506506
(params->options&HEAP_PAGE_PRUNE_MARK_UNUSED_NOW)!=0;
507+
508+
/* cutoffs must be provided if we will attempt freezing */
509+
Assert(!(params->options&HEAP_PAGE_PRUNE_FREEZE)||params->cutoffs);
507510
prstate.attempt_freeze= (params->options&HEAP_PAGE_PRUNE_FREEZE)!=0;
508511
prstate.cutoffs=params->cutoffs;
509512

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp