Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigtable-backup tool fix #920

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tools/bigtable-backup/bigtable-backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def ensure_backups(args):
active_table_number = int(time.time() / args.periodic_table_duration)

print("Checking right backups exist")
while oldest_table_number <= newest_table_number:
table_id = args.bigtable_table_id_prefix + str(oldest_table_number)
oldest_table_number += 1
table_number_to_check = oldest_table_number
while table_number_to_check <= newest_table_number:
table_id = args.bigtable_table_id_prefix + str(table_number_to_check)
table_number_to_check += 1
if table_id not in backups:
print("backup for {} not found".format(table_id))
create_backup(table_id, args)
Expand Down Expand Up @@ -205,7 +206,7 @@ def delete_out_of_range_backups(oldest_table_number, newest_table_number, backup
table_number = int(table_id.rsplit("_", 1)[-1])
if table_number < oldest_table_number or table_number > newest_table_number:
for timestamp in timestamps:
delete_backup(table_id, timestamp, args)
delete_backup(table_id, str(timestamp), args)
num_backups_deleted += 1

return num_backups_deleted
Expand Down