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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ddebf42b
Commit
ddebf42b
authored
Mar 03, 2006
by
jonas@eel.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb dd - bug#16913
Use shared pool for tablespaces/datafiles in tsman
parent
f867b02a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
36 deletions
+52
-36
storage/ndb/src/kernel/blocks/tsman.cpp
storage/ndb/src/kernel/blocks/tsman.cpp
+30
-26
storage/ndb/src/kernel/blocks/tsman.hpp
storage/ndb/src/kernel/blocks/tsman.hpp
+22
-10
No files found.
storage/ndb/src/kernel/blocks/tsman.cpp
View file @
ddebf42b
...
...
@@ -83,9 +83,7 @@ Tsman::Tsman(Block_context& ctx,
addRecSignal
(
GSN_GET_TABINFOREQ
,
&
Tsman
::
execGET_TABINFOREQ
);
m_tablespace_pool
.
setSize
(
10
);
m_tablespace_hash
.
setSize
(
10
);
m_file_pool
.
setSize
(
10
);
m_file_hash
.
setSize
(
10
);
}
...
...
@@ -109,6 +107,12 @@ Tsman::execREAD_CONFIG_REQ(Signal* signal)
m_ctx
.
m_config
.
getOwnConfigIterator
();
ndbrequire
(
p
!=
0
);
Pool_context
pc
;
pc
.
m_block
=
this
;
m_file_pool
.
init
(
RT_TSMAN_FILE
,
pc
);
m_tablespace_pool
.
init
(
RT_TSMAN_FILEGROUP
,
pc
);
ReadConfigConf
*
conf
=
(
ReadConfigConf
*
)
signal
->
getDataPtrSend
();
conf
->
senderRef
=
reference
();
conf
->
senderData
=
senderData
;
...
...
@@ -431,10 +435,10 @@ Tsman::execDROP_FILEGROUP_REQ(Signal* signal){
bool
Tsman
::
find_file_by_id
(
Ptr
<
Datafile
>&
ptr
,
D
LList
<
Datafile
>
::
Head
&
head
,
D
atafile_list
::
Head
&
head
,
Uint32
id
)
{
Local
DLList
<
Datafile
>
list
(
m_file_pool
,
head
);
Local
_datafile_list
list
(
m_file_pool
,
head
);
for
(
list
.
first
(
ptr
);
!
ptr
.
isNull
();
list
.
next
(
ptr
))
if
(
ptr
.
p
->
m_file_id
==
id
)
return
true
;
...
...
@@ -522,7 +526,7 @@ Tsman::execCREATE_FILE_REQ(Signal* signal){
}
new
(
file_ptr
.
p
)
Datafile
(
req
);
Local
DLList
<
Datafile
>
tmp
(
m_file_pool
,
ptr
.
p
->
m_meta_files
);
Local
_datafile_list
tmp
(
m_file_pool
,
ptr
.
p
->
m_meta_files
);
tmp
.
add
(
file_ptr
);
file_ptr
.
p
->
m_state
=
Datafile
::
FS_CREATING
;
...
...
@@ -649,7 +653,7 @@ Tsman::execFSCLOSECONF(Signal* signal)
{
m_tablespace_pool
.
getPtr
(
lg_ptr
,
ptr
.
p
->
m_tablespace_ptr_i
);
Local
DLList
<
Datafile
>
list
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
list
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
list
.
release
(
ptr
);
}
}
...
...
@@ -833,7 +837,7 @@ Tsman::create_file_ref(Signal* signal,
sendSignal
(
ptr
.
p
->
m_create
.
m_senderRef
,
GSN_CREATE_FILE_REF
,
signal
,
CreateFileImplRef
::
SignalLength
,
JBB
);
Local
DLList
<
Datafile
>
meta
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
meta
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
meta
.
release
(
ptr
);
}
...
...
@@ -1104,8 +1108,8 @@ Tsman::load_extent_page_callback(Signal* signal,
(
getNodeState
().
getNodeRestartInProgress
()
&&
getNodeState
().
starting
.
restartType
==
NodeState
::
ST_INITIAL_NODE_RESTART
))
{
Local
DLList
<
Datafile
>
free
(
m_file_pool
,
ts_ptr
.
p
->
m_free_files
);
Local
DLList
<
Datafile
>
meta
(
m_file_pool
,
ts_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
free
(
m_file_pool
,
ts_ptr
.
p
->
m_free_files
);
Local
_datafile_list
meta
(
m_file_pool
,
ts_ptr
.
p
->
m_meta_files
);
meta
.
remove
(
ptr
);
free
.
add
(
ptr
);
}
...
...
@@ -1144,7 +1148,7 @@ Tsman::scan_tablespace(Signal* signal, Uint32 ptrI)
Ptr
<
Datafile
>
file_ptr
;
{
Local
DLList
<
Datafile
>
meta
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
meta
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
meta
.
first
(
file_ptr
);
}
...
...
@@ -1249,18 +1253,18 @@ Tsman::scan_extent_headers(Signal* signal, Ptr<Datafile> ptr)
}
ptr
.
p
->
m_online
.
m_first_free_extent
=
firstFree
;
Local
DLList
<
Datafile
>
meta
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
meta
(
m_file_pool
,
lg_ptr
.
p
->
m_meta_files
);
Ptr
<
Datafile
>
next
=
ptr
;
meta
.
next
(
next
);
if
(
firstFree
!=
RNIL
)
{
Local
DLList
<
Datafile
>
free
(
m_file_pool
,
lg_ptr
.
p
->
m_free_files
);
Local
_datafile_list
free
(
m_file_pool
,
lg_ptr
.
p
->
m_free_files
);
meta
.
remove
(
ptr
);
free
.
add
(
ptr
);
}
else
{
Local
DLList
<
Datafile
>
full
(
m_file_pool
,
lg_ptr
.
p
->
m_full_files
);
Local
_datafile_list
full
(
m_file_pool
,
lg_ptr
.
p
->
m_full_files
);
meta
.
remove
(
ptr
);
full
.
add
(
ptr
);
}
...
...
@@ -1299,13 +1303,13 @@ Tsman::execDROP_FILE_REQ(Signal* signal)
if
(
find_file_by_id
(
file_ptr
,
fg_ptr
.
p
->
m_full_files
,
req
.
file_id
))
{
jam
();
Local
DLList
<
Datafile
>
full
(
m_file_pool
,
fg_ptr
.
p
->
m_full_files
);
Local
_datafile_list
full
(
m_file_pool
,
fg_ptr
.
p
->
m_full_files
);
full
.
remove
(
file_ptr
);
}
else
if
(
find_file_by_id
(
file_ptr
,
fg_ptr
.
p
->
m_free_files
,
req
.
file_id
))
{
jam
();
Local
DLList
<
Datafile
>
free
(
m_file_pool
,
fg_ptr
.
p
->
m_free_files
);
Local
_datafile_list
free
(
m_file_pool
,
fg_ptr
.
p
->
m_free_files
);
free
.
remove
(
file_ptr
);
}
else
...
...
@@ -1314,7 +1318,7 @@ Tsman::execDROP_FILE_REQ(Signal* signal)
break
;
}
Local
DLList
<
Datafile
>
meta
(
m_file_pool
,
fg_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
meta
(
m_file_pool
,
fg_ptr
.
p
->
m_meta_files
);
meta
.
add
(
file_ptr
);
if
(
file_ptr
.
p
->
m_online
.
m_used_extent_cnt
||
...
...
@@ -1338,16 +1342,16 @@ Tsman::execDROP_FILE_REQ(Signal* signal)
case
DropFileImplReq
:
:
Abort
:
{
ndbrequire
(
find_file_by_id
(
file_ptr
,
fg_ptr
.
p
->
m_meta_files
,
req
.
file_id
));
file_ptr
.
p
->
m_state
=
Datafile
::
FS_ONLINE
;
Local
DLList
<
Datafile
>
meta
(
m_file_pool
,
fg_ptr
.
p
->
m_meta_files
);
Local
_datafile_list
meta
(
m_file_pool
,
fg_ptr
.
p
->
m_meta_files
);
meta
.
remove
(
file_ptr
);
if
(
file_ptr
.
p
->
m_online
.
m_first_free_extent
!=
RNIL
)
{
Local
DLList
<
Datafile
>
free
(
m_file_pool
,
fg_ptr
.
p
->
m_free_files
);
Local
_datafile_list
free
(
m_file_pool
,
fg_ptr
.
p
->
m_free_files
);
free
.
add
(
file_ptr
);
}
else
{
Local
DLList
<
Datafile
>
full
(
m_file_pool
,
fg_ptr
.
p
->
m_full_files
);
Local
_datafile_list
full
(
m_file_pool
,
fg_ptr
.
p
->
m_full_files
);
full
.
add
(
file_ptr
);
}
break
;
...
...
@@ -1407,7 +1411,7 @@ Tsman::execALLOC_EXTENT_REQ(Signal* signal)
ndbrequire
(
m_tablespace_hash
.
find
(
ts_ptr
,
req
.
request
.
tablespace_id
));
Uint32
size
=
ts_ptr
.
p
->
m_extent_size
;
Local
DLList
<
Datafile
>
tmp
(
m_file_pool
,
ts_ptr
.
p
->
m_free_files
);
Local
_datafile_list
tmp
(
m_file_pool
,
ts_ptr
.
p
->
m_free_files
);
if
(
tmp
.
first
(
file_ptr
))
{
...
...
@@ -1456,7 +1460,7 @@ Tsman::execALLOC_EXTENT_REQ(Signal* signal)
if
(
next_free
==
RNIL
)
{
jam
();
Local
DLList
<
Datafile
>
full
(
m_file_pool
,
ts_ptr
.
p
->
m_full_files
);
Local
_datafile_list
full
(
m_file_pool
,
ts_ptr
.
p
->
m_full_files
);
tmp
.
remove
(
file_ptr
);
full
.
add
(
file_ptr
);
}
...
...
@@ -1988,7 +1992,7 @@ Tsman::end_lcp(Signal* signal, Uint32 ptrI, Uint32 list, Uint32 filePtrI)
switch
(
list
){
case
0
:
{
Local
DLList
<
Datafile
>
tmp
(
m_file_pool
,
ptr
.
p
->
m_free_files
);
Local
_datafile_list
tmp
(
m_file_pool
,
ptr
.
p
->
m_free_files
);
if
(
file
.
i
==
RNIL
)
{
if
(
!
tmp
.
first
(
file
))
...
...
@@ -2005,7 +2009,7 @@ Tsman::end_lcp(Signal* signal, Uint32 ptrI, Uint32 list, Uint32 filePtrI)
}
case
1
:
{
Local
DLList
<
Datafile
>
tmp
(
m_file_pool
,
ptr
.
p
->
m_full_files
);
Local
_datafile_list
tmp
(
m_file_pool
,
ptr
.
p
->
m_full_files
);
if
(
file
.
i
==
RNIL
)
{
if
(
!
tmp
.
first
(
file
))
...
...
@@ -2046,8 +2050,8 @@ Tsman::end_lcp(Signal* signal, Uint32 ptrI, Uint32 list, Uint32 filePtrI)
file
.
p
->
m_online
.
m_lcp_free_extent_head
=
RNIL
;
file
.
p
->
m_online
.
m_lcp_free_extent_tail
=
RNIL
;
Local
DLList
<
Datafile
>
free
(
m_file_pool
,
ptr
.
p
->
m_free_files
);
Local
DLList
<
Datafile
>
full
(
m_file_pool
,
ptr
.
p
->
m_full_files
);
Local
_datafile_list
free
(
m_file_pool
,
ptr
.
p
->
m_free_files
);
Local
_datafile_list
full
(
m_file_pool
,
ptr
.
p
->
m_full_files
);
full
.
remove
(
file
);
free
.
add
(
file
);
}
...
...
@@ -2151,7 +2155,7 @@ void Tsman::execGET_TABINFOREQ(Signal* signal)
return
;
}
D
LHashTable
<
Datafile
>
::
Iterator
iter
;
D
atafile_hash
::
Iterator
iter
;
ndbrequire
(
m_file_hash
.
first
(
iter
));
while
(
iter
.
curr
.
p
->
m_file_id
!=
tableId
&&
m_file_hash
.
next
(
iter
))
...
...
storage/ndb/src/kernel/blocks/tsman.hpp
View file @
ddebf42b
...
...
@@ -84,6 +84,7 @@ public:
* - Part of local key
* - Set by pgman
*/
Uint32
m_magic
;
Uint32
m_file_no
;
Uint32
m_file_id
;
// Used when talking to DICT
Uint32
m_fd
;
// NDBFS
...
...
@@ -137,11 +138,17 @@ public:
}
}
;
typedef
RecordPool
<
Datafile
,
RWPool
>
Datafile_pool
;
typedef
DLListImpl
<
Datafile_pool
,
Datafile
>
Datafile_list
;
typedef
LocalDLListImpl
<
Datafile_pool
,
Datafile
>
Local_datafile_list
;
typedef
DLHashTableImpl
<
Datafile_pool
,
Datafile
>
Datafile_hash
;
struct
Tablespace
{
Tablespace
(){}
Tablespace
(
Tsman
*
,
Lgman
*
,
const
struct
CreateFilegroupImplReq
*
);
Uint32
m_magic
;
union
{
Uint32
key
;
Uint32
m_tablespace_id
;
...
...
@@ -157,11 +164,11 @@ public:
};
Uint32
m_extent_size
;
// In pages
D
LList
<
Datafile
>
::
Head
m_free_files
;
// Files w/ free space
D
atafile_list
::
Head
m_free_files
;
// Files w/ free space
Logfile_client
m_logfile_client
;
D
LList
<
Datafile
>
::
Head
m_full_files
;
// Files wo/ free space
D
LList
<
Datafile
>
::
Head
m_meta_files
;
// Files being created/dropped
D
atafile_list
::
Head
m_full_files
;
// Files wo/ free space
D
atafile_list
::
Head
m_meta_files
;
// Files being created/dropped
Uint32
nextHash
;
Uint32
prevHash
;
...
...
@@ -179,14 +186,19 @@ public:
}
};
typedef
RecordPool
<
Tablespace
,
RWPool
>
Tablespace_pool
;
typedef
DLListImpl
<
Tablespace_pool
,
Tablespace
>
Tablespace_list
;
typedef
LocalDLListImpl
<
Tablespace_pool
,
Tablespace
>
Local_tablespace_list
;
typedef
KeyTableImpl
<
Tablespace_pool
,
Tablespace
>
Tablespace_hash
;
private
:
friend
class
Tablespace_client
;
ArrayPool
<
Datafile
>
m_file_pool
;
ArrayPool
<
Tablespace
>
m_tablespace_pool
;
Datafile_pool
m_file_pool
;
Tablespace_pool
m_tablespace_pool
;
D
LHashTable
<
Datafile
>
m_file_hash
;
DLList
<
Tablespace
>
m_tablespace_list
;
KeyTable
<
Tablespace
>
m_tablespace_hash
;
D
atafile_hash
m_file_hash
;
Tablespace_list
m_tablespace_list
;
Tablespace_hash
m_tablespace_hash
;
Page_cache_client
m_page_cache_client
;
Lgman
*
const
m_lgman
;
...
...
@@ -209,7 +221,7 @@ private:
void
scan_datafile
(
Signal
*
,
Uint32
,
Uint32
);
void
scan_extent_headers
(
Signal
*
,
Ptr
<
Datafile
>
);
bool
find_file_by_id
(
Ptr
<
Datafile
>&
,
D
LList
<
Datafile
>
::
Head
&
,
Uint32
id
);
bool
find_file_by_id
(
Ptr
<
Datafile
>&
,
D
atafile_list
::
Head
&
,
Uint32
id
);
void
create_file_abort
(
Signal
*
signal
,
Ptr
<
Datafile
>
);
void
release_extent_pages
(
Signal
*
signal
,
Ptr
<
Datafile
>
ptr
);
...
...
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