Created attachment 593160 [details] patch to fix the problem Description of problem: if you set read-subvolume in volume file or over xlator-options it has no effect of which subvolume the client chooses. when read-subvolume is set the client should try to read first from that subvolume if its online. Version-Release number of selected component (if applicable): 3.3.0 How reproducible: glusterfs --volfile-id=testvol --volfile-server=gluster02 --xlator-option=testvol-replicate-0.read-subvolume=testvol-client-1 /mnt2 then read files from the volume Actual results: the option gets acceptet: [options.c:1043:xlator_option_init_xlator] 0-testvol-replicate-0: option read-subvolume using set value testvol-client-1 [afr-common.c:1294:afr_lookup_select_read_child] 0-testvol-replicate-0: Source selected as 0 for /a.1 Expected results: the option gets acceptet: [options.c:1043:xlator_option_init_xlator] 0-testvol-replicate-0: option read-subvolume using set value testvol-client-1 [afr-common.c:1294:afr_lookup_select_read_child] 0-testvol-replicate-0: Source selected as 1 for /a.1 Additional info: the problem seems to be in afr-common.c in function afr_select_read_child_from_policy if the config option read-subvolume is set it should be preferred for read see my patch
I offered to "shepherd" this bug/patch for Domenic, and he agreed. The corresponding patch in Gerrit is http://review.gluster.com/#change,3614.
CHANGE: http://review.gluster.com/3614 (cluster/afr: fix for read-subvolume option does not work) merged in master by Anand Avati (avati)