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
921d87d4
Commit
921d87d4
authored
Feb 05, 2014
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue on xtradb shutdown merge error. Multi-threaded flush threads
where not shut down properly.
parent
862b0344
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
5 deletions
+47
-5
storage/innobase/buf/buf0flu.cc
storage/innobase/buf/buf0flu.cc
+4
-0
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+4
-0
storage/xtradb/buf/buf0flu.cc
storage/xtradb/buf/buf0flu.cc
+22
-2
storage/xtradb/srv/srv0start.cc
storage/xtradb/srv/srv0start.cc
+17
-3
No files found.
storage/innobase/buf/buf0flu.cc
View file @
921d87d4
...
@@ -1973,6 +1973,10 @@ void pgcomp_init(void)
...
@@ -1973,6 +1973,10 @@ void pgcomp_init(void)
{
{
os_fast_mutex_init
(
PFS_NOT_INSTRUMENTED
,
&
pgcomp_mtx
);
os_fast_mutex_init
(
PFS_NOT_INSTRUMENTED
,
&
pgcomp_mtx
);
}
}
void
pgcomp_deinit
(
void
)
{
os_fast_mutex_free
(
&
pgcomp_mtx
);
}
/*******************************************************************//**
/*******************************************************************//**
Multi-threaded version of buf_flush_list
Multi-threaded version of buf_flush_list
...
...
storage/innobase/srv/srv0start.cc
View file @
921d87d4
...
@@ -1444,6 +1444,7 @@ extern void buf_flush_end(buf_pool_t* buf_pool, enum buf_flush flush_type);
...
@@ -1444,6 +1444,7 @@ extern void buf_flush_end(buf_pool_t* buf_pool, enum buf_flush flush_type);
extern
void
buf_flush_common
(
enum
buf_flush
flush_type
,
ulint
page_count
);
extern
void
buf_flush_common
(
enum
buf_flush
flush_type
,
ulint
page_count
);
extern
ulint
buf_flush_batch
(
buf_pool_t
*
buf_pool
,
enum
buf_flush
flush_type
,
ulint
min_n
,
lsn_t
lsn_limit
);
extern
ulint
buf_flush_batch
(
buf_pool_t
*
buf_pool
,
enum
buf_flush
flush_type
,
ulint
min_n
,
lsn_t
lsn_limit
);
extern
void
pgcomp_init
(
void
);
extern
void
pgcomp_init
(
void
);
extern
void
pgcomp_deinit
(
void
);
typedef
enum
wrk_status
{
typedef
enum
wrk_status
{
WRK_ITEM_SET
=
0
,
// wrk-item is set
WRK_ITEM_SET
=
0
,
// wrk-item is set
...
@@ -3277,6 +3278,9 @@ innobase_shutdown_for_mysql(void)
...
@@ -3277,6 +3278,9 @@ innobase_shutdown_for_mysql(void)
fprintf
(
stderr
,
"%s:%d os_thread_count:%lu
\n
"
,
__FUNCTION__
,
__LINE__
,
os_thread_count
);
fprintf
(
stderr
,
"%s:%d os_thread_count:%lu
\n
"
,
__FUNCTION__
,
__LINE__
,
os_thread_count
);
#endif
#endif
/* h. Remove the mutex */
pgcomp_deinit
();
os_mutex_enter
(
os_sync_mutex
);
os_mutex_enter
(
os_sync_mutex
);
if
(
os_thread_count
==
0
)
{
if
(
os_thread_count
==
0
)
{
...
...
storage/xtradb/buf/buf0flu.cc
View file @
921d87d4
...
@@ -1931,6 +1931,21 @@ buf_flush_wait_batch_end(
...
@@ -1931,6 +1931,21 @@ buf_flush_wait_batch_end(
}
}
/* JAN: TODO: */
/* JAN: TODO: */
void
buf_pool_enter_LRU_mutex
(
buf_pool_t
*
buf_pool
)
{
ut_ad
(
!
mutex_own
(
&
buf_pool
->
LRU_list_mutex
));
mutex_enter
(
&
buf_pool
->
LRU_list_mutex
);
}
void
buf_pool_exit_LRU_mutex
(
buf_pool_t
*
buf_pool
)
{
ut_ad
(
mutex_own
(
&
buf_pool
->
LRU_list_mutex
));
mutex_exit
(
&
buf_pool
->
LRU_list_mutex
);
}
/*******************************************************************//**
/*******************************************************************//**
This utility flushes dirty blocks from the end of the LRU list and also
This utility flushes dirty blocks from the end of the LRU list and also
puts replaceable clean pages from the end of the LRU list to the free
puts replaceable clean pages from the end of the LRU list to the free
...
@@ -2053,6 +2068,11 @@ void pgcomp_init(void)
...
@@ -2053,6 +2068,11 @@ void pgcomp_init(void)
os_fast_mutex_init
(
PFS_NOT_INSTRUMENTED
,
&
pgcomp_mtx
);
os_fast_mutex_init
(
PFS_NOT_INSTRUMENTED
,
&
pgcomp_mtx
);
}
}
void
pgcomp_deinit
(
void
)
{
os_fast_mutex_free
(
&
pgcomp_mtx
);
}
/*******************************************************************//**
/*******************************************************************//**
Multi-threaded version of buf_flush_list
Multi-threaded version of buf_flush_list
*/
*/
...
@@ -2096,11 +2116,11 @@ pgcomp_buf_flush_list(
...
@@ -2096,11 +2116,11 @@ pgcomp_buf_flush_list(
#ifdef UNIV_DEBUG
#ifdef UNIV_DEBUG
gettimeofday
(
&
p_start_time
,
0x0
);
gettimeofday
(
&
p_start_time
,
0x0
);
#endif
#endif
os_fast_mutex_lock
(
&
pgcomp_mtx
);
//
os_fast_mutex_lock(&pgcomp_mtx);
pgcomp_flush_work_items
(
srv_buf_pool_instances
,
pgcomp_flush_work_items
(
srv_buf_pool_instances
,
cnt_flush
,
BUF_FLUSH_LIST
,
cnt_flush
,
BUF_FLUSH_LIST
,
min_n
,
lsn_limit
);
min_n
,
lsn_limit
);
os_fast_mutex_unlock
(
&
pgcomp_mtx
);
//
os_fast_mutex_unlock(&pgcomp_mtx);
for
(
i
=
0
;
i
<
srv_buf_pool_instances
;
i
++
)
{
for
(
i
=
0
;
i
<
srv_buf_pool_instances
;
i
++
)
{
if
(
n_processed
)
{
if
(
n_processed
)
{
...
...
storage/xtradb/srv/srv0start.cc
View file @
921d87d4
...
@@ -1520,6 +1520,9 @@ extern void buf_flush_common(buf_flush_t flush_type, ulint page_count);
...
@@ -1520,6 +1520,9 @@ extern void buf_flush_common(buf_flush_t flush_type, ulint page_count);
extern
ulint
buf_flush_batch
(
buf_pool_t
*
buf_pool
,
buf_flush_t
flush_type
,
ulint
min_n
,
lsn_t
lsn_limit
,
bool
limited_lru_scan
,
extern
ulint
buf_flush_batch
(
buf_pool_t
*
buf_pool
,
buf_flush_t
flush_type
,
ulint
min_n
,
lsn_t
lsn_limit
,
bool
limited_lru_scan
,
flush_counters_t
*
n
);
flush_counters_t
*
n
);
extern
void
pgcomp_init
(
void
);
extern
void
pgcomp_init
(
void
);
extern
void
pgcomp_deinit
(
void
);
extern
void
buf_pool_enter_LRU_mutex
(
buf_pool_t
*
);
extern
void
buf_pool_exit_LRU_mutex
(
buf_pool_t
*
);
typedef
enum
wrk_status
{
typedef
enum
wrk_status
{
WRK_ITEM_SET
=
0
,
// wrk-item is set
WRK_ITEM_SET
=
0
,
// wrk-item is set
...
@@ -1555,7 +1558,6 @@ typedef struct wr_tsk {
...
@@ -1555,7 +1558,6 @@ typedef struct wr_tsk {
lsn_t
lsn_limit
;
//lsn limit for the buffer-pool flush operation
lsn_t
lsn_limit
;
//lsn limit for the buffer-pool flush operation
}
wr_tsk_t
;
}
wr_tsk_t
;
typedef
struct
rd_tsk
{
typedef
struct
rd_tsk
{
void
*
page_pool
;
//list of pages to decompress;
void
*
page_pool
;
//list of pages to decompress;
}
rd_tsk_t
;
}
rd_tsk_t
;
...
@@ -1665,9 +1667,9 @@ int flush_pool_instance(wrk_t *wi)
...
@@ -1665,9 +1667,9 @@ int flush_pool_instance(wrk_t *wi)
/* srv_LRU_scan_depth can be arbitrarily large value.
/* srv_LRU_scan_depth can be arbitrarily large value.
* We cap it with current LRU size.
* We cap it with current LRU size.
*/
*/
buf_pool_
mutex_enter
(
wi
->
wr
.
buf_pool
);
buf_pool_
enter_LRU_mutex
(
wi
->
wr
.
buf_pool
);
wi
->
wr
.
min
=
UT_LIST_GET_LEN
(
wi
->
wr
.
buf_pool
->
LRU
);
wi
->
wr
.
min
=
UT_LIST_GET_LEN
(
wi
->
wr
.
buf_pool
->
LRU
);
buf_pool_
mutex_exit
(
wi
->
wr
.
buf_pool
);
buf_pool_
exit_LRU_mutex
(
wi
->
wr
.
buf_pool
);
wi
->
wr
.
min
=
ut_min
(
srv_LRU_scan_depth
,
wi
->
wr
.
min
);
wi
->
wr
.
min
=
ut_min
(
srv_LRU_scan_depth
,
wi
->
wr
.
min
);
}
}
...
@@ -3407,8 +3409,20 @@ innobase_shutdown_for_mysql(void)
...
@@ -3407,8 +3409,20 @@ innobase_shutdown_for_mysql(void)
logs_empty_and_mark_files_at_shutdown() and should have
logs_empty_and_mark_files_at_shutdown() and should have
already quit or is quitting right now. */
already quit or is quitting right now. */
/* g. Exit the multi threaded flush threads */
page_comp_io_thread_exit
();
#ifdef UNIV_DEBUG
fprintf
(
stderr
,
"%s:%d os_thread_count:%lu
\n
"
,
__FUNCTION__
,
__LINE__
,
os_thread_count
);
#endif
/* h. Remove the mutex */
pgcomp_deinit
();
os_mutex_enter
(
os_sync_mutex
);
os_mutex_enter
(
os_sync_mutex
);
if
(
os_thread_count
==
0
)
{
if
(
os_thread_count
==
0
)
{
/* All the threads have exited or are just exiting;
/* All the threads have exited or are just exiting;
NOTE that the threads may not have completed their
NOTE that the threads may not have completed their
...
...
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