-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Events: Migrating from v1 to v2 is slow #11056
Comments
My guess is we're spending most of our time walking up the chain and computing TSK CIDs for heights with no entries in the DB. Proposal:
|
Not a second per tipset, unless that's an exaggeration.
That's going to repeatedly walk the chain, right? Although I guess the cache should help. But I'm pretty sure we have events at most heights. |
I ran some quick diagnostics, it was pretty consistently 0.5-1 seconds, and the vast majority of them had no events. My guess is that it's because we run 2 statements on every epoch (the delete off-chain and the select), even though most are no-ops.
I was proposing doing so using the database itself, not the chain. Writing some sort of |
Ah, I see. So one query to find the relevent epochs? Yeah, that should work. Also, it really sounds like we don't have the right indices. These statements should take milliseconds. |
Here's a commit that adds some logging, as well as a shed command that begins the migration for easy reproducing. Command: Just eyeballing some results, most tipsets are taking 1s, with 500ms devoted to the off-chain delete statement, and another 500 to the select statement:
|
The issue was slow SQL statements performed during the migration, I added some temporary indices for the purpose of the migration in #11064 and that resulted in the total migration taking 55sec on an events.db going back since FEVM date. That should be fast enough. |
I have just tested this on my production miner and I am fully synced with EnableEthRPC enabled!!
|
We should:
The text was updated successfully, but these errors were encountered: