This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 2d61bf5266dea8c786113886a19ca8986ceafaf6
Author: Piyush Chandwadkar <[email protected]>
AuthorDate: Fri Jun 23 17:37:17 2023 +0530

    starting segments in execute mode post recovery (#15599)
    
    After recovery, the segment should start in execute mode.
    Currently, gprecoverseg starts the segment in utility mode after the 
recovery.
    With these changes make sure the segment is started in execute mode.
    Added tests to confirm segments are in execute mode after recovery.
    Currently testing if the segment is in utility mode by connecting to
    individual segments and checking the error thrown.
---
 gpMgmt/sbin/gpsegrecovery.py                                 | 2 +-
 gpMgmt/test/behave/mgmt_utils/gprecoverseg.feature           | 9 +++++++++
 gpMgmt/test/behave/mgmt_utils/steps/tablespace_mgmt_utils.py | 1 -
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gpMgmt/sbin/gpsegrecovery.py b/gpMgmt/sbin/gpsegrecovery.py
index 6b9f31bf3e..811a73ccbb 100644
--- a/gpMgmt/sbin/gpsegrecovery.py
+++ b/gpMgmt/sbin/gpsegrecovery.py
@@ -100,7 +100,7 @@ def start_segment(recovery_info, logger, era):
         , numContentsInCluster=0
         , era=era
         , mirrormode="mirror"
-        , utilityMode=True)
+        , utilityMode=False)
     logger.info(str(cmd))
     cmd.run(validateAfter=True)
 
diff --git a/gpMgmt/test/behave/mgmt_utils/gprecoverseg.feature 
b/gpMgmt/test/behave/mgmt_utils/gprecoverseg.feature
index 0e3e2501f5..3ba2d27e97 100644
--- a/gpMgmt/test/behave/mgmt_utils/gprecoverseg.feature
+++ b/gpMgmt/test/behave/mgmt_utils/gprecoverseg.feature
@@ -10,6 +10,7 @@ Feature: gprecoverseg tests
          Then gprecoverseg should return a return code of 0
           And the segments are synchronized
           And the tablespace is valid
+          And the database segments are in execute mode
 
         Given another tablespace is created with data
          When the user runs "gprecoverseg -ra"
@@ -17,6 +18,12 @@ Feature: gprecoverseg tests
           And the segments are synchronized
           And the tablespace is valid
           And the other tablespace is valid
+          And the database segments are in execute mode
+      Examples:
+        | scenario     | args               |
+        | incremental  | -a                 |
+        | differential | -a --differential  |
+        | full         | -aF                |
 
     Scenario: full recovery works with tablespaces
         Given the database is running
@@ -368,6 +375,7 @@ Feature: gprecoverseg tests
     Then gprecoverseg should return a return code of 0
     And the segments are synchronized
     And the tablespace is valid
+    And the database segments are in execute mode
 
     Given another tablespace is created with data
     When the user runs "gprecoverseg -ra"
@@ -375,6 +383,7 @@ Feature: gprecoverseg tests
     And the segments are synchronized
     And the tablespace is valid
     And the other tablespace is valid
+    And the database segments are in execute mode
 
   @concourse_cluster
   Scenario: full recovery works with tablespaces on a multi-host environment
diff --git a/gpMgmt/test/behave/mgmt_utils/steps/tablespace_mgmt_utils.py 
b/gpMgmt/test/behave/mgmt_utils/steps/tablespace_mgmt_utils.py
index 19043b2a59..9829ba4a12 100644
--- a/gpMgmt/test/behave/mgmt_utils/steps/tablespace_mgmt_utils.py
+++ b/gpMgmt/test/behave/mgmt_utils/steps/tablespace_mgmt_utils.py
@@ -197,7 +197,6 @@ def impl(context):
 def impl(context):
     context.tablespaces["myspace"].verify()
 
-
 @then('the tablespace is valid after gpexpand')
 def impl(context):
     for _, tbs in list(context.tablespaces.items()):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to