From b6c0ac94a444be5f965f14492bf447ba0910daf1 Mon Sep 17 00:00:00 2001 From: Bhaskar Maddala Date: Tue, 5 Nov 2013 11:54:02 -0500 Subject: [PATCH] MEDIUM: backend: Implement avalanche as a modifier of the hashing functions. Summary: Avalanche is supported not as a native hashing choice, but a modifier on the hashing function. Note that this means that possible configs written after 1.5-dev4 using "hash-type avalanche" will get an informative error instead. But as discussed on the mailing list it seems nobody ever used it anyway, so let's fix it before the final 1.5 release. The default values were selected for backward compatibility with previous releases, as discussed on the mailing list, which means that the consistent hashing will still apply the avalanche hash by default when no explicit algorithm is specified. Examples (default) hash-type map-based Map based hashing using sdbm without avalanche (default) hash-type consistent Consistent hashing using sdbm with avalanche Additional Examples: (a) hash-type map-based sdbm Same as default for map-based above (b) hash-type map-based sdbm avalanche Map based hashing using sdbm with avalanche (c) hash-type map-based djb2 Map based hashing using djb2 without avalanche (d) hash-type map-based djb2 avalanche Map based hashing using djb2 with avalanche (e) hash-type consistent sdbm avalanche Same as default for consistent above (f) hash-type consistent sdbm Consistent hashing using sdbm without avalanche (g) hash-type consistent djb2 Consistent hashing using djb2 without avalanche (h) hash-type consistent djb2 avalanche Consistent hashing using djb2 with avalanche --- doc/configuration.txt | 39 ++++++++++++++++++++------------ include/types/backend.h | 7 ++++-- src/backend.c | 12 +++++----- src/cfgparse.c | 50 ++++++++++++++++++++++++++++++++--------- 4 files changed, 75 insertions(+), 33 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 643afd919..c430ec3b8 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -2496,7 +2496,7 @@ grace