hs-default-serializable-v1.diff
application/octet-stream
Filename: hs-default-serializable-v1.diff
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch v1
| File | + | − |
|---|---|---|
| src/backend/utils/time/snapmgr.c | 12 | 0 |
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 5aebbd1..6c5e76c 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -163,9 +163,17 @@ GetTransactionSnapshot(void)
{
/* First, create the snapshot in CurrentSnapshotData */
if (IsolationIsSerializable())
+ {
+ if (RecoveryInProgress())
+ ereport(ERROR,
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("can not create a serializable snapshot during recovery")));
+
CurrentSnapshot = GetSerializableTransactionSnapshot(&CurrentSnapshotData);
+ }
else
CurrentSnapshot = GetSnapshotData(&CurrentSnapshotData);
+
/* Make a saved copy */
CurrentSnapshot = CopySnapshot(CurrentSnapshot);
FirstXactSnapshot = CurrentSnapshot;
@@ -290,6 +298,10 @@ SetTransactionSnapshot(Snapshot sourcesnap, TransactionId sourcexid)
*/
if (IsolationUsesXactSnapshot())
{
+ /*
+ * Since GetSnapshotData() is called above, it would be redundant to
+ * check RecoveryInProgress() for a serializable transaction here.
+ */
if (IsolationIsSerializable())
SetSerializableTransactionSnapshot(CurrentSnapshot, sourcexid);
/* Make a saved copy */