diff options
author | Mohit Agrawal <moagrawal@redhat.com> | 2019-05-17 19:26:48 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-05-31 14:20:25 +0000 |
commit | f8f09178bb890924a8050b466cc2e7a0a30e35a7 (patch) | |
tree | 721b28feb7873a866ce46c2c4bc8e3c590b5d912 /libglusterfs/src/glusterfs/dict.h | |
parent | fc49927b5fe06380cab309787d2bd62601fa75c4 (diff) |
glusterd: Optimize code to copy dictionary in handshake code path
Problem: While high no. of volumes are configured around 2000
glusterd has bottleneck during handshake at the time
of copying dictionary
Solution: To avoid the bottleneck serialize a dictionary instead
of copying key-value pair one by one
Change-Id: I9fb332f432e4f915bc3af8dcab38bed26bda2b9a
fixes: bz#1711297
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs/dict.h')
-rw-r--r-- | libglusterfs/src/glusterfs/dict.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs/dict.h b/libglusterfs/src/glusterfs/dict.h index 52b833fd559..022f564f62a 100644 --- a/libglusterfs/src/glusterfs/dict.h +++ b/libglusterfs/src/glusterfs/dict.h @@ -91,6 +91,9 @@ typedef struct _data_pair data_pair_t; #define DICT_MAX_FLAGS 256 #define DICT_FLAG_SET 1 #define DICT_FLAG_CLEAR 0 +#define DICT_HDR_LEN 4 +#define DICT_DATA_HDR_KEY_LEN 4 +#define DICT_DATA_HDR_VAL_LEN 4 struct _data { char *data; @@ -412,4 +415,7 @@ are_dicts_equal(dict_t *one, dict_t *two, gf_boolean_t (*value_ignore)(char *k)); int dict_has_key_from_array(dict_t *dict, char **strings, gf_boolean_t *result); + +int +dict_serialized_length_lk(dict_t *this); #endif |