Skip to content

Commit 8d28814

Browse files
committed
Merge 7.2->7.3
2 parents b162d0d + 6b692ef commit 8d28814

File tree

5 files changed

+72
-18
lines changed

5 files changed

+72
-18
lines changed

storage/ndb/src/kernel/blocks/LocalProxy.cpp

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@ LocalProxy::LocalProxy(BlockNumber blockNumber, Block_context& ctx) :
3535
for (i = 0; i < MaxWorkers; i++)
3636
c_worker[i] = 0;
3737

38+
c_anyWorkerCounter = 0;
3839
c_typeOfStart = NodeState::ST_ILLEGAL_TYPE;
3940
c_masterNodeId = ZNIL;
4041

@@ -305,6 +306,37 @@ LocalProxy::loadWorkers()
305306
}
306307
}
307308

309+
void
310+
LocalProxy::forwardToWorkerIndex(Signal* signal, Uint32 index)
311+
{
312+
jam();
313+
/**
314+
* We statelessly forward to one of our
315+
* workers, including any sections that
316+
* might be attached.
317+
*/
318+
BlockReference destRef = workerRef(index);
319+
SectionHandle sh(this, signal);
320+
321+
sendSignal(destRef,
322+
signal->header.theVerId_signalNumber,
323+
signal,
324+
signal->getLength(),
325+
JBB,
326+
&sh);
327+
};
328+
329+
void
330+
LocalProxy::forwardToAnyWorker(Signal* signal)
331+
{
332+
jam();
333+
334+
/* Won't work for fragmented signals */
335+
ndbassert(signal->header.m_fragmentInfo == 0);
336+
337+
forwardToWorkerIndex(signal, getAnyWorkerIndex());
338+
}
339+
308340
// GSN_READ_CONFIG_REQ
309341

310342
void

storage/ndb/src/kernel/blocks/LocalProxy.hpp

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2008, 2010, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -64,6 +64,7 @@ class LocalProxy : public SimulatedBlock {
6464
Uint32 c_workers;
6565
// no gaps - extra worker has index c_lqhWorkers (not MaxLqhWorkers)
6666
SimulatedBlock* c_worker[MaxWorkers];
67+
Uint32 c_anyWorkerCounter;
6768

6869
virtual SimulatedBlock* newWorker(Uint32 instanceNo) = 0;
6970
virtual void loadWorkers();
@@ -94,6 +95,22 @@ class LocalProxy : public SimulatedBlock {
9495
return ino - 1;
9596
}
9697

98+
// Get a worker index - will balance round robin across
99+
// workers over time.
100+
Uint32 getAnyWorkerIndex()
101+
{
102+
return (c_anyWorkerCounter++) % c_workers;
103+
}
104+
105+
// Statelessly forward a signal (including any sections)
106+
// to the worker with the supplied index.
107+
void forwardToWorkerIndex(Signal* signal, Uint32 index);
108+
109+
// Statelessly forward the signal (including any sections)
110+
// to one of the workers, load balancing.
111+
// Requires no arrival order constraints between signals.
112+
void forwardToAnyWorker(Signal* signal);
113+
97114
// support routines and classes ("Ss" = signal state)
98115

99116
typedef void (LocalProxy::*SsFUNCREQ)(Signal*, Uint32 ssId, SectionHandle*);

storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2010, 2011, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
33

44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -16436,33 +16436,33 @@ void Dbdih::makeNodeGroups(Uint32 nodeArray[])
1643616436
*/
1643716437
void Dbdih::execCHECKNODEGROUPSREQ(Signal* signal)
1643816438
{
16439-
jamEntry();
16439+
jamNoBlock();
1644016440
CheckNodeGroups* sd = (CheckNodeGroups*)&signal->theData[0];
1644116441

1644216442
bool direct = (sd->requestType & CheckNodeGroups::Direct);
1644316443
bool ok = false;
1644416444
switch(sd->requestType & ~CheckNodeGroups::Direct){
1644516445
case CheckNodeGroups::ArbitCheck:{
1644616446
ok = true;
16447-
jam();
16447+
jamNoBlock();
1644816448
unsigned missall = 0;
1644916449
unsigned haveall = 0;
1645016450
for (Uint32 i = 0; i < cnoOfNodeGroups; i++) {
16451-
jam();
16451+
jamNoBlock();
1645216452
NodeGroupRecordPtr ngPtr;
1645316453
ngPtr.i = c_node_groups[i];
1645416454
ptrAss(ngPtr, nodeGroupRecord);
1645516455
Uint32 count = 0;
1645616456
for (Uint32 j = 0; j < ngPtr.p->nodeCount; j++) {
16457-
jam();
16457+
jamNoBlock();
1645816458
Uint32 nodeId = ngPtr.p->nodesInGroup[j];
1645916459
if (sd->mask.get(nodeId)) {
16460-
jam();
16460+
jamNoBlock();
1646116461
count++;
1646216462
}//if
1646316463
}//for
1646416464
if (count == 0) {
16465-
jam();
16465+
jamNoBlock();
1646616466
missall++;
1646716467
}//if
1646816468
if (count == ngPtr.p->nodeCount) {
@@ -16471,13 +16471,13 @@ void Dbdih::execCHECKNODEGROUPSREQ(Signal* signal)
1647116471
}//for
1647216472

1647316473
if (missall) {
16474-
jam();
16474+
jamNoBlock();
1647516475
sd->output = CheckNodeGroups::Lose;
1647616476
} else if (haveall) {
16477-
jam();
16477+
jamNoBlock();
1647816478
sd->output = CheckNodeGroups::Win;
1647916479
} else {
16480-
jam();
16480+
jamNoBlock();
1648116481
sd->output = CheckNodeGroups::Partitioning;
1648216482
}//if
1648316483
}
@@ -16503,17 +16503,17 @@ void Dbdih::execCHECKNODEGROUPSREQ(Signal* signal)
1650316503
ngPtr.i = ng;
1650416504
if (ngPtr.i != RNIL)
1650516505
{
16506-
jam();
16506+
jamNoBlock();
1650716507
ptrAss(ngPtr, nodeGroupRecord);
1650816508
for (Uint32 j = 0; j < ngPtr.p->nodeCount; j++) {
16509-
jam();
16509+
jamNoBlock();
1651016510
sd->mask.set(ngPtr.p->nodesInGroup[j]);
1651116511
}
1651216512
}
1651316513
break;
1651416514
}
1651516515
case CheckNodeGroups::GetDefaultFragments:
16516-
jam();
16516+
jamNoBlock();
1651716517
ok = true;
1651816518
sd->output = (cnoOfNodeGroups + sd->extraNodeGroups)
1651916519
* getFragmentsPerNode() * cnoReplicas;

storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
33

44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -9826,7 +9826,7 @@ Dbtc::routeTCKEY_FAILREFCONF(Signal* signal, const ApiConnectRecord* regApiPtr,
98269826
CheckNodeGroups::GetNodeGroupMembers;
98279827
sd->nodeId = node;
98289828
EXECUTE_DIRECT(DBDIH, GSN_CHECKNODEGROUPSREQ, signal,
9829-
CheckNodeGroups::SignalLength);
9829+
CheckNodeGroups::SignalLength, 0);
98309830
jamEntry();
98319831

98329832
NdbNodeBitmask mask;

storage/ndb/src/kernel/blocks/dbtc/DbtcProxy.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -62,6 +62,11 @@ DbtcProxy::DbtcProxy(Block_context& ctx) :
6262
addRecSignal(GSN_ABORT_ALL_REF,&DbtcProxy::execABORT_ALL_REF);
6363
addRecSignal(GSN_ABORT_ALL_CONF,&DbtcProxy::execABORT_ALL_CONF);
6464

65+
// Routed signals are distributed across the workers
66+
// This requires that there's no ordering constraints between them
67+
// GSN_TCKEY_FAILREFCONF_R
68+
addRecSignal(GSN_TCKEY_FAILREFCONF_R, &DbtcProxy::forwardToAnyWorker);
69+
6570
// GSN_CREATE_FK_IMPL_REQ
6671
addRecSignal(GSN_CREATE_FK_IMPL_REQ, &DbtcProxy::execCREATE_FK_IMPL_REQ);
6772
addRecSignal(GSN_CREATE_FK_IMPL_CONF,&DbtcProxy::execCREATE_FK_IMPL_CONF);

0 commit comments

Comments
 (0)