Change condition for full index#2749
Conversation
MichaelEischer
left a comment
There was a problem hiding this comment.
I don't really understand the intuition behind saving an index once it's more than two minutes old (MinAge) and contains at least 50 blobs (MinBlobs). Assuming you have at least 1MByte/s upload speed and backup a large file. Then with 1.5MB blobs (the average size) this would still be 80 blobs within 2 minutes and therefore immediately trigger an index upload. So this would degrade to Full() == (age>MinAge or blobs>MaxBlobs).
I'd propose to simplify this whole method instead and just check for (age>MaxAge or blobs>MaxBlobs) (notice the MaxAge instead of MinAge). And then maybe reduce MaxAge to 10 minutes.
I also didn't understand why upper and lower limits were needed 😉 Just wanted to fix it in a way that it more consistent and intuitive...
I agree and will change that soon.. |
536837f to
785c63b
Compare
|
I changed the condition as suggested. |
|
The new limit of MaxBlobs = 50k might seem to be just a round number that was picked arbitrarily, but actually it provides a bunch of useful properties:
|
MichaelEischer
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the patch!
What is the purpose of this change? What does it change?
Index files are saved when they are "full". This is determined by the number of blobs within and the age of the index. The current coding translates to the following decision table:
This is a bit counter-intuitive and has the following shortcomings:
This PR changes the decision table to:
EDIT: condition has been even more simplified, see below in the comments
Moreover it changes the value of MinBlobs to 50 and MaxBlobs to 50.000 (was 2.000)
Was the change discussed in an issue or in the forum before?
No, but the discussion came up in #2718.
Checklist
changelog/unreleased/that describes the changes for our users (template here) - do we really need one for this minor change?gofmton the code in all commits