ndb - bug#14935 - post-review

parent 15783e44
...@@ -254,6 +254,8 @@ inline const Uint32* ALIGN_WORD(const void* ptr) ...@@ -254,6 +254,8 @@ inline const Uint32* ALIGN_WORD(const void* ptr)
#define ZSTORED_PROCEDURE_FREE 0xffff #define ZSTORED_PROCEDURE_FREE 0xffff
#define ZMIN_PAGE_LIMIT_TUP_COMMITREQ 2 #define ZMIN_PAGE_LIMIT_TUP_COMMITREQ 2
#define ZSKIP_TUX_TRIGGERS 0x1 // flag for TUP_ABORTREQ
#endif #endif
class Dbtup: public SimulatedBlock { class Dbtup: public SimulatedBlock {
...@@ -2155,8 +2157,6 @@ private: ...@@ -2155,8 +2157,6 @@ private:
//------------------------------------------------------------------ //------------------------------------------------------------------
//------------------------------------------------------------------ //------------------------------------------------------------------
void tupkeyErrorLab(Signal* signal); void tupkeyErrorLab(Signal* signal);
// need flag to skip TUX indexes
void do_tup_abortreq(Signal*, Uint32 flags); void do_tup_abortreq(Signal*, Uint32 flags);
//------------------------------------------------------------------ //------------------------------------------------------------------
......
...@@ -63,6 +63,7 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf) ...@@ -63,6 +63,7 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf)
*/ */
void Dbtup::execTUP_ABORTREQ(Signal* signal) void Dbtup::execTUP_ABORTREQ(Signal* signal)
{ {
ljamEntry();
do_tup_abortreq(signal, 0); do_tup_abortreq(signal, 0);
} }
...@@ -72,7 +73,6 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) ...@@ -72,7 +73,6 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
FragrecordPtr regFragPtr; FragrecordPtr regFragPtr;
TablerecPtr regTabPtr; TablerecPtr regTabPtr;
ljamEntry();
regOperPtr.i = signal->theData[0]; regOperPtr.i = signal->theData[0];
c_operation_pool.getPtr(regOperPtr); c_operation_pool.getPtr(regOperPtr);
TransState trans_state= get_trans_state(regOperPtr.p); TransState trans_state= get_trans_state(regOperPtr.p);
...@@ -97,7 +97,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) ...@@ -97,7 +97,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
{ {
ljam(); ljam();
if (!regTabPtr.p->tuxCustomTriggers.isEmpty() && if (!regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0) (flags & ZSKIP_TUX_TRIGGERS) == 0)
executeTuxAbortTriggers(signal, executeTuxAbortTriggers(signal,
regOperPtr.p, regOperPtr.p,
regFragPtr.p, regFragPtr.p,
...@@ -110,7 +110,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags) ...@@ -110,7 +110,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
c_operation_pool.getPtr(loopOpPtr); c_operation_pool.getPtr(loopOpPtr);
if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED && if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED &&
!regTabPtr.p->tuxCustomTriggers.isEmpty() && !regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0) { (flags & ZSKIP_TUX_TRIGGERS) == 0) {
ljam(); ljam();
executeTuxAbortTriggers(signal, executeTuxAbortTriggers(signal,
loopOpPtr.p, loopOpPtr.p,
......
...@@ -748,11 +748,19 @@ void Dbtup::execTUPKEYREQ(Signal* signal) ...@@ -748,11 +748,19 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regTabPtr) != 0) { regTabPtr) != 0) {
jam(); jam();
/* /*
* undo the change before tupkeyErrorLab resets the op * TUP insert succeeded but add of TUX entries failed. All
* assume no timeslicing can occur even with diskdata * TUX changes have been rolled back at this point.
*
* We will abort via tupkeyErrorLab() as usual. This routine
* however resets the operation to ZREAD. The TUP_ABORTREQ
* arriving later cannot then undo the insert.
*
* Therefore we call TUP_ABORTREQ already now. Diskdata etc
* should be in memory and timeslicing cannot occur. We must
* skip TUX abort triggers since TUX is already aborted.
*/ */
signal->theData[0] = operPtr.i; signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1); do_tup_abortreq(signal, ZSKIP_TUX_TRIGGERS);
tupkeyErrorLab(signal); tupkeyErrorLab(signal);
return; return;
} }
...@@ -782,10 +790,10 @@ void Dbtup::execTUPKEYREQ(Signal* signal) ...@@ -782,10 +790,10 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regTabPtr) != 0) { regTabPtr) != 0) {
jam(); jam();
/* /*
* see insert case * See insert case.
*/ */
signal->theData[0] = operPtr.i; signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1); do_tup_abortreq(signal, ZSKIP_TUX_TRIGGERS);
tupkeyErrorLab(signal); tupkeyErrorLab(signal);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment