From a216745e5db3fdb4fa8d625c971e70f8d0e34d23 Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Wed, 18 Feb 2015 14:49:50 -0500 Subject: cluster/dht: Change the subvolume encoding in d_off to be a "global" position in the graph rather than relative (local) to a particular translator. Encoding the volume in this way allows a single translator to manage which brick is currently being scanned for directory entries. Using a single translator minimizes allocated bits in the d_off. It also allows multiple DHT translators in the same graph to have a common frame of reference (the graph position) for which brick is being read. Multiple DHT translators are needed for the Tiering feature. The fix builds off a previous change (9332) which removed subvolume encoding from AFR. The fix makes an equivalent change to the EC translator. More background can be found in fix 9332 and gluster-dev discussions [1]. DHT and AFR/EC are responsibile (as before) for choosing which brick to enumerate directory entries in over the readdir lifecycle. The client translator receiving the readdir fop encodes the dht_t. It is referred to as the "leaf node" in the graph and corresponds to the brick being scanned. When DHT decodes the d_off, it translates the leaf node to a local subvolume, which represents the next node in the graph leading to the brick. Tracking of leaf nodes is done in common utility functions. Leaf nodes counts and positional information are updated on a graph switch. [1] www.gluster.org/pipermail/gluster-devel/2015-January/043592.html Change-Id: Iaf0ea86d7046b1ceadbad69d88707b243077ebc8 BUG: 1190734 Signed-off-by: Dan Lambright Reviewed-on: http://review.gluster.org/9688 Reviewed-by: Xavier Hernandez Reviewed-by: Krishnan Parthasarathi Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/cluster/dht/src/dht-common.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.h') diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 779b470585c..67e693146af 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -332,6 +332,7 @@ struct dht_conf { gf_boolean_t unhashed_sticky_bit; struct timeval last_stat_fetch; gf_lock_t layout_lock; + dict_t *leaf_to_subvol; void *private; /* Can be used by wrapper xlators over dht */ gf_boolean_t use_readdirp; @@ -501,9 +502,7 @@ int dht_disk_layout_merge (xlator_t *this, dht_layout_t *layout, int dht_frame_return (call_frame_t *frame); -int dht_itransform (xlator_t *this, xlator_t *subvol, uint64_t x, uint64_t *y); -int dht_deitransform (xlator_t *this, uint64_t y, xlator_t **subvol, - uint64_t *x); +int dht_deitransform (xlator_t *this, uint64_t y, xlator_t **subvol); void dht_local_wipe (xlator_t *this, dht_local_t *local); dht_local_t *dht_local_init (call_frame_t *frame, loc_t *loc, fd_t *fd, @@ -775,6 +774,8 @@ int32_t dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, off_t len, dict_t *xdata); +int +dht_set_subvol_range(xlator_t *this); int32_t dht_init (xlator_t *this); void dht_fini (xlator_t *this); int dht_reconfigure (xlator_t *this, dict_t *options); -- cgit