List:Commits« Previous MessageNext Message »
From:tomas Date:January 12 2006 4:04pm
Subject:bk commit into 5.1 tree (tomas:1.2040)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2040 06/01/12 17:04:32 tomas@stripped +5 -0
  Merge tomas@orca:/home/pekka/ndb/version/my51-rbr
  into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-wl2325-v6

  storage/ndb/include/ndbapi/NdbDictionary.hpp
    1.60 06/01/12 17:04:27 tomas@stripped +1 -2
    merge

  storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
    1.10 06/01/12 17:02:42 tomas@stripped +0 -0
    Auto merged

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
    1.28 06/01/12 17:02:42 tomas@stripped +0 -0
    Auto merged

  storage/ndb/src/ndbapi/NdbEventOperation.cpp
    1.8 06/01/12 17:02:42 tomas@stripped +0 -0
    Auto merged

  storage/ndb/include/ndbapi/NdbEventOperation.hpp
    1.16 06/01/12 17:02:42 tomas@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-wl2325-v6/RESYNC

--- 1.59/storage/ndb/include/ndbapi/NdbDictionary.hpp	2006-01-12 00:16:52 +01:00
+++ 1.60/storage/ndb/include/ndbapi/NdbDictionary.hpp	2006-01-12 17:04:27 +01:00
@@ -1036,6 +1036,9 @@
       TE_GCP_COMPLETE=1<<7, ///< GCP is complete
       TE_CLUSTER_FAILURE=1<<8, ///< Cluster is unavailable
       TE_STOP        =1<<9, ///< Stop of event operation
+      TE_NODE_FAILURE=1<<10, ///< Node failed
+      TE_SUBSCRIBE   =1<<11, ///< Node subscribes
+      TE_UNSUBSCRIBE =1<<12, ///< Node unsubscribes
       TE_ALL=0xFFFF         ///< Any/all event on table (not relevant when 
                             ///< events are received)
     };
@@ -1052,7 +1055,10 @@
       _TE_GCP_COMPLETE=7,
       _TE_CLUSTER_FAILURE=8,
       _TE_STOP=9,
-      _TE_NUL=10 // internal (INS o DEL within same GCI)
+      _TE_NODE_FAILURE=10,
+      _TE_SUBSCRIBE=11,
+      _TE_UNSUBSCRIBE=12
+      _TE_NUL=13 // internal (INS o DEL within same GCI)
     };
 #endif
     /**
@@ -1081,6 +1087,15 @@
     };
 
     /**
+     * Specifies reporting options for table events
+     */
+    enum EventReport {
+      ER_UPDATED = 0,
+      ER_ALL = 1,
+      ER_SUBSCRIBE = 2
+    };
+
+    /**
      *  Constructor
      *  @param  name  Name of event
      */
@@ -1135,6 +1150,14 @@
      * Get durability of the event
      */
     EventDurability getDurability() const;
+    /**
+     * Set report option of the event
+     */
+    void setReport(EventReport);
+    /**
+     * Get report option of the event
+     */
+    EventReport getReport() const;
 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
     void addColumn(const Column &c);
 #endif

--- 1.15/storage/ndb/include/ndbapi/NdbEventOperation.hpp	2005-12-05 15:19:27 +01:00
+++ 1.16/storage/ndb/include/ndbapi/NdbEventOperation.hpp	2006-01-12 17:02:42 +01:00
@@ -210,6 +210,7 @@
   int hasError() const;
 
   int getReqNodeId() const;
+  int getNdbdNodeId() const;
 #endif
 
 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL

--- 1.7/storage/ndb/src/ndbapi/NdbEventOperation.cpp	2005-12-05 15:19:27 +01:00
+++ 1.8/storage/ndb/src/ndbapi/NdbEventOperation.cpp	2006-01-12 17:02:42 +01:00
@@ -162,6 +162,11 @@
   return m_impl.m_data_item->sdata->req_nodeid;
 }
 
+int NdbEventOperation::getNdbdNodeId() const
+{
+  return m_impl.m_data_item->sdata->ndbd_nodeid;
+}
+
 /*
  * Private members
  */

--- 1.27/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2006-01-02 09:57:27 +01:00
+++ 1.28/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2006-01-12 17:02:42 +01:00
@@ -270,6 +270,7 @@
   m_state= EO_ERROR;
   mi_type= 0;
   m_magic_number= 0;
+  m_error.code= myDict->getNdbError().code;
   m_ndb->theEventBuffer->remove_op();
   m_ndb->theEventBuffer->add_drop_unlock();
   DBUG_RETURN(r);
@@ -672,7 +673,7 @@
 
   NdbMutex_Lock(m_mutex);
   NdbEventOperationImpl *ev_op= move_data();
-  if (unlikely(ev_op == 0))
+  if (unlikely(ev_op == 0 && aMillisecondNumber))
   {
     NdbCondition_WaitTimeout(p_cond, m_mutex, aMillisecondNumber);
     ev_op= move_data();
@@ -1015,6 +1016,33 @@
 }
 
 void
+NdbEventBuffer::report_node_failure(Uint32 node_id)
+{
+  DBUG_ENTER("NdbEventBuffer::report_node_failure");
+  SubTableData data;
+  LinearSectionPtr ptr[3];
+  bzero(&data, sizeof(data));
+  bzero(ptr, sizeof(ptr));
+
+  data.tableId = ~0;
+  data.operation = NdbDictionary::Event::_TE_NODE_FAILURE;
+  data.req_nodeid = (Uint8)node_id;
+  data.ndbd_nodeid = (Uint8)node_id;
+  data.logType = SubTableData::LOG;
+  /**
+   * Insert this event for each operation
+   */
+  NdbEventOperation* op= 0;
+  while((op = m_ndb->getEventOperation(op)))
+  {
+    NdbEventOperationImpl* impl= &op->m_impl;
+    data.senderData = impl->m_oid;
+    insertDataL(impl, &data, ptr); 
+  }
+  DBUG_VOID_RETURN;
+}
+
+void
 NdbEventBuffer::completeClusterFailed()
 {
   DBUG_ENTER("NdbEventBuffer::completeClusterFailed");
@@ -1647,7 +1675,7 @@
     m_min_free_thresh= m_free_thresh;
     m_max_free_thresh= 100;
     goto send_report;
- }
+  }
   if (latest_gci-apply_gci >=  m_gci_slip_thresh)
   {
     goto send_report;

--- 1.9/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2005-12-05 15:19:28 +01:00
+++ 1.10/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp	2006-01-12 17:02:42 +01:00
@@ -254,7 +254,7 @@
   void execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep);
   void complete_outof_order_gcis();
   
-  void reportClusterFailed(NdbEventOperationImpl *op);
+  void report_node_failure(Uint32 node_id);
   void completeClusterFailed();
 
   // used by user thread 
Thread
bk commit into 5.1 tree (tomas:1.2040)tomas12 Jan