Example #1
0
    def test_full_recovery_with_persistent_tables_corruption(self):
        """
        [feature]: Run recoverseg with persistent tables corruption 
        
        """

        recoverseg = GpRecoverseg()
        tinctest.logger.info('Running gprecoverseg...')
        try:
            recoverseg.run(option='-F --persistent-check', validate=False)
        except Exception as e:
            tinctest.logger.info('Encountered exception while running full recovery with corrupt persistent table')
        self.assertIn('Performing persistent table check', recoverseg.stdout)
Example #2
0
    def test_do_full_recovery(self):
        """
        [feature]: Performs Full Recovery
        
        """

        config = GPDBConfig()
        recoverseg = GpRecoverseg()
        tinctest.logger.info('Running Full gprecoverseg...')
        recoverseg.run(option = '-F')
        rtrycnt = 0
        while (not config.is_not_insync_segments()):
            tinctest.logger.info("Waiting [%s] for DB to recover" %rtrycnt)
            rtrycnt = rtrycnt + 1
Example #3
0
    def test_full_recovery_skip_persistent_tables_check(self):
        """
        [feature]: Run recoverseg with persistent tables check option 
        
        """

        config = GPDBConfig()
        recoverseg = GpRecoverseg()
        tinctest.logger.info('Running gprecoverseg...')
        recoverseg.run(option='-F')
        self.assertNotIn('Performing persistent table check', recoverseg.stdout)
        rtrycnt = 0
        while (not config.is_not_insync_segments()):
            tinctest.logger.info("Waiting [%s] for DB to recover" %rtrycnt)
            rtrycnt = rtrycnt + 1
Example #4
0
 def test_invalid_state_recoverseg(self):
     """
     [feature]: Sets the ENV_VAR and runs the incremental recoverseg
     
     """
     '''  '''
     # setting the ENV_VAR
     os.environ[ENV_VAR] = '1'
     recoverseg = GpRecoverseg()
     config = GPDBConfig()
     tinctest.logger.info('Running Incremental gprecoverseg...')
     recoverseg.run()
     rtrycnt = 0
     while (not config.is_not_insync_segments()):
         tinctest.logger.info("Waiting [%s] for DB to recover" %rtrycnt)
         rtrycnt = rtrycnt + 1
Example #5
0
 def recover_segments(self,option,max_rtrycnt):
     """
     @summary: Recovers the segments and returns the status of recovery process.
     
     @param option: represents different gprecoverseg command options
     @param max_rtrycnt: the max no. of times state of cluster should be checked
     @return: Boolean value representing the status of recovery process
     """
     
     config = GPDBConfig()
     recoverseg = GpRecoverseg()
     tinctest.logger.info("Running gprecoverseg with '%s' option..."%option)
     recoverseg.run(option)
     rtrycnt = 0
     while ((config.is_not_insync_segments()) == False and rtrycnt <= max_rtrycnt):
         tinctest.logger.info("Waiting [%s] for DB to recover" %rtrycnt)
         sleep(10)
         rtrycnt = rtrycnt + 1
     if rtrycnt > max_rtrycnt:
         return False
     else:
         return True
Example #6
0
 def recover_segments(self,option,max_rtrycnt):
     """
     @summary: Recovers the segments and returns the status of recovery process.
     
     @param option: represents different gprecoverseg command options
     @param max_rtrycnt: the max no. of times state of cluster should be checked
     @return: Boolean value representing the status of recovery process
     """
     
     config = GPDBConfig()
     recoverseg = GpRecoverseg()
     tinctest.logger.info("Running gprecoverseg with '%s' option..."%option)
     recoverseg.run(option)
     rtrycnt = 0
     while ((config.is_not_insync_segments()) == False and rtrycnt <= max_rtrycnt):
         tinctest.logger.info("Waiting [%s] for DB to recover" %rtrycnt)
         sleep(10)
         rtrycnt = rtrycnt + 1
     if rtrycnt > max_rtrycnt:
         return False
     else:
         return True