Skip to content

Commit 5bfeb5d

Browse files
committed
Merge branch 'mysql-5.6-cluster-7.4' into mysql-5.7-cluster-7.5 (Bug#26138592)
2 parents 204af08 + ff690de commit 5bfeb5d

File tree

1 file changed

+37
-18
lines changed

1 file changed

+37
-18
lines changed

storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2003, 2017, 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
@@ -640,6 +640,27 @@ void Dbacc::releaseFragResources(Signal* signal, Uint32 fragIndex)
640640
regFragPtr.i = fragIndex;
641641
ptrCheckGuard(regFragPtr, cfragmentsize, fragmentrec);
642642
verifyFragCorrect(regFragPtr);
643+
644+
if (regFragPtr.p->expandOrShrinkQueued)
645+
{
646+
regFragPtr.p->level.clear();
647+
648+
// slack > 0 ensures EXPANDCHECK2 will do nothing.
649+
regFragPtr.p->slack = 1;
650+
651+
// slack <= slackCheck ensures SHRINKCHECK2 will do nothing.
652+
regFragPtr.p->slackCheck = regFragPtr.p->slack;
653+
654+
/**
655+
* Wait out pending expand or shrink.
656+
* They need a valid Fragmentrec.
657+
*/
658+
signal->theData[0] = ZREL_FRAG;
659+
signal->theData[1] = regFragPtr.i;
660+
sendSignal(cownBlockref, GSN_CONTINUEB, signal, 2, JBB);
661+
return;
662+
}
663+
643664
if (!regFragPtr.p->directory.isEmpty()) {
644665
jam();
645666
DynArr256::ReleaseIterator iter;
@@ -5537,6 +5558,15 @@ void Dbacc::execEXPANDCHECK2(Signal* signal)
55375558
}
55385559
return;
55395560
}//if
5561+
if (fragrecptr.p->level.isFull())
5562+
{
5563+
jam();
5564+
/*
5565+
* The level structure does not allow more buckets.
5566+
* Do not expand.
5567+
*/
5568+
return;
5569+
}
55405570
if (fragrecptr.p->sparsepages.isEmpty())
55415571
{
55425572
jam();
@@ -5561,16 +5591,6 @@ void Dbacc::execEXPANDCHECK2(Signal* signal)
55615591
return;
55625592
}//if
55635593

5564-
if (fragrecptr.p->level.isFull())
5565-
{
5566-
jam();
5567-
/*
5568-
* The level structure does not allow more buckets.
5569-
* Do not expand.
5570-
*/
5571-
return;
5572-
}
5573-
55745594
Uint32 splitBucket;
55755595
Uint32 receiveBucket;
55765596

@@ -6282,6 +6302,12 @@ void Dbacc::execSHRINKCHECK2(Signal* signal)
62826302
/*--------------------------------------------------------------*/
62836303
return;
62846304
}//if
6305+
if (fragrecptr.p->level.isEmpty())
6306+
{
6307+
jam();
6308+
/* no need to shrink empty hash table */
6309+
return;
6310+
}
62856311
if (fragrecptr.p->sparsepages.isEmpty())
62866312
{
62876313
jam();
@@ -6300,13 +6326,6 @@ void Dbacc::execSHRINKCHECK2(Signal* signal)
63006326
/* CANNOT COMPLETE THE SHRINK. TO AVOID THE CRASH WE EXIT HERE. */
63016327
/*--------------------------------------------------------------*/
63026328
return;
6303-
}//if
6304-
6305-
if (fragrecptr.p->level.isEmpty())
6306-
{
6307-
jam();
6308-
/* no need to shrink empty hash table */
6309-
return;
63106329
}
63116330

63126331
// Since expandCounter guards more shrinks than expands and

0 commit comments

Comments
 (0)