Fix pg18 snapshot registered crash

naisila/pg18_testing
naisila 2025-09-16 14:24:56 +03:00
parent 50f9d893d3
commit 4816d520b6
1 changed files with 3 additions and 0 deletions

View File

@ -1510,6 +1510,8 @@ ReadDataFileStripeList(uint64 storageId, Snapshot snapshot)
Oid indexId = ColumnarStripeFirstRowNumberIndexRelationId();
bool indexOk = OidIsValid(indexId);
snapshot = RegisterSnapshot(snapshot);
SysScanDesc scanDescriptor = systable_beginscan(columnarStripes, indexId,
indexOk, snapshot, 1, scanKey);
@ -1529,6 +1531,7 @@ ReadDataFileStripeList(uint64 storageId, Snapshot snapshot)
systable_endscan(scanDescriptor);
table_close(columnarStripes, AccessShareLock);
UnregisterSnapshot(snapshot);
return stripeMetadataList;
}