Bug 1428049 - dict_t: make dict_t a real dictionary
Summary: dict_t: make dict_t a real dictionary
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-01 19:04 UTC by Vijay Bellur
Modified: 2019-04-17 11:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-17 11:45:25 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Vijay Bellur 2017-03-01 19:04:42 UTC
dict_t: make dict_t a real dictionary

Summary:
- During testing, I found dict_t actually always has a hash_size
of 1. So basically it's not a dictionary. It's list. This diff fixed that problem.
A bug in dictionary is also fixed here. SuperFastHash generates
uint32_t, but it was assigned to a int, which could suffer from
overflow. Previously the hash_size is always 1, so the bug was not triggered.
Under new hash_size, it's easy to trigger that bug.

- For existing GlusterFS codebase, dict_new need to be calling dict_t
*get_new_dict_full (uint32_t size_hint) to use the new logic. An
estimated number of items you are going to insert into the dictionary
is the input for that function.

- This is a port of D3736252 to 3.8

Test Plan: Prove tests

Reviewed By: kvigor

Signed-off-by: Shreyas Siravara <sshreyas>

Change-Id: Ic760eabed82e58881076acbaa46a295dc23e0634
Reviewed-on: http://review.gluster.org/16061
Tested-by: Shreyas Siravara <sshreyas>
Smoke: Gluster Build System <jenkins.org>
NetBSD-regression: NetBSD Build System <jenkins.org>
CentOS-regression: Gluster Build System <jenkins.org>
Reviewed-by: Kevin Vigor <kvigor>

Comment 1 Worker Ant 2017-03-02 20:10:15 UTC
REVIEW: https://review.gluster.org/16830 (dict_t: make dict_t a real dictionary) posted (#1) for review on master by Vijay Bellur (vbellur)

Comment 2 Yaniv Kaul 2019-04-17 11:45:25 UTC
Merged long time ago.


Note You need to log in before you can comment on or make changes to this bug.