Skip to content

Commit

Permalink
add resumable replay verify if a partition failed
Browse files Browse the repository at this point in the history
  • Loading branch information
areshand committed Oct 15, 2023
1 parent 341087a commit eae267c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion testsuite/replay_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@
]


def replay_with_retry(*args):
MAX_RETRIES = 3
attempt = 0
while attempt < MAX_RETRIES:
(n, return_code) = replay_verify_partition(*args)
if return_code == 0:
return (n, return_code)
elif attempt < MAX_RETRIES - 1:
print(f"Attempt {attempt + 1} failed for arguments {args}. Retrying.")
attempt += 1
else:
return (n, return_code)


def replay_verify_partition(
n: int,
N: int,
Expand Down Expand Up @@ -201,7 +215,7 @@ def main():

with Pool(N) as p:
all_partitions = p.starmap(
replay_verify_partition,
replay_with_retry,
[
(
n,
Expand Down

0 comments on commit eae267c

Please sign in to comment.