The attached patch depends on the previous one, but this one specifically fixes the varstrip directory hints issue. This has been applied in cvs trunk as well.

I didn't take Murali's patch verbatim, but the idea is basically the same. The varstrip params have to be parsed as a special case in the code that handles directory hints because it uses a different parameter format than the other distributions.

-Phil


I'll look into the varstrip issue soon.

-Phil

Tony Kew wrote:
Dear PVFS users list,

Mounting a pvfs 7.2.1, creating directories and setting the distribution
type with setfattr for each directory, only simple_stipe and twod_stripe
would allow me to write a file in the given directory.

Adding the varstrip_dist xattrs patch from Murali Vilayannur attached to
this message thread:

   http://osdir.com/ml/file-systems.pvfs2.users/2007-01/msg00050.html

fixes the variable strip distibution, but the basic distribution still
doesn't work for me.

The patch adds

   #include "pvfs2-dist-basic.h

to src/client/sysint/sys-create.sm so I wonder if no one has tried this...???
Perhaps there is a little more code needed to make basic_dist work with
xargs?

The patch above is against 2.6, but works (and is needed for varstrip_dist with xargs) with 7.2.1 & the latest cvs (best I can tell) - perhaps this patch
could be added to both?

Let me know if there is useful debug info I can provide...


Thanks Much
Tony

Tony Kew
SAN Administrator
The Center for Computational Research
New York State Center of Excellence
in Bioinformatics & Life Sciences
701 Ellicott Street, Buffalo, NY 14203

CoE Office: (716) 881-8930           Fax: (716) 849-6656
CSE Office: (716) 645-3797 x2174
     Cell: (716) 560-0910          Home: (716) 874-2126

"I love deadlines, I love the whooshing noise they make as they go by."
                                                         Douglas Adams

_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users


------------------------------------------------------------------------

_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

---------------------
PatchSet 6940 
Date: 2008/06/30 13:58:53
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
print an error message and propigate an error if a distribution fails to
handle the number of datafiles properly

Members: 
	src/common/misc/pint-cached-config.c:1.26->1.27 

Index: pvfs2-1/src/common/misc/pint-cached-config.c
diff -u pvfs2-1/src/common/misc/pint-cached-config.c:1.26 pvfs2-1/src/common/misc/pint-cached-config.c:1.27
--- pvfs2-1/src/common/misc/pint-cached-config.c:1.26	Thu Jun 12 17:45:28 2008
+++ pvfs2-1/src/common/misc/pint-cached-config.c	Mon Jun 30 13:58:53 2008
@@ -997,7 +997,6 @@
     int num_dfiles_requested,
     int *num_dfiles)
 {
-    int ret = -PVFS_EINVAL;
     int rc;
     int num_io_servers;
     
@@ -1022,17 +1021,23 @@
 
     /* Determine the number of I/O servers available */
     rc = PINT_cached_config_get_num_io(fsid, &num_io_servers);
+    if(rc < 0)
+    {
+        return(rc);
+    }
     
-    if (0 == rc)
+    /* Allow the distribution to apply its hint to the number of
+       dfiles requested and the number of I/O servers available */
+    *num_dfiles = dist->methods->get_num_dfiles(dist->params,
+                                                num_io_servers,
+                                                num_dfiles_requested);
+    if(*num_dfiles < 1)
     {
-        /* Allow the distribution to apply its hint to the number of
-           dfiles requested and the number of I/O servers available */
-        *num_dfiles = dist->methods->get_num_dfiles(dist->params,
-                                                    num_io_servers,
-                                                    num_dfiles_requested);
-        ret = 0;
+        gossip_err("Error: distribution failure for %d servers and %d requested datafiles.\n", num_io_servers, num_dfiles_requested);
+        return(-PVFS_EINVAL);
     }
-    return ret;
+
+    return 0;
 }
 
 /* PINT_cached_config_get_num_meta()
---------------------
PatchSet 6942 
Date: 2008/06/30 14:23:11
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
make varstrip complain more loudly if it doesn't get good parameters

Members: 
	src/io/description/dist-varstrip-parser.c:1.3->1.4 

Index: pvfs2-1/src/io/description/dist-varstrip-parser.c
diff -u pvfs2-1/src/io/description/dist-varstrip-parser.c:1.3 pvfs2-1/src/io/description/dist-varstrip-parser.c:1.4
--- pvfs2-1/src/io/description/dist-varstrip-parser.c:1.3	Sat May 27 19:50:23 2006
+++ pvfs2-1/src/io/description/dist-varstrip-parser.c	Mon Jun 30 14:23:11 2008
@@ -7,6 +7,7 @@
 
 #include "dist-varstrip-parser.h"
 #include "pvfs2-dist-varstrip.h"
+#include "gossip.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -145,6 +146,12 @@
     *count = 0;
     *strips = 0;
 
+    if(!input || strlen(input) == 0)
+    {
+        gossip_err("Error: missing manditory parameters to varstrip_dist distribution.\n");
+        return(-1);
+    }
+
     if (strlen(input) < PVFS_DIST_VARSTRIP_MAX_STRIPS_STRING_LENGTH - 1)
     {
         strcpy(inp, input);
@@ -152,6 +159,7 @@
     else
     {
         /* input string too long, abort */
+        gossip_err("Error: varstrip_dist distribution parameters too long.\n");
         return -1;
     }
 
@@ -160,6 +168,7 @@
     if (!(*strips))        
     {
         /* allocation failed, abort */
+        gossip_err("Error: unable to parse varstrip_dist distribution parameters.\n");
         return -1;
     }
 
---------------------
PatchSet 6943 
Date: 2008/06/30 14:59:28
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
more rearrangimication.  Resolve any distribution parameters from
directory hints before trying to use that distribution for dfile count
handling.

Members: 
	src/client/sysint/sys-create.sm:1.119->1.120 

Index: pvfs2-1/src/client/sysint/sys-create.sm
diff -u pvfs2-1/src/client/sysint/sys-create.sm:1.119 pvfs2-1/src/client/sysint/sys-create.sm:1.120
--- pvfs2-1/src/client/sysint/sys-create.sm:1.119	Mon Jun 30 12:14:08 2008
+++ pvfs2-1/src/client/sysint/sys-create.sm	Mon Jun 30 14:59:28 2008
@@ -1072,55 +1072,6 @@
         }
     }
 
-    /* priority for determining user's preference for number of data files:
-     * 1) count specified in attr's passed into sys_create
-     * 2) directory hints
-     * 3) mount options
-     * 4) system default
-     * All of the above can be overridden by the distribution itself.
-     */
-
-    if(sm_p->u.create.sys_attr.mask & PVFS_ATTR_SYS_DFILE_COUNT)
-    {
-        /* specified by sys_create caller */
-        num_dfiles_requested = sm_p->u.create.sys_attr.dfile_count;     
-    }
-    else if(attr->u.dir.hint.dfile_count > 0)
-    {
-        num_dfiles_requested = attr->u.dir.hint.dfile_count;
-    }
-    else
-    {
-        /* Check the mount options */
-        int rc;
-        struct PVFS_sys_mntent mntent;
-
-        rc = PVFS_util_get_mntent_copy(sm_p->object_ref.fs_id, &mntent);
-        if (0 == rc)
-        {
-            num_dfiles_requested = mntent.default_num_dfiles;
-            PVFS_util_free_mntent(&mntent);
-        }
-    }
-
-    /* Determine the number of dfiles.   Pass in the number requested by the
-     * client, but will be overridden by default configuration and/or
-     * distribution if necessary 
-     */
-    ret = PINT_cached_config_get_num_dfiles(sm_p->object_ref.fs_id,
-                                            sm_p->u.create.dist,
-                                            num_dfiles_requested,
-                                            &sm_p->u.create.num_data_files);
-    if(ret < 0)
-    {
-        gossip_err("Error: failed to get number of data servers\n");
-        js_p->error_code = ret;
-        return SM_ACTION_COMPLETE;
-    }
-
-    gossip_debug(GOSSIP_CLIENT_DEBUG, "Setting number of datafiles to %d [requested %d]\n", 
-        sm_p->u.create.num_data_files, num_dfiles_requested);
-
     /* okay, we might need to override some dist params as well */
     if (attr->u.dir.hint.dist_params_len > 0)
     {
@@ -1130,6 +1081,7 @@
         int nparams = 0;
 
         /* ignore parse errors! */
+        /* TODO: why should we ignore parsing errors? */
         if (PINT_split_keyvals(attr->u.dir.hint.dist_params,
             &nparams, &key, &val) == 0)
         {
@@ -1171,6 +1123,56 @@
             free(val);
         }
     }
+
+    /* priority for determining user's preference for number of data files:
+     * 1) count specified in attr's passed into sys_create
+     * 2) directory hints
+     * 3) mount options
+     * 4) system default
+     * All of the above can be overridden by the distribution itself.
+     */
+
+    if(sm_p->u.create.sys_attr.mask & PVFS_ATTR_SYS_DFILE_COUNT)
+    {
+        /* specified by sys_create caller */
+        num_dfiles_requested = sm_p->u.create.sys_attr.dfile_count;     
+    }
+    else if(attr->u.dir.hint.dfile_count > 0)
+    {
+        num_dfiles_requested = attr->u.dir.hint.dfile_count;
+    }
+    else
+    {
+        /* Check the mount options */
+        int rc;
+        struct PVFS_sys_mntent mntent;
+
+        rc = PVFS_util_get_mntent_copy(sm_p->object_ref.fs_id, &mntent);
+        if (0 == rc)
+        {
+            num_dfiles_requested = mntent.default_num_dfiles;
+            PVFS_util_free_mntent(&mntent);
+        }
+    }
+
+    /* Determine the number of dfiles.   Pass in the number requested by the
+     * client, but will be overridden by default configuration and/or
+     * distribution if necessary 
+     */
+    ret = PINT_cached_config_get_num_dfiles(sm_p->object_ref.fs_id,
+                                            sm_p->u.create.dist,
+                                            num_dfiles_requested,
+                                            &sm_p->u.create.num_data_files);
+    if(ret < 0)
+    {
+        gossip_err("Error: failed to get number of data servers\n");
+        js_p->error_code = ret;
+        return SM_ACTION_COMPLETE;
+    }
+
+    gossip_debug(GOSSIP_CLIENT_DEBUG, "Setting number of datafiles to %d [requested %d]\n", 
+        sm_p->u.create.num_data_files, num_dfiles_requested);
+
     return SM_ACTION_COMPLETE;
 }
 
---------------------
PatchSet 6944 
Date: 2008/06/30 15:32:54
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
Add special case parsing of dist_params directory hints for varstrip
distribution.  Slightly different solution to same problem identified and
fixed by Murali with this patch:

http://www.beowulf-underground.org/pipermail/pvfs2-users/2007-January/001730.html

Members: 
	src/client/sysint/sys-create.sm:1.120->1.121 

Index: pvfs2-1/src/client/sysint/sys-create.sm
diff -u pvfs2-1/src/client/sysint/sys-create.sm:1.120 pvfs2-1/src/client/sysint/sys-create.sm:1.121
--- pvfs2-1/src/client/sysint/sys-create.sm:1.120	Mon Jun 30 14:59:28 2008
+++ pvfs2-1/src/client/sysint/sys-create.sm	Mon Jun 30 15:32:54 2008
@@ -26,6 +26,7 @@
 #include "pint-dist-utils.h"
 #include "ncache.h"
 #include "pvfs2-internal.h"
+#include "pvfs2-dist-varstrip.h"
 
 extern job_context_id pint_client_sm_context;
 
@@ -1080,9 +1081,36 @@
         int64_t tmp_val;
         int nparams = 0;
 
+        if (strncmp(current_dist->dist_name, 
+            PVFS_DIST_VARSTRIP_NAME, 
+            PVFS_DIST_VARSTRIP_NAME_SIZE) == 0) 
+        {
+            /* varstrip parameters are a special case; we can't use the
+             * normal split_keyvals function because the : separater is also
+             * used within paramers that only varstrip can parse
+             */ 
+
+            /* look for a "strips:" prefix */
+            if(strstr(attr->u.dir.hint.dist_params, "strips:") 
+                != attr->u.dir.hint.dist_params)
+            {
+                gossip_err("Error: failed to parse directory hints for varstrip distribution.\n");
+                js_p->error_code = -PVFS_EINVAL;
+                return SM_ACTION_COMPLETE;
+            }
+            if(current_dist->methods->set_param(current_dist->dist_name,
+                current_dist->params,
+                "strips",
+                &attr->u.dir.hint.dist_params[strlen("strips:")]))
+            {
+                gossip_err("Error: failed to set directory hints for varstrip distribution.\n");
+                js_p->error_code = -PVFS_EINVAL;
+                return SM_ACTION_COMPLETE;
+            }
+        }
         /* ignore parse errors! */
         /* TODO: why should we ignore parsing errors? */
-        if (PINT_split_keyvals(attr->u.dir.hint.dist_params,
+        else if (PINT_split_keyvals(attr->u.dir.hint.dist_params,
             &nparams, &key, &val) == 0)
         {
             int i;
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to