File tree 2 files changed +39
-4
lines changed 2 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -5028,9 +5028,6 @@ char* MtmGucSerialize(void)
5028
5028
5029
5029
static void MtmProcessDDLCommand (char const * queryString , bool transactional )
5030
5030
{
5031
- if (MtmTx .isReplicated )
5032
- return ;
5033
-
5034
5031
if (transactional )
5035
5032
{
5036
5033
char * gucCtx = MtmGucSerialize ();
@@ -5462,7 +5459,7 @@ static void MtmProcessUtility(PlannedStmt *pstmt,
5462
5459
break ;
5463
5460
}
5464
5461
5465
- if (!skipCommand && !MtmTx . isReplicated && ! MtmDDLStatement )
5462
+ if (!skipCommand && !MtmDDLStatement )
5466
5463
{
5467
5464
MTM_LOG3 ("Process DDL statement '%s', MtmTx.isReplicated=%d, "
5468
5465
"MtmIsLogicalReceiver=%d" , stmt_string , MtmTx .isReplicated ,
Original file line number Diff line number Diff line change
1
+ import unittest
2
+ import subprocess
3
+ import time
4
+
5
+ from mm_cluster import Cluster
6
+
7
+ NUM_NODES = 3
8
+
9
+ class TestDDL (unittest .TestCase ):
10
+
11
+ @classmethod
12
+ def setUpClass (cls ):
13
+ cls .cluster = Cluster (NUM_NODES )
14
+ cls .cluster .print_conninfo ()
15
+ cls .cluster .start ().await_online ((0 ,1 ,2 ))
16
+ # cls.cluster.print_conninfo()
17
+
18
+ @classmethod
19
+ def tearDownClass (cls ):
20
+ cls .cluster .stop ()
21
+
22
+ # Check that recovery properly processes
23
+ def test_dll_recovery (self ):
24
+ # create table while one node is stopped
25
+ self .cluster .nodes [2 ].stop ()
26
+ self .cluster .await_online ((0 ,1 ))
27
+ self .cluster .nodes [0 ].safe_psql (query = 'create table t(id int primary key)' )
28
+
29
+ # now if second node didn't store logical message with DDL and third
30
+ # node will recover from second then it will not receive this
31
+ # 'create table' (PGPRO-1699)
32
+ self .cluster .nodes [2 ].start ()
33
+ self .cluster .await_online ((0 ,1 ,2 ))
34
+ self .cluster .nodes [2 ].safe_psql (query = 'insert into t values(42)' )
35
+
36
+
37
+ if __name__ == '__main__' :
38
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments