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

fs-repo-11-to-12: add env vars for configuring the number of workers and the sync size #149

Merged
merged 4 commits into from
Feb 15, 2022

Conversation

aschmahmann
Copy link
Contributor

No description provided.

Comment on lines 25 to 26
workerEnvVar := "IPFS_FS_MIGRATION_11_TO_12_NWORKERS"
syncSizeEnvVar := "IPFS_FS_MIGRATION_11_TO_12_SYNC_SIZE"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured long names would prevent conflict and almost nobody should need to set these, but if you have other names in mind that's fine by me.

Comment on lines +29 to +34
if err != nil {
panic(err)
}
if nworkers < 1 {
panic("number of workers must be at least 1")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could log an error and fallback to the defaults instead of panicking here, but this seems reasonable to let the user know they did something wrong.

Comment on lines +43 to +45
if syncSize < 1 {
panic("sync size bytes must be at least 1")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set this higher (e.g. 1MB minimum) just so people don't accidentally think 1 == 1MB or something?

Similarly is there any use for setting 0 to mean only syncing at the end of the migration?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's rename the env var to sync_size_bytes?

@@ -4,6 +4,8 @@ test_description="Simple fs-repo-migrations tests"

. lib/test-lib.sh

latestRepoVersion="12"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a wacky change to have to do every time we do a release. Probably we could/should just hard code an immutable distpath so that the repo version is fixed, but at the moment we're just trying to get CI to be green.

@BigLep BigLep mentioned this pull request Jan 18, 2022
59 tasks
Avoid that there is confusion about the unit used.
Copy link
Contributor

@hsanjuan hsanjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should temptatively merge this:

  • the env variables work
  • it seems badger used storage is not growing as heavily as with the previous settings

I will add a follow-up PR with fixes to multihash parsing etc.

@hsanjuan
Copy link
Contributor

And I'm not sure why tests were failing

@aschmahmann
Copy link
Contributor Author

@hsanjuan any learned lessons or recommendations for if/how these variables should be set for us to add to the release notes?

@hsanjuan
Copy link
Contributor

hsanjuan commented Feb 1, 2022

@aschmahmann

We find that in very large repositories with Badger it is faster to set the number of workers to 1 and increasing the sync size to a larger amount (i.e. 200MB).

@aschmahmann aschmahmann merged commit ff44fe3 into master Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants