示例#1
0
文件: fault.py 项目: LJoNe/gpdb
    def test_drop_db_dir(self):
        ''' Drop Database dir only '''
        newfault = Fault()
        #Get segment host, data dir, and DB oid to create fault
        (hostname, dirloc, oid) =  newfault.get_host_dir_oid()

        # Move database dir to take it offline
        DirPath = dirloc + '/base/'+ oid
        newfault.drop_dir(hostname, DirPath)
        #issue checkpoint
        newfault.issue_checkpoint()
示例#2
0
文件: fault.py 项目: LJoNe/gpdb
    def test_drop_db(self):
        ''' Test to Simulate drop_db  when database dir is offline '''
        newfault = Fault()
        sleep(20)
        #Get segment host, data dir, and DB oid to create fault
        (hostname, dirloc, oid) =  newfault.get_host_dir_oid()

        # Move database dir to take it offline
        fromDir = dirloc + '/base/'+ oid
        toDir = dirloc + '/base/../../'
        newfault.move_dir(hostname, fromDir, toDir)                
        newfault.drop_db()

        #restore database dir
        fromDir = dirloc + '/base/../../'+ oid
        toDir = dirloc + '/base/'
        newfault.move_dir(hostname, fromDir, toDir)
        newfault.drop_db()
        
        #Create db so that validations will work
        newfault.create_db()