2875 Pekka Nousiainen 2009-04-17
MT-DD-SR 04_undo.diff
Copy UNDO data to local buffer in TUP proxy.
LGMAN could overwrite the data during timeslice via PGMAN/5.
modified:
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp
2874 Pekka Nousiainen 2009-04-17
MT-DD-SR 03_undo.diff
Assert that DD UNDO is processed one record at a time.
modified:
storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp
2873 Magnus Blåudd 2009-04-16
ndb - fix compiler warnings
- remove unimplemented ArrayPool::load causing vc++ to complain when instantiating
- Use Uint64 variable for incrementin GlobalData.JobLap
- Remove unecessary forward declaration of IPCConfig
modified:
storage/ndb/src/kernel/vm/ArrayPool.hpp
storage/ndb/src/kernel/vm/FastScheduler.cpp
storage/ndb/src/ndbapi/TransporterFacade.hpp
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2009-04-04 20:53:52 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2009-04-17 19:02:12 +0000
@@ -3188,7 +3188,7 @@ private:
// these 2 were file-static before mt-lqh
bool f_undo_done;
Dbtup::Apply_undo f_undo;
- Uint32 c_proxy_undo_data[MAX_TUPLE_SIZE_IN_WORDS];
+ Uint32 c_proxy_undo_data[20 + MAX_TUPLE_SIZE_IN_WORDS];
void disk_restart_undo_next(Signal*);
void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag, Uint32 lcpId);
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp 2009-04-08 13:44:27 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp 2009-04-17 19:02:12 +0000
@@ -255,6 +255,7 @@ DbtupProxy::Proxy_undo::Proxy_undo()
m_fragment_id = ~(Uint32)0;
m_instance_no = ~(Uint32)0;
m_actions = 0;
+ m_in_use = false;
}
void
@@ -262,7 +263,9 @@ DbtupProxy::disk_restart_undo(Signal* si
Uint32 type, const Uint32 * ptr, Uint32 len)
{
Proxy_undo& undo = c_proxy_undo;
+ ndbrequire(!undo.m_in_use);
new (&undo) Proxy_undo;
+ undo.m_in_use = true;
D("proxy: disk_restart_undo" << V(type) << hex << V(ptr) << dec << V(len) << V(lsn));
undo.m_type = type;
@@ -270,6 +273,13 @@ DbtupProxy::disk_restart_undo(Signal* si
undo.m_ptr = ptr;
undo.m_lsn = lsn;
+ /*
+ * The timeslice via PGMAN/5 gives LGMAN a chance to overwrite the
+ * data pointed to by ptr. So save it now and do not use ptr.
+ */
+ ndbrequire(undo.m_len <= Proxy_undo::MaxData);
+ memcpy(undo.m_data, undo.m_ptr, undo.m_len << 2);
+
switch (undo.m_type) {
case File_formats::Undofile::UNDO_LCP_FIRST:
case File_formats::Undofile::UNDO_LCP:
@@ -445,7 +455,7 @@ DbtupProxy::disk_restart_undo_finish(Sig
if (undo.m_actions & Proxy_undo::NoExecute) {
jam();
- return;
+ goto finish;
}
if (undo.m_actions & Proxy_undo::GetInstance) {
@@ -467,6 +477,10 @@ DbtupProxy::disk_restart_undo_finish(Sig
disk_restart_undo_send(signal, i);
}
}
+
+finish:
+ ndbrequire(undo.m_in_use);
+ undo.m_in_use = false;
}
void
@@ -477,12 +491,10 @@ DbtupProxy::disk_restart_undo_send(Signa
* 1) a method call would execute in another non-mutexed Pgman
* 2) MT-LGMAN is planned, do not optimize (pass pointer) now
*/
- const Proxy_undo& undo = c_proxy_undo;
- ndbrequire(undo.m_len <= MaxUndoData);
- memcpy(c_proxy_undo_data, undo.m_ptr, undo.m_len << 2);
+ Proxy_undo& undo = c_proxy_undo;
LinearSectionPtr ptr[3];
- ptr[0].p = c_proxy_undo_data;
+ ptr[0].p = undo.m_data;
ptr[0].sz = undo.m_len;
signal->theData[0] = ZDISK_RESTART_UNDO;
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp 2009-03-16 17:05:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp 2009-04-17 19:02:12 +0000
@@ -92,13 +92,12 @@ protected:
// LGMAN
- enum { MaxUndoData = MAX_TUPLE_SIZE_IN_WORDS };
- Uint32 c_proxy_undo_data[MaxUndoData];
-
struct Proxy_undo {
+ enum { MaxData = 20 + MAX_TUPLE_SIZE_IN_WORDS };
Uint32 m_type;
Uint32 m_len;
const Uint32* m_ptr;
+ Uint32 m_data[MaxData]; // copied from m_ptr at once
Uint64 m_lsn;
// from undo entry and page
Local_key m_key;
@@ -114,6 +113,7 @@ protected:
SendUndoNext = 16
};
Uint32 m_actions;
+ bool m_in_use;
Proxy_undo();
};
Proxy_undo c_proxy_undo;
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (pekka:2873 to 2875) | Pekka Nousiainen | 17 Apr |