Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
53fe7d83
Commit
53fe7d83
authored
Feb 21, 2007
by
jonas@eel.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge localhost:/home/jonas/src/51-work
into eel.(none):/home/jonas/src/51-work
parents
1d99e609
5fd96a45
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
12 deletions
+85
-12
storage/ndb/src/kernel/blocks/tsman.cpp
storage/ndb/src/kernel/blocks/tsman.cpp
+2
-3
storage/ndb/src/kernel/vm/RWPool.cpp
storage/ndb/src/kernel/vm/RWPool.cpp
+9
-5
storage/ndb/src/kernel/vm/RWPool.hpp
storage/ndb/src/kernel/vm/RWPool.hpp
+3
-1
storage/ndb/src/kernel/vm/WOPool.cpp
storage/ndb/src/kernel/vm/WOPool.cpp
+1
-1
storage/ndb/src/kernel/vm/WOPool.hpp
storage/ndb/src/kernel/vm/WOPool.hpp
+4
-2
storage/ndb/test/ndbapi/testNodeRestart.cpp
storage/ndb/test/ndbapi/testNodeRestart.cpp
+66
-0
No files found.
storage/ndb/src/kernel/blocks/tsman.cpp
View file @
53fe7d83
...
...
@@ -1844,6 +1844,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
ndbrequire
(
m_file_hash
.
find
(
file_ptr
,
file_key
));
struct
req
val
=
lookup_extent
(
req
.
key
.
m_page_no
,
file_ptr
.
p
);
Uint32
page_no_in_extent
=
calc_page_no_in_extent
(
req
.
key
.
m_page_no
,
&
val
);
Page_cache_client
::
Request
preq
;
preq
.
m_page
.
m_page_no
=
val
.
m_extent_page_no
;
...
...
@@ -1869,7 +1870,6 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
ndbrequire
(
header
->
m_table
==
req
.
request
.
table_id
);
Uint32
page_no_in_extent
=
calc_page_no_in_extent
(
req
.
key
.
m_page_no
,
&
val
);
Uint32
word
=
header
->
get_free_word_offset
(
page_no_in_extent
);
Uint32
shift
=
SZ
*
(
page_no_in_extent
&
7
);
...
...
@@ -1929,8 +1929,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
found:
header
->
update_free_bits
(
page_no
,
src_bits
|
UNCOMMITTED_MASK
);
rep
->
bits
=
(
src_bits
&
UNCOMMITTED_MASK
)
>>
UNCOMMITTED_SHIFT
;
rep
->
key
.
m_page_no
=
val
.
m_extent_pages
+
val
.
m_extent_no
*
val
.
m_extent_size
+
page_no
;
rep
->
key
.
m_page_no
=
req
.
key
.
m_page_no
+
page_no
-
page_no_in_extent
;
rep
->
reply
.
errorCode
=
0
;
return
;
}
...
...
storage/ndb/src/kernel/vm/RWPool.cpp
View file @
53fe7d83
...
...
@@ -22,7 +22,7 @@
RWPool
::
RWPool
()
{
bzero
(
this
,
sizeof
(
*
this
));
m_current_pos
=
GLOBAL_PAGE_SIZ
E_WORDS
;
m_current_pos
=
RWPage
::
RWPAG
E_WORDS
;
m_current_first_free
=
REC_NIL
;
m_first_free_page
=
RNIL
;
}
...
...
@@ -57,7 +57,7 @@ seize_free:
m_current_first_free
=
pageP
->
m_data
[
pos
+
m_record_info
.
m_offset_next_pool
];
return
true
;
}
else
if
(
pos
+
size
<
GLOBAL_PAGE_SIZ
E_WORDS
)
else
if
(
pos
+
size
<
RWPage
::
RWPAG
E_WORDS
)
{
seize_first:
ptr
.
i
=
(
m_current_page_no
<<
POOL_RECORD_BITS
)
+
pos
;
...
...
@@ -81,11 +81,14 @@ seize_first:
{
pageP
=
m_current_page
=
m_memroot
+
m_first_free_page
;
m_current_page_no
=
m_first_free_page
;
m_current_pos
=
GLOBAL_PAGE_SIZ
E_WORDS
;
m_current_pos
=
RWPage
::
RWPAG
E_WORDS
;
m_current_first_free
=
m_current_page
->
m_first_free
;
m_first_free_page
=
m_current_page
->
m_next_page
;
m_current_ref_count
=
m_current_page
->
m_ref_count
;
(
m_memroot
+
m_first_free_page
)
->
m_prev_page
=
RNIL
;
if
(
m_first_free_page
!=
RNIL
)
{
(
m_memroot
+
m_first_free_page
)
->
m_prev_page
=
RNIL
;
}
goto
seize_free
;
}
...
...
@@ -105,7 +108,7 @@ seize_first:
m_current_page
=
0
;
m_current_page_no
=
RNIL
;
m_current_pos
=
GLOBAL_PAGE_SIZ
E_WORDS
;
m_current_pos
=
RWPage
::
RWPAG
E_WORDS
;
m_current_first_free
=
REC_NIL
;
return
false
;
...
...
@@ -154,6 +157,7 @@ RWPool::release(Ptr<void> ptr)
}
page
->
m_next_page
=
ffp
;
page
->
m_prev_page
=
RNIL
;
m_first_free_page
=
ptr_page
;
return
;
}
else
if
(
ref_cnt
==
1
)
...
...
storage/ndb/src/kernel/vm/RWPool.hpp
View file @
53fe7d83
...
...
@@ -20,12 +20,14 @@
struct
RWPage
{
STATIC_CONST
(
RWPAGE_WORDS
=
GLOBAL_PAGE_SIZE_WORDS
-
4
);
Uint32
m_type_id
;
Uint16
m_first_free
;
Uint16
m_ref_count
;
Uint32
m_next_page
;
Uint32
m_prev_page
;
Uint32
m_data
[
GLOBAL_PAGE_SIZE_WORDS
-
4
];
Uint32
m_data
[
RWPAGE_WORDS
];
};
/**
...
...
storage/ndb/src/kernel/vm/WOPool.cpp
View file @
53fe7d83
...
...
@@ -20,7 +20,7 @@
WOPool
::
WOPool
()
{
bzero
(
this
,
sizeof
(
*
this
));
m_current_pos
=
GLOBAL_PAGE_SIZ
E_WORDS
;
m_current_pos
=
WOPage
::
WOPAG
E_WORDS
;
}
void
...
...
storage/ndb/src/kernel/vm/WOPool.hpp
View file @
53fe7d83
...
...
@@ -20,9 +20,11 @@
struct
WOPage
{
STATIC_CONST
(
WOPAGE_WORDS
=
GLOBAL_PAGE_SIZE_WORDS
-
2
);
Uint32
m_type_id
;
Uint32
m_ref_count
;
Uint32
m_data
[
GLOBAL_PAGE_SIZE_WORDS
-
2
];
Uint32
m_data
[
WOPAGE_WORDS
];
};
/**
...
...
@@ -61,7 +63,7 @@ WOPool::seize(Ptr<void>& ptr)
Uint32
pos
=
m_current_pos
;
Uint32
size
=
m_record_info
.
m_size
;
WOPage
*
pageP
=
m_current_page
;
if
(
likely
(
pos
+
size
<
GLOBAL_PAGE_SIZ
E_WORDS
))
if
(
likely
(
pos
+
size
<
WOPage
::
WOPAG
E_WORDS
))
{
ptr
.
i
=
(
m_current_page_no
<<
POOL_RECORD_BITS
)
+
pos
;
ptr
.
p
=
(
pageP
->
m_data
+
pos
);
...
...
storage/ndb/test/ndbapi/testNodeRestart.cpp
View file @
53fe7d83
...
...
@@ -1258,6 +1258,68 @@ runBug26481(NDBT_Context* ctx, NDBT_Step* step)
return
NDBT_OK
;
}
int
runBug26450
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
)
{
Uint32
i
;
int
result
=
NDBT_OK
;
int
loops
=
ctx
->
getNumLoops
();
int
records
=
ctx
->
getNumRecords
();
NdbRestarter
res
;
Ndb
*
pNdb
=
GETNDB
(
step
);
int
node
=
res
.
getRandomNotMasterNodeId
(
rand
());
Vector
<
int
>
nodes
;
for
(
unsigned
i
=
0
;
i
<
res
.
getNumDbNodes
();
i
++
)
{
if
(
res
.
getDbNodeId
(
i
)
!=
node
)
nodes
.
push_back
(
res
.
getDbNodeId
(
i
));
}
if
(
res
.
restartAll
())
return
NDBT_FAILED
;
if
(
res
.
waitClusterStarted
())
return
NDBT_FAILED
;
ndbout_c
(
"node: %d"
,
node
);
if
(
res
.
restartOneDbNode
(
node
,
false
,
true
,
true
))
return
NDBT_FAILED
;
if
(
res
.
waitNodesNoStart
(
&
node
,
1
))
return
NDBT_FAILED
;
if
(
runClearTable
(
ctx
,
step
))
return
NDBT_FAILED
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
if
(
res
.
restartAll
(
false
,
true
,
i
>
0
))
return
NDBT_FAILED
;
if
(
res
.
waitClusterNoStart
())
return
NDBT_FAILED
;
if
(
res
.
startNodes
(
nodes
.
getBase
(),
nodes
.
size
()))
return
NDBT_FAILED
;
if
(
res
.
waitNodesStarted
(
nodes
.
getBase
(),
nodes
.
size
()))
return
NDBT_FAILED
;
}
if
(
res
.
startNodes
(
&
node
,
1
))
return
NDBT_FAILED
;
if
(
res
.
waitNodesStarted
(
&
node
,
1
))
return
NDBT_FAILED
;
HugoTransactions
trans
(
*
ctx
->
getTab
());
if
(
trans
.
selectCount
(
pNdb
)
!=
0
)
return
NDBT_FAILED
;
return
NDBT_OK
;
}
NDBT_TESTSUITE
(
testNodeRestart
);
TESTCASE
(
"NoLoad"
,
"Test that one node at a time can be stopped and then restarted "
\
...
...
@@ -1599,6 +1661,10 @@ TESTCASE("Bug26457", ""){
TESTCASE
(
"Bug26481"
,
""
){
INITIALIZER
(
runBug26481
);
}
TESTCASE
(
"Bug26450"
,
""
){
INITIALIZER
(
runLoadTable
);
INITIALIZER
(
runBug26450
);
}
NDBT_TESTSUITE_END
(
testNodeRestart
);
int
main
(
int
argc
,
const
char
**
argv
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment