-
Notifications
You must be signed in to change notification settings - Fork 493
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
tools: update catchpointdump 'database' and 'database check' commands to handle staging tables and KVs #4802
Conversation
…dle staging tables and KVs
Codecov Report
@@ Coverage Diff @@
## master #4802 +/- ##
=======================================
Coverage 54.68% 54.69%
=======================================
Files 414 414
Lines 53550 53550
=======================================
+ Hits 29286 29288 +2
- Misses 21836 21838 +2
+ Partials 2428 2424 -4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
cmd/catchpointdump/database.go
Outdated
fmt.Fprintf(outFile, " Root: %s\n", root.String()) | ||
if err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does printing the root even when err != nil
make sense?
Also, doesn't String() get called implicitly by %s
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
cmd/catchpointdump/file.go
Outdated
@@ -439,7 +403,7 @@ func printKeyValue(writer *bufio.Writer, key, value []byte) { | |||
fmt.Fprintf(writer, "%s : %v\n", pretty, base64.StdEncoding.EncodeToString(value)) | |||
} | |||
|
|||
func printKeyValueStore(databaseName string, outFile *os.File) error { | |||
func printKeyValueStore(databaseName string, stagingTables bool, fileHeader ledger.CatchpointFileHeader, outFile *os.File) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you just add fileHeader
for consistency among the print funcs? It's unused, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm fileHeader
is unused. I do not recall why the parameter was added during debugging. Unless @cce recalls, I think it's preferable to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just removed it, it was left over from before I added the stagingTables arg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addresses my minor comments - @algorandskiy had the more substantive questions, so we should merge when he approves.
… to handle staging tables and KVs (algorand#4802) * update catchpointdump 'database' and 'database check' commands to handle staging tables and KVs * address CR comments
Summary
The catchpointdump "database" and "database check" commands did not handle KVs or unlimited assets very well, and this updates them to add a "--staging" flag allow dumping/checking both the catchpoint staging tables and the regular tables.
Test Plan
Tested manually.