PG18: fix yet another unregistered snapshot crash (#8228)

PG18 added an assertion that a snapshot is active or registered before
it's used. Relevant PG commit
8076c00592

Fixes #8209
pull/8227/head
Naisila Puka 2025-10-07 11:31:41 +03:00 committed by GitHub
parent d4dfdd765b
commit 5a3648b2cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -1245,10 +1245,14 @@ LogRelationStats(Relation rel, int elevel)
foreach(stripeMetadataCell, stripeList) foreach(stripeMetadataCell, stripeList)
{ {
StripeMetadata *stripe = lfirst(stripeMetadataCell); StripeMetadata *stripe = lfirst(stripeMetadataCell);
Snapshot snapshot = RegisterSnapshot(GetTransactionSnapshot());
StripeSkipList *skiplist = ReadStripeSkipList(relfilelocator, stripe->id, StripeSkipList *skiplist = ReadStripeSkipList(relfilelocator, stripe->id,
RelationGetDescr(rel), RelationGetDescr(rel),
stripe->chunkCount, stripe->chunkCount,
GetTransactionSnapshot()); snapshot);
UnregisterSnapshot(snapshot);
for (uint32 column = 0; column < skiplist->columnCount; column++) for (uint32 column = 0; column < skiplist->columnCount; column++)
{ {
bool attrDropped = Attr(tupdesc, column)->attisdropped; bool attrDropped = Attr(tupdesc, column)->attisdropped;