Skip to content

Commit

Permalink
Use different algorithm for finding checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cabrador committed Sep 11, 2024
1 parent f40a49f commit a470e70
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/db-heal-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def check_aida_log(process, sleep_time, log_path):
def get_latest_checkpoint_from_info(log_path):
log = os.path.join(working_dir, log_path)
cp: str
checkpoint_keyword = 'Checkpoint: '
with open(log, 'w') as cl:
r = subprocess.run(
['go', 'run', './database/mpt/tool', 'info', str(archive)],
Expand All @@ -155,10 +156,11 @@ def get_latest_checkpoint_from_info(log_path):
return -1

with open(log, 'r') as cl:
info_checkpoint = cl.readlines()[-1]
# Return last word which is the block number
cp = info_checkpoint.split()[-1]

for line in cl:
if checkpoint_keyword in line:
start_index = line.find(checkpoint_keyword) + len(checkpoint_keyword)
cp = line[start_index:].strip()
break
return int(cp)


Expand Down

0 comments on commit a470e70

Please sign in to comment.