-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid hash collisions in the storage by not hashing grouping labels
Instead, simply put into a string what was hashed before and use that string as the key in the map instead of the uint64 hash value used before. Hashing was essentially done for convenience, ignoring the ill effect of a hash collision, should it ever occur. In contrast to other uses of hashing of label maps, the hashing isn't needed here for performance reasons. Neither CPU cycles nor memory usage is critical here. The downside is that the on-disk format changes. This commit includes code to convert the old format if encountered. This code is planned to be removed prior to the v1 release of the PGW. Note about testing the conversion: I have verified manually that it works and was planning to add a test. However, that test would require adding a fixture in the old format. As this code will be removed in the next released, I decided it's not worth the complication. (Automated tests are there to make sure things keep working after code changes. In this case, the next change will be to remove the code to be tested.) Signed-off-by: beorn7 <[email protected]>
- Loading branch information
Showing
4 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters