def stop_database(self): logger.info('Stopping Greenplum Database') cmd = GpStop('Stop Greenplum Databse') cmd.run() if cmd.get_results().rc != 0: logger.error('Failed to stop Greenplum Database.') cmd.validate()
def stop_master_only(self): logger.info('Stopping Greenplum Database in master only mode') cmd = GpStop('Stop Greenplum Database in master only mode', masterOnly=True) cmd.run() if cmd.get_results().rc != 0: logger.error( 'Failed to stop Greenplum Database in master only mode.') cmd.validate()
def test_start_gpdb_with_high_transaction_id(self): """ @description GPDB hang after high transaction id @created 2013-04-18 00:00:00 @modified 2013-04-18 00:00:00 @tags transaction MPP-17302 MPP-17323 MPP-17325 MPP-18462 MPP-18463 schedule_transaction @note This requires that both primary and mirror to reset xlog. Repro step from Hitoshi: gpstop -a pg_resetxlog -x 100000000 /data/haradh1/gpdata/d/gpseg0 dd if=/dev/zero of=/data/haradh1/gpdata/d/gpseg0/pg_clog/0017 oflag=append conv=notrunc bs=1048576 count=1 cp /data/haradh1/gpdata/d/gpseg0/pg_clog/0017 /data/haradh1/gpdata/d/gpseg0/pg_distributed/02FA gpstart -a """ # @note: need a class to get GPDB configuration, need to get primary/mirror segment location sqlcmd = "select fselocation from gp_segment_configuration, pg_filespace_entry where dbid=fsedbid and content=0" with dbconn.connect(dbconn.DbURL()) as conn: segments = dbconn.execSQL(conn, sqlcmd) # @note: Issue with self.run_gpstop, hard-coded remoteHost to mdw # @note: upgrade model uses a series of gpstop and gpstart command, need helper classes cmd = GpStop("gpstop") cmd.run(validateAfter=True) for segment in segments: cmd = Command(name="reset xlog", cmdStr="pg_resetxlog -x 100000000 %s" % segment[0]) cmd.run() xlogfile = local_path('xlog_file') # @todo: able to copy the xlogfile remotely shutil.copyfile(xlogfile, "%s/pg_clog/0017" % segment[0]) shutil.copyfile(xlogfile, "%s/pg_distributedlog/02FA" % segment[0]) # @note: workaround the issue with tinc and 4.1 gppylib cmd = Command(name='run gpstop', cmdStr='source %s/greenplum_path.sh;\ gpstart -a' % os.environ['GPHOME']) cmd.run(validateAfter=True)