@@ -294,6 +294,8 @@ typedef struct SubXactCallbackItem
294
294
295
295
static SubXactCallbackItem * SubXact_callbacks = NULL ;
296
296
297
+ static bool xactHasCatcacheInvalidationMessages ;
298
+ static bool xactHasRelcacheInvalidationMessages ;
297
299
298
300
/* local function prototypes */
299
301
static void AssignTransactionId (TransactionState s );
@@ -1850,7 +1852,9 @@ typedef struct {
1850
1852
void * TriggerState ;
1851
1853
void * SPIState ;
1852
1854
void * SnapshotState ;
1855
+ struct TransInvalidationInfo * InvalidationInfo ;
1853
1856
}SuspendedTransactionState ;
1857
+
1854
1858
static int suspendedXactNum = 0 ;
1855
1859
static SuspendedTransactionState suspendedXacts [MAX_SUSPENDED_XACTS ];
1856
1860
@@ -2168,6 +2172,8 @@ CommitTransaction(void)
2168
2172
* waiting for lock on a relation we've modified, we want them to know
2169
2173
* about the catalog change before they start using the relation).
2170
2174
*/
2175
+ xactHasCatcacheInvalidationMessages = HasCatcacheInvalidationMessages ();
2176
+ xactHasRelcacheInvalidationMessages = HasRelcacheInvalidationMessages ();
2171
2177
AtEOXact_Inval (true);
2172
2178
2173
2179
AtEOXact_MultiXact ();
@@ -2662,6 +2668,8 @@ AbortTransaction(void)
2662
2668
AtEOXact_Buffers (false);
2663
2669
}
2664
2670
AtEOXact_RelationCache (false);
2671
+ xactHasCatcacheInvalidationMessages = HasCatcacheInvalidationMessages ();
2672
+ xactHasRelcacheInvalidationMessages = HasRelcacheInvalidationMessages ();
2665
2673
AtEOXact_Inval (false);
2666
2674
AtEOXact_MultiXact ();
2667
2675
ResourceOwnerRelease (TopTransactionResourceOwner ,
@@ -3504,7 +3512,20 @@ void SuspendTransaction(void)
3504
3512
SuspendedTransactionState * sus = suspendedXacts + suspendedXactNum ++ ;
3505
3513
3506
3514
sus -> TopTransactionStateData = TopTransactionStateData ;
3515
+
3507
3516
sus -> SnapshotState = SuspendSnapshot ();/* only before the resource-owner stuff */
3517
+
3518
+ if (HasCatcacheInvalidationMessages ())
3519
+ {
3520
+ ResetCatalogCaches ();
3521
+ }
3522
+ if (HasRelcacheInvalidationMessages ())
3523
+ {
3524
+ RelationCacheInvalidate ();
3525
+ }
3526
+ sus -> InvalidationInfo = SuspendInvalidationInfo ();
3527
+ xactHasCatcacheInvalidationMessages = false;
3528
+ xactHasRelcacheInvalidationMessages = false;
3508
3529
3509
3530
tts = & TopTransactionStateData ;
3510
3531
tts -> state = TRANS_INPROGRESS ;
@@ -3610,6 +3631,15 @@ bool ResumeTransaction(void)
3610
3631
TopTransactionResourceOwner = sus -> TopTransactionResourceOwner ;
3611
3632
3612
3633
ResumeSnapshot (sus -> SnapshotState );/* only after the resource-owner stuff */
3634
+ ResumeInvalidationInfo (sus -> InvalidationInfo );
3635
+ if (xactHasCatcacheInvalidationMessages )
3636
+ {
3637
+ ResetCatalogCaches ();
3638
+ }
3639
+ if (xactHasRelcacheInvalidationMessages )
3640
+ {
3641
+ RelationCacheInvalidate ();
3642
+ }
3613
3643
3614
3644
MyProc -> backendId = sus -> vxid .backendId ;
3615
3645
MyProc -> lxid = sus -> vxid .localTransactionId ;