(self, waitcomplete=0)
Pause the WAL apply, wait until last file applied if needed
Pause the WAL apply, wait until last file applied if needed
Pause the WAL apply wait until last file applied if needed
def slave_pause(self, waitcomplete=0):
        """Pause the WAL apply, wait until last file applied if needed"""
        self.assert_is_master(False)
        srcdir = self.cf.getfile("completed_wals")
        pausefile = os.path.join(srcdir, "PAUSE")
        if not self.not_really:
            open(pausefile, "w").write("1")
        else:
            self.log.info("Writing PAUSE file: %s", pausefile)
        self.log.info("Pausing recovery mode")

        # wait for log apply to complete
        if waitcomplete:
            prgrfile = os.path.join(srcdir, "PROGRESS")
            stopfile = os.path.join(srcdir, "STOP")
            if os.path.isfile(stopfile):
                self.log.warning("Recovery is stopped, backup is invalid if the database is open.")
                return
            while os.path.isfile(prgrfile):
                self.log.info("Waiting for WAL processing to complete ...")
                if self.not_really:
                    return
                time.sleep(1)
def slave_pause ( self , waitcomplete = 0 ) : self . assert_is_master ( False ) srcdir = self . cf . getfile ( "completed_wals" ) pausefile = os . path . join ( srcdir , "PAUSE" ) if not self . not_really : open ( pausefile , "w" ) . write ( "1" ) else : self . log . info ( "Writing PAUSE file: %s" , pausefile ) self . log . info ( "Pausing recovery mode" ) # wait for log apply to complete if waitcomplete : prgrfile = os . path . join ( srcdir , "PROGRESS" ) stopfile = os . path . join ( srcdir , "STOP" ) if os . path . isfile ( stopfile ) : self . log . warning ( "Recovery is stopped, backup is invalid if the database is open." ) return while os . path . isfile ( prgrfile ) : self . log . info ( "Waiting for WAL processing to complete ..." ) if self . not_really : return time . sleep ( 1 )