How do the recovery directories work?
I see in nfs4_create_recov_dir(void) that we create the top level
recovery directories and optionally a nodeid directory:
err = mkdir(NFS_V4_RECOV_ROOT, 0755);
...
snprintf(v4_recov_dir, sizeof(v4_recov_dir), "%s/%s", NFS_V4_RECOV_ROOT,
NFS_V4_RECOV_DIR);
err = mkdir(v4_recov_dir, 0755);
...
snprintf(v4_old_dir, sizeof(v4_old_dir), "%s/%s", NFS_V4_RECOV_ROOT,
NFS_V4_OLD_DIR);
err = mkdir(v4_old_dir, 0755);
...
if (nfs_param.core_param.clustered) {
snprintf(v4_recov_dir, sizeof(v4_recov_dir), "%s/%s/node%d",
NFS_V4_RECOV_ROOT, NFS_V4_RECOV_DIR, g_nodeid);
err = mkdir(v4_recov_dir, 0755);
...
snprintf(v4_old_dir, sizeof(v4_old_dir), "%s/%s/node%d",
NFS_V4_RECOV_ROOT, NFS_V4_OLD_DIR, g_nodeid);
err = mkdir(v4_old_dir, 0755);
...
}
However, we aren't creating recovery directories by IP. Then in
nfs4_load_recov_clids_nolock() we look for a directory named by IP:
if (gsp->event == EVENT_UPDATE_CLIENTS)
snprintf(path, sizeof(path), "%s", v4_recov_dir);
else if (gsp->event == EVENT_TAKE_IP)
snprintf(path, sizeof(path), "%s/%s/%s", NFS_V4_RECOV_ROOT,
gsp->ipaddr, NFS_V4_RECOV_DIR);
else if (gsp->event == EVENT_TAKE_NODEID)
snprintf(path, sizeof(path), "%s/%s/node%d", NFS_V4_RECOV_ROOT,
NFS_V4_RECOV_DIR, gsp->nodeid);
else
return;
...
dp = opendir(path);
...
rc = nfs4_read_recov_clids(dp, path, NULL, v4_old_dir, 1);
I don't see where that directory structure is created,
NFS_V4_RECOV_ROOT/server_ipaddr/NFS_V4_RECOV_DIR. What am I missing?
On 09/18/2015 11:15 AM, Malahal Naineni wrote:
> Soumya Koduri [[email protected]] wrote:
>> The issue was with 'clustered' config option. If this option is set,
>> nfs-ganesha writes the clients state to '/var/lib/nfs/ganesha/node{id}'
>> directory. Since we need IP based solution, we had to turn off this
>> config option though we have a cluster of nfs-ganesha nodes.
>>
>> If I remember from the discussion we had, you had agreed to de-couple
>> this option from node-id so that this option can in general be used by
>> anyone planning to have a cluster (and not using node-IDs). And sorry I
>> have't got time to check on that later, but shall be able to look it (in
>> a couple of weeks time) if you would like me to work on it.
> If I remember right, "clustered" really has nothing special about it
> other than storing state in "recovery-dir/node<id>". You wanted to store
> it in "recovery-dir/IP" which is the default if "clustered" is false.
>
> Do you expect anything other than node or IP based directory scheme. If
> so, we could just have "recovery_type(enum, values [ip,nodeid], default
> ip)" in the config. We can phase out clustered keyword altother to not
> confuse people.
>
> If someone wants nodeid/IP, then we can add nodeidip as well to the
> above enum.
>
> Regards, Malahal.
--
Jeremy Bongio
[email protected]
IBM Linux Technology Center - Linux Filesystems Team
Linux Development Engineer
------------------------------------------------------------------------------
_______________________________________________
Nfs-ganesha-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel