-
Notifications
You must be signed in to change notification settings - Fork 805
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
Archive Node Online Migration #1863
base: main
Are you sure you want to change the base?
Conversation
fmt.Println("Scanning database and exporting leaf nodes...") | ||
fmt.Println("ExportLeafNodesFromKey - Scanning database and exporting leaf nodes...") | ||
|
||
startTimeTotal := time.Now() // Start measuring total time |
Check warning
Code scanning / CodeQL
Calling the system time Warning
if module != startModule && startModule != "" { | ||
continue | ||
} | ||
startTimeModule := time.Now() // Measure time for each module |
Check warning
Code scanning / CodeQL
Calling the system time Warning
return fmt.Errorf("failed to create iterator: %w", err) | ||
} | ||
defer itr.Close() | ||
|
||
startTimeBatch := time.Now() // Measure time for every 10,000 iterations |
Check warning
Code scanning / CodeQL
Calling the system time Warning
batchDuration := time.Since(startTimeBatch) | ||
fmt.Printf("ExportLeafNodesFromKey - Last 10,000 iterations took: %v. Total scanned: %d, leaf nodes exported: %d\n", batchDuration, count, leafNodeCount) | ||
|
||
startTimeBatch = time.Now() // Reset the start time for the next batch |
Check warning
Code scanning / CodeQL
Calling the system time Warning
go func() { | ||
homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) | ||
stateStore := app.GetStateStore() | ||
latestVersion := rootmulti.GetLatestVersion(db) |
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 latest version would keep changing as we restart right? Is there any concern ?
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.
Yea this will change to the migrate-height flag
7ba74d6
to
27a1676
Compare
* Add QMS for online migration * Fix lint --------- Co-authored-by: kbhat1 <kartikbhatri@gmail.com>
go func() { | ||
homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) | ||
stateStore := app.GetStateStore() | ||
latestVersion := rootmulti.GetLatestVersion(db) | ||
migrator := ss.NewMigrator(homeDir, db, stateStore) | ||
if err := migrator.Migrate(latestVersion, homeDir); err != nil { | ||
panic(err) | ||
} | ||
}() |
Check notice
Code scanning / CodeQL
Spawning a Go routine Note
Describe your changes and provide context
Testing performed to validate your change