@@ -2669,18 +2669,18 @@ def _get_volume_properties(self, volume_uuid):
26692669
26702670 def _log_database_backup (self , date , name ):
26712671 """Log a database backup operation: "date name"
2672- We cannot assume the pool-master is the same as the linstor-master ,
2673- this file is on the pool-master , and serves for the throttling."""
2672+ We cannot assume the Pool Master is the same as the Linstor Controller ,
2673+ this file is on the Pool Master , and serves for the throttling."""
26742674 os .makedirs (DATABASE_BACKUP_LOGDIR , mode = 0o755 , exist_ok = True )
26752675 with open (DATABASE_BACKUP_LOGFILE , "a" , encoding = "utf8" ) as f :
2676- f .write (f"{ date } { name } \n " )
2676+ f .write (f"{ date } { name [: 15 ] } \n " )
26772677
26782678 def _get_latest_logged_database_backup_date (self ):
26792679 # get last log line if it exists, and return the corresponding date
26802680 try :
26812681 with open (DATABASE_BACKUP_LOGFILE , "rb" ) as f :
2682- # seek from the end, with 256 as a most-probable maximum line length
2683- f .seek (- min (os .stat (DATABASE_BACKUP_LOGFILE ).st_size , 256 ), os .SEEK_END )
2682+ # seek from the end, a line length can't be more than 32
2683+ f .seek (- min (os .stat (DATABASE_BACKUP_LOGFILE ).st_size , 32 ), os .SEEK_END )
26842684 return f .read ().decode ().splitlines ()[- 1 ].split ()[0 ]
26852685 except FileNotFoundError :
26862686 return "20000101_000000"
0 commit comments