mirror of
https://github.com/postgres/postgres.git
synced 2025-12-24 06:01:07 +03:00
Refactor GetOldestXmin() to use flags
Replace ignoreVacuum parameter with more flexible flags. Author: Eiji Seki Review: Haribabu Kommi
This commit is contained in:
@@ -557,7 +557,7 @@ collect_corrupt_items(Oid relid, bool all_visible, bool all_frozen)
|
||||
if (all_visible)
|
||||
{
|
||||
/* Don't pass rel; that will fail in recovery. */
|
||||
OldestXmin = GetOldestXmin(NULL, true);
|
||||
OldestXmin = GetOldestXmin(NULL, PROCARRAY_FLAGS_VACUUM);
|
||||
}
|
||||
|
||||
rel = relation_open(relid, AccessShareLock);
|
||||
@@ -674,7 +674,7 @@ collect_corrupt_items(Oid relid, bool all_visible, bool all_frozen)
|
||||
* a buffer lock. And this shouldn't happen often, so it's
|
||||
* worth being careful so as to avoid false positives.
|
||||
*/
|
||||
RecomputedOldestXmin = GetOldestXmin(NULL, true);
|
||||
RecomputedOldestXmin = GetOldestXmin(NULL, PROCARRAY_FLAGS_VACUUM);
|
||||
|
||||
if (!TransactionIdPrecedes(OldestXmin, RecomputedOldestXmin))
|
||||
record_corrupt_item(items, &tuple.t_self);
|
||||
|
||||
@@ -70,7 +70,7 @@ statapprox_heap(Relation rel, output_type *stat)
|
||||
TransactionId OldestXmin;
|
||||
uint64 misc_count = 0;
|
||||
|
||||
OldestXmin = GetOldestXmin(rel, true);
|
||||
OldestXmin = GetOldestXmin(rel, PROCARRAY_FLAGS_VACUUM);
|
||||
bstrategy = GetAccessStrategy(BAS_BULKREAD);
|
||||
|
||||
nblocks = RelationGetNumberOfBlocks(rel);
|
||||
|
||||
Reference in New Issue
Block a user