diff options
author | Anand Avati <avati@redhat.com> | 2014-12-23 10:04:00 -0800 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-03-03 23:38:41 -0800 |
commit | f396e475417aa52daf49e4564c67628cc8f0e598 (patch) | |
tree | 1624d242eb4b08820c1ef3a7052a9cb8625e8479 /xlators/features/protect/Makefile.am | |
parent | b887c4ee9338215ce11aa350c97fcc6f133fcce7 (diff) |
afr: stop encoding subvolume id in readdir d_off
Backport of http://review.gluster.org/9332
The purpose of encoding d_off in AFR is to indicate the
selected subvolume for the first readdir, and continue all
further readdirs of the session on the same subvolume. This is
required because, unlike files, dir d_offs are specific to the
backend and cannot be re-used on another subvolume. The d_off
transformation encodes the subvolume id and prevents such
invalid use of d_offs on other servers.
However, this approach could be quite wasteful of precious d_off
bit-space. Unlike DHT, where server id can change from entry to
entry and thus encoding the server id in the transformed d_off
is necessary, we could take a slightly relaxed approach in AFR.
The approach is to save the subvolume where the last readdir
request was sent in the fd_ctx. This consumes constant space (i.e
no per-entry cache), and serves the purpose of avoiding d_off
"misuse" (i.e using d_off from one server on another).
The compromise here is NFS resuming readdir from a non-0 cookie
after an extended delay (either anonymous FD has been reclaimed,
or server has restarted). In such cases a subvolume is picked
freshly. To make this fresh picking more deterministic (i.e, to
pick the same subvolume whenever possible, even after reboots),
the function afr_hash_child (used by afr_read_subvol_select_by_policy)
is modified to skip all dynamic inputs (i.e PID) for the case
of directories.
BUG: 1191537
Change-Id: I7e3bd8dfe346a9a8e428d7ddeada6cfb66e64e54
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/9638
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/protect/Makefile.am')
0 files changed, 0 insertions, 0 deletions