@@ -420,7 +420,7 @@ def create_snapshot():
420
420
#'--compress',
421
421
'--stream=tar' ,
422
422
'/tmp/backup' ], stdout = f )
423
-
423
+ log . debug ( 'snapshot completed, uploading to object store' )
424
424
manta_config .put_backup (backup_id , '/tmp/backup.tar' )
425
425
consul .kv .put (LAST_BACKUP_KEY , backup_id )
426
426
@@ -815,9 +815,11 @@ def is_backup_running():
815
815
try :
816
816
fcntl .flock (backup_lock , fcntl .LOCK_EX | fcntl .LOCK_NB )
817
817
fcntl .flock (backup_lock , fcntl .LOCK_UN )
818
- return True
819
- except IOError :
818
+ log .debug ('is_backup_running: False' )
820
819
return False
820
+ except IOError :
821
+ log .debug ('is_backup_running: True' )
822
+ return True
821
823
finally :
822
824
backup_lock .close ()
823
825
@@ -827,8 +829,11 @@ def is_binlog_stale(conn):
827
829
binlog_file = results [0 ][0 ]
828
830
last_binlog_file = get_from_consul (LAST_BINLOG_KEY )
829
831
except IndexError :
832
+ log .debug ('is_binlog_stale: True (no LAST_BINLOG_KEY)' )
830
833
return True
831
- return binlog_file != last_binlog_file
834
+ is_stale = binlog_file != last_binlog_file
835
+ log .debug ('is_binlog_stale: %s' , is_stale )
836
+ return is_stale
832
837
833
838
def is_time_for_snapshot ():
834
839
""" Check if it's time to do a snapshot """
@@ -837,9 +842,12 @@ def is_time_for_snapshot():
837
842
check = consul .agent .checks ()[BACKUP_TTL_KEY ]
838
843
log .debug (check )
839
844
if check ['Status' ] == 'passing' :
845
+ log .debug ('is_time_for_snapshot: False' )
840
846
return False
847
+ log .debug ('is_time_for_snapshot: True' )
841
848
return True
842
849
except KeyError :
850
+ log .debug ('is_time_for_snapshot: True' )
843
851
return True
844
852
845
853
def write_snapshot (conn ):
@@ -859,7 +867,7 @@ def write_snapshot(conn):
859
867
# health checks will fail during backups. When periodic tasks
860
868
# support lands in ContainerPilot we should move the snapshot
861
869
# to a task and avoid this mess.
862
- subprocess .Popen (['python' , '/usr/local/bin/triton-mysql .py' , 'create_snapshot' ])
870
+ subprocess .Popen (['python' , '/usr/local/bin/manage .py' , 'create_snapshot' ])
863
871
864
872
def set_backup_ttl ():
865
873
"""
0 commit comments