MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:March 4 2010 2:31pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3127)
Bug#50196
View as plain text  
#At file:///home/msvensson/mysql/6.3/ based on revid:magnus.blaudd@strippedvzz429y83z

 3127 Magnus Blåudd	2010-03-04
      Bug#50196 ndb_mgm REPORT MEMORY shows 2 Index memory status lines when using ndbmtd
       - additionl fix to cope with differing 'qsort' implementations(it's not
         supposed to be stable, but some seem to be), we really
         want to DataMemery lines to go before IndexMemory so do an
        extra compare of source_nodeid is equal

    modified:
      storage/ndb/src/mgmapi/mgmapi.cpp
=== modified file 'storage/ndb/src/mgmapi/mgmapi.cpp'
--- a/storage/ndb/src/mgmapi/mgmapi.cpp	2010-02-22 09:44:41 +0000
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp	2010-03-04 14:31:16 +0000
@@ -3055,9 +3055,27 @@ cmp_event(const void *_a, const void *_b
   const ndb_logevent *a = (const ndb_logevent*)_a;
   const ndb_logevent *b = (const ndb_logevent*)_b;
 
-  if (a->source_nodeid > b->source_nodeid)
-    return 1;
-  return -1;
+  // So far all events are of same type
+  assert(a->type == b->type);
+
+  // Primarily sort on source_nodeid
+  const unsigned diff = (a->source_nodeid - b->source_nodeid);
+  if (diff)
+    return diff;
+
+  // Equal nodeid, go into more detailed compare
+  // for some event types where order is important
+  switch(a->type){
+  case NDB_LE_MemoryUsage:
+    // Return DataMemory before IndexMemory (ie. TUP vs ACC)
+    return (b->MemoryUsage.block - a->MemoryUsage.block);
+    break;
+
+  default:
+    break;
+  }
+
+  return 0;
 }
 
 NdbLogEventHandle

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100304143116-0ckqk1jief823upu.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3127)Bug#50196Magnus Blåudd4 Mar