-
Notifications
You must be signed in to change notification settings - Fork 159
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
NV22 dragon state migration #3955
Conversation
2afd31a
to
50102fb
Compare
fb5043a
to
515753f
Compare
f2cd2d1
to
71903f7
Compare
71903f7
to
0754f35
Compare
@@ -78,18 +80,29 @@ impl<BS: Blockstore + Send + Sync> StateMigration<BS> { | |||
} | |||
|
|||
let cache = MigrationCache::new(NonZeroUsize::new(10_000).expect("infallible")); | |||
let num_threads = std::env::var("FOREST_STATE_MIGRATION_THREADS") |
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: would validate that to avoid footgun.
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 forced it to at least 3.
.build()?; | ||
|
||
let (state_tx, state_rx) = crossbeam_channel::bounded(1); | ||
let (job_tx, job_rx) = crossbeam_channel::bounded(1); | ||
let (state_tx, state_rx) = crossbeam_channel::bounded(30); |
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 crossbeam if we're using flume elsewhere?
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.
Outside of the scope of this PR. Maybe it could be replaced elsewhere.
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.
Let's add an issue?
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.
let (state_tx, state_rx) = crossbeam_channel::bounded(1); | ||
let (job_tx, job_rx) = crossbeam_channel::bounded(1); | ||
let (state_tx, state_rx) = crossbeam_channel::bounded(30); | ||
let (job_tx, job_rx) = crossbeam_channel::bounded(30); |
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: why are the channels bound specifically to 30
?
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.
Magic number, same as cache set to 10k. Setting it to higher value, just like with cache sizes, may increase the memory footprint.
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.
as long as it works. I would probably make it a constant with a little comment instead, but not critical.
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes #3856
Other information and links
Change checklist