-
Notifications
You must be signed in to change notification settings - Fork 233
feat: live backups evm and ev-node #2758
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
base: main
Are you sure you want to change the base?
Conversation
- Added Backup method to Store interface and DefaultStore implementation to stream a Badger backup of the datastore. - Introduced BackupRequest and BackupResponse messages in the state_rpc.proto file to handle backup requests and responses. - Implemented backup streaming logic in StoreServer, including metadata handling for current and target heights. - Created a backupStreamWriter to manage chunked writing of backup data. - Updated client tests to validate the Backup functionality. - Enhanced mock store to support Backup method for testing. - Added unit tests for Backup functionality in the store package.
…d improve error handling
|
The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).
|
|
Claude finished @randygrok's task —— View job Code Review: Live Backups EVM and ev-nodeI've completed a comprehensive review of this PR implementing live backup and restore functionality. Here are my findings organized by focus area: 1. Code Quality & Architecture✅ Strengths:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2758 +/- ##
==========================================
- Coverage 61.42% 59.55% -1.88%
==========================================
Files 81 85 +4
Lines 8622 9007 +385
==========================================
+ Hits 5296 5364 +68
- Misses 2828 3122 +294
- Partials 498 521 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
small nits. haven't checked the core logic then.
…-node into feat/ev-node-hot-backup
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.
nice! utACK. left some nits
| pb "github.com/evstack/ev-node/types/pb/evnode/v1" | ||
| ) | ||
|
|
||
| // NewBackupCmd creates a cobra command that streams a datastore backup via the RPC client. |
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.
nit, lets define flags as variables
| } | ||
|
|
||
| ctx := cmd.Context() | ||
| if ctx == nil { |
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.
not necessary.
| }, streamWriter) | ||
| if backupErr != nil { | ||
| // Remove the partial file on failure to avoid keeping corrupt snapshots. | ||
| _ = writer.Flush() |
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.
use defer and remove them from all those error handling
| } | ||
|
|
||
| visited := make(map[ds.Datastore]struct{}) | ||
| current, ok := any(s.db).(ds.Datastore) |
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.
why the any cast?
Overview
Closes: #2641