-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvs: add date to kvs-primary checkpoint
Problem: It'd be convenient if we knew the date when the primary namespace was checkpointed. Solution: When checkpointing the primary namespace, store a json object with version, rootref, and timestamp, instead of just the rootref string. On retrieval, parse appropriately and retrieve timestamp for output in logs. Support the original checkpointing format by checking if the checkpoint object is a raw blobref string first. Fixes #3580
- Loading branch information
Showing
4 changed files
with
156 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import sqlite3 | ||
|
||
if len(sys.argv) < 4: | ||
print("change-checkpoint.py <file> <key> <value>") | ||
sys.exit(1) | ||
|
||
conn = sqlite3.connect(sys.argv[1]) | ||
cursor = conn.cursor() | ||
s = ( | ||
'REPLACE INTO checkpt (key,value) values ("' | ||
+ sys.argv[2] | ||
+ '", "' | ||
+ sys.argv[3] | ||
+ '")' | ||
) | ||
cursor.execute(s) | ||
conn.commit() | ||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters