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

Archive Node Online Migration #1863

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Sep 18, 2024

Describe your changes and provide context

Testing performed to validate your change

  • Verifying on migration node

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

Calling the system time may be a possible source of non-determinism
if module != startModule && startModule != "" {
continue
}
startTimeModule := time.Now() // Measure time for each module

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
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

Calling the system time may be a possible source of non-determinism
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

Calling the system time may be a possible source of non-determinism
go func() {
homeDir := cast.ToString(appOpts.Get(flags.FlagHome))
stateStore := app.GetStateStore()
latestVersion := rootmulti.GetLatestVersion(db)
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

Kbhat1 and others added 2 commits September 24, 2024 23:35
* Add QMS for online migration

* Fix lint

---------

Co-authored-by: kbhat1 <kartikbhatri@gmail.com>
Comment on lines +311 to +319
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

Spawning a Go routine may be a possible source of non-determinism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants