Skip to content

Commit

Permalink
Bump i-node cache version since the hash algorithm has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jrosdahl committed Jun 18, 2020
1 parent 91f58ba commit 5b126f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/InodeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace {
// Current cache size is fixed and the given constants are considered large
// enough for most projects. The size could be made configurable if there is a
// demand for it.
const uint32_t k_version = 1;
const uint32_t k_version = 2;

// Increment version number if constants affecting storage size are changed.
const uint32_t k_num_buckets = 32 * 1024;
Expand Down

2 comments on commit 5b126f7

@liljenzin
Copy link
Contributor

Choose a reason for hiding this comment

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

Note for the future. No need to change version since the key is hashed using the same hash algorithm as the cached data. Thus you can't get false hits just because the hash algorithm was changed.

@jrosdahl
Copy link
Member Author

Choose a reason for hiding this comment

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

Right, thanks. I'll try to improve the comment.

Please sign in to comment.