Hi Jeremy,

On 09/19/2015 12:08 AM, Jeremy Bongio wrote:
> 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?
>
you are right. The state gets created in 
NFS_V4_RECOV_ROOT/NFS_V4_RECOV_DIR.  As mentioned in [1], we have 
scripts which creates symlinks to this directory with the path 
'NFS_V4_RECOV_ROOT/server_ipaddr/NFS_V4_RECOV_DIR'. You could optionally 
choose to rsync the state to this new path periodically.

This is a stop-gap solution we choose to have till we get the 
'clustered' state corrected in ganesha.

[1] http://sourceforge.net/p/nfs-ganesha/mailman/message/34236611/

Thanks,
Soumya


------------------------------------------------------------------------------
_______________________________________________
Nfs-ganesha-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to