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

Correct "current size" option in Wizard => datastore size #742

Merged
merged 2 commits into from
Oct 17, 2021
Merged

Correct "current size" option in Wizard => datastore size #742

merged 2 commits into from
Oct 17, 2021

Conversation

AC4BB21B
Copy link
Contributor

@AC4BB21B AC4BB21B commented Oct 1, 2021

If you happen to run the installation wizard after you've already configured your node, when reaching the "Datastore size" step, the wizard will load your current datastore size parameter.

However, when you choose a value as datastore size, the wizard will then apply the following operations:

  • compute a clientCacheSize, of 10% or 200 MiB (whichever is smaller)
  • compute a slashdotCacheSize of up to 10%
  • compute storeSize = [your chosen size] - clientCacheSize - slashdotCacheSize, and use this as the datastore size.

So, the actual value for datastore size will be different from the chosen value. In particular, if you choose "current size", in the end the datastore will get reduced, leading to a datastore resize (which may take a long time and will lead to its partial purge).

Example

For instance, if I choose 10 GiB, then in the logs I'll see:

Setting datastore size to 9016MiB
Setting client cache size to 200MiB
Setting slashdot/ULPR/recent requests cache size to 1024MiB

And if I go back to the datastore size wizard step, "current size" will then show 8.8 GiB (the equivalent of 9016 MiB), instead of 10 GiB (what I chose).

Proposed fix

In this PR, I compute storeSize + clientCacheSize + slashdotCacheSize, and I then use this to fill in the "current size" option, instead of just storeSize.

Although this is a bit inaccurate as far as what the current size of the datastore really is, it seems to me that it leads to a more coherent behavior.

@ArneBab
Copy link
Contributor

ArneBab commented Oct 3, 2021

Thank you for your pull request! That looks like a solid improvement (see the comment for polish).

@ArneBab ArneBab merged commit 4f5a48d into hyphanet:next Oct 17, 2021
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