[Pvfs2-cvs] commit by bligon in pvfs2/src/io/trove/trove-dbpf: dbpf-dspace.c

CVS commit program cvs at parl.clemson.edu
Fri Jun 10 16:23:09 EDT 2011


Update of /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf
In directory parlweb1:/tmp/cvs-serv11210/src/io/trove/trove-dbpf

Modified Files:
      Tag: Orange-Branch
	dbpf-dspace.c 
Log Message:
Apply patch submitted by Phil Carns that removes duplicate handles from the
result set produced by the iterate-handle function.  Duplicates were possibly
introduced into the system by an older version of BDB (4.8 and prior).  Nightly
tests showed no problem with changes.
	src/io/trove/trove-dbpf/dbpf-dspace.c 
 	src/io/trove/trove-handle-mgmt/trove-handle-mgmt.c 


Index: dbpf-dspace.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf-dspace.c,v
diff -p -u -r1.163.10.5 -r1.163.10.6
--- dbpf-dspace.c	30 Apr 2010 20:00:52 -0000	1.163.10.5
+++ dbpf-dspace.c	10 Jun 2011 20:23:09 -0000	1.163.10.6
@@ -892,6 +892,15 @@ static int dbpf_dspace_iterate_handles_o
                 continue;
             }
 
+            /* check for duplicates */
+            if(i > 0 && *(TROVE_handle*)tmp_handle == op_p->u.d_iterate_handles.handle_array[i-1])
+            {
+                gossip_err("Warning: got duplicate handle %llu.\n", llu(*(TROVE_handle*)tmp_handle));
+                gossip_err("Warning: skipping entry.\n");
+                i--;
+                continue;
+            }
+
             op_p->u.d_iterate_handles.handle_array[i] =
                 *(TROVE_handle *)tmp_handle;
         }
@@ -923,8 +932,16 @@ static int dbpf_dspace_iterate_handles_o
             {
                 goto get_next;
             }
+
+            if(*(TROVE_handle*)tmp_handle == op_p->u.d_iterate_handles.handle_array[*op_p->u.d_iterate_handles.count_p])
+            {
+                gossip_err("Warning: found duplicate handle: %llu\n", llu(*(TROVE_handle*)tmp_handle));
+                gossip_err("Warning: skipping entry.\n");
+            }
+
         } while (sizeof_handle != sizeof(TROVE_handle) ||
-           sizeof_attr != sizeof(attr));
+           sizeof_attr != sizeof(attr) ||
+           *(TROVE_handle*)tmp_handle == op_p->u.d_iterate_handles.handle_array[*op_p->u.d_iterate_handles.count_p]);
 
         *op_p->u.d_iterate_handles.position_p = *(TROVE_handle *)tmp_handle;
         goto return_ok;
@@ -955,6 +972,13 @@ get_next:
         gossip_debug(GOSSIP_TROVE_DEBUG, "iterate -- some other "
                      "failure @ recno\n");
         ret = -dbpf_db_error_to_trove_error(ret);
+    }
+    if(*op_p->u.d_iterate_handles.count_p > 0 && 
+        dummy_handle == op_p->u.d_iterate_handles.handle_array[*op_p->u.d_iterate_handles.count_p])
+    {
+        gossip_err("Warning: found duplicate handle: %llu\n", llu(dummy_handle));
+        gossip_err("Warning: skipping entry.\n");
+        (*op_p->u.d_iterate_handles.count_p)--;
     }
     *op_p->u.d_iterate_handles.position_p = dummy_handle;
 



More information about the Pvfs2-cvs mailing list