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
3c1bdb35
Commit
3c1bdb35
authored
Mar 15, 2012
by
Inaam Rana
Browse files
Options
Browse Files
Download
Plain Diff
merge from 5.1
parents
1ca73ab4
00231470
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
49 deletions
+54
-49
storage/innobase/fil/fil0fil.c
storage/innobase/fil/fil0fil.c
+30
-29
storage/innobase/ibuf/ibuf0ibuf.c
storage/innobase/ibuf/ibuf0ibuf.c
+3
-3
storage/innobase/include/fil0fil.h
storage/innobase/include/fil0fil.h
+7
-8
storage/innobase/lock/lock0lock.c
storage/innobase/lock/lock0lock.c
+14
-9
No files found.
storage/innobase/fil/fil0fil.c
View file @
3c1bdb35
...
@@ -185,7 +185,7 @@ struct fil_space_struct {
...
@@ -185,7 +185,7 @@ struct fil_space_struct {
.ibd file of tablespace and want to
.ibd file of tablespace and want to
stop temporarily posting of new i/o
stop temporarily posting of new i/o
requests on the file */
requests on the file */
ibool
stop_
ibuf_merge
s
;
ibool
stop_
new_op
s
;
/*!< we set this TRUE when we start
/*!< we set this TRUE when we start
deleting a single-table tablespace */
deleting a single-table tablespace */
ibool
is_being_deleted
;
ibool
is_being_deleted
;
...
@@ -210,12 +210,13 @@ struct fil_space_struct {
...
@@ -210,12 +210,13 @@ struct fil_space_struct {
ulint
n_pending_flushes
;
/*!< this is positive when flushing
ulint
n_pending_flushes
;
/*!< this is positive when flushing
the tablespace to disk; dropping of the
the tablespace to disk; dropping of the
tablespace is forbidden if this is positive */
tablespace is forbidden if this is positive */
ulint
n_pending_ibuf_merges
;
/*!< this is positive
ulint
n_pending_ops
;
/*!< this is positive when we
when merging insert buffer entries to
have pending operations against this
a page so that we may need to access
tablespace. The pending operations can
the ibuf bitmap page in the
be ibuf merges or lock validation code
tablespade: dropping of the tablespace
trying to read a block.
is forbidden if this is positive */
Dropping of the tablespace is forbidden
if this is positive */
hash_node_t
hash
;
/*!< hash chain node */
hash_node_t
hash
;
/*!< hash chain node */
hash_node_t
name_hash
;
/*!< hash chain the name_hash table */
hash_node_t
name_hash
;
/*!< hash chain the name_hash table */
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
...
@@ -1282,7 +1283,7 @@ try_again:
...
@@ -1282,7 +1283,7 @@ try_again:
}
}
space
->
stop_ios
=
FALSE
;
space
->
stop_ios
=
FALSE
;
space
->
stop_
ibuf_merge
s
=
FALSE
;
space
->
stop_
new_op
s
=
FALSE
;
space
->
is_being_deleted
=
FALSE
;
space
->
is_being_deleted
=
FALSE
;
space
->
purpose
=
purpose
;
space
->
purpose
=
purpose
;
space
->
size
=
0
;
space
->
size
=
0
;
...
@@ -1291,7 +1292,7 @@ try_again:
...
@@ -1291,7 +1292,7 @@ try_again:
space
->
n_reserved_extents
=
0
;
space
->
n_reserved_extents
=
0
;
space
->
n_pending_flushes
=
0
;
space
->
n_pending_flushes
=
0
;
space
->
n_pending_
ibuf_merge
s
=
0
;
space
->
n_pending_
op
s
=
0
;
UT_LIST_INIT
(
space
->
chain
);
UT_LIST_INIT
(
space
->
chain
);
space
->
magic_n
=
FIL_SPACE_MAGIC_N
;
space
->
magic_n
=
FIL_SPACE_MAGIC_N
;
...
@@ -1891,13 +1892,12 @@ fil_read_first_page(
...
@@ -1891,13 +1892,12 @@ fil_read_first_page(
#ifndef UNIV_HOTBACKUP
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
/*******************************************************************//**
Increments the count of pending insert buffer page merges, if space is not
Increments the count of pending operation, if space is not being deleted.
being deleted.
@return TRUE if being deleted, and operation should be skipped */
@return TRUE if being deleted, and ibuf merges should be skipped */
UNIV_INTERN
UNIV_INTERN
ibool
ibool
fil_inc_pending_
ibuf_merge
s
(
fil_inc_pending_
op
s
(
/*================
========
*/
/*================*/
ulint
id
)
/*!< in: space id */
ulint
id
)
/*!< in: space id */
{
{
fil_space_t
*
space
;
fil_space_t
*
space
;
...
@@ -1913,13 +1913,13 @@ fil_inc_pending_ibuf_merges(
...
@@ -1913,13 +1913,13 @@ fil_inc_pending_ibuf_merges(
(
ulong
)
id
);
(
ulong
)
id
);
}
}
if
(
space
==
NULL
||
space
->
stop_
ibuf_merge
s
)
{
if
(
space
==
NULL
||
space
->
stop_
new_op
s
)
{
mutex_exit
(
&
fil_system
->
mutex
);
mutex_exit
(
&
fil_system
->
mutex
);
return
(
TRUE
);
return
(
TRUE
);
}
}
space
->
n_pending_
ibuf_merge
s
++
;
space
->
n_pending_
op
s
++
;
mutex_exit
(
&
fil_system
->
mutex
);
mutex_exit
(
&
fil_system
->
mutex
);
...
@@ -1927,11 +1927,11 @@ fil_inc_pending_ibuf_merges(
...
@@ -1927,11 +1927,11 @@ fil_inc_pending_ibuf_merges(
}
}
/*******************************************************************//**
/*******************************************************************//**
Decrements the count of pending
insert buffer page merge
s. */
Decrements the count of pending
operation
s. */
UNIV_INTERN
UNIV_INTERN
void
void
fil_decr_pending_
ibuf_merge
s
(
fil_decr_pending_
op
s
(
/*=================
========
*/
/*=================*/
ulint
id
)
/*!< in: space id */
ulint
id
)
/*!< in: space id */
{
{
fil_space_t
*
space
;
fil_space_t
*
space
;
...
@@ -1942,13 +1942,13 @@ fil_decr_pending_ibuf_merges(
...
@@ -1942,13 +1942,13 @@ fil_decr_pending_ibuf_merges(
if
(
space
==
NULL
)
{
if
(
space
==
NULL
)
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"InnoDB: Error: decrementing
ibuf merge of a
"
"InnoDB: Error: decrementing
pending operation
"
" dropped tablespace %lu
\n
"
,
"
of a
dropped tablespace %lu
\n
"
,
(
ulong
)
id
);
(
ulong
)
id
);
}
}
if
(
space
!=
NULL
)
{
if
(
space
!=
NULL
)
{
space
->
n_pending_
ibuf_merge
s
--
;
space
->
n_pending_
op
s
--
;
}
}
mutex_exit
(
&
fil_system
->
mutex
);
mutex_exit
(
&
fil_system
->
mutex
);
...
@@ -2238,15 +2238,15 @@ fil_delete_tablespace(
...
@@ -2238,15 +2238,15 @@ fil_delete_tablespace(
char
*
path
;
char
*
path
;
ut_a
(
id
!=
0
);
ut_a
(
id
!=
0
);
stop_
ibuf_merge
s:
stop_
new_op
s:
mutex_enter
(
&
fil_system
->
mutex
);
mutex_enter
(
&
fil_system
->
mutex
);
space
=
fil_space_get_by_id
(
id
);
space
=
fil_space_get_by_id
(
id
);
if
(
space
!=
NULL
)
{
if
(
space
!=
NULL
)
{
space
->
stop_
ibuf_merge
s
=
TRUE
;
space
->
stop_
new_op
s
=
TRUE
;
if
(
space
->
n_pending_
ibuf_merge
s
==
0
)
{
if
(
space
->
n_pending_
op
s
==
0
)
{
mutex_exit
(
&
fil_system
->
mutex
);
mutex_exit
(
&
fil_system
->
mutex
);
count
=
0
;
count
=
0
;
...
@@ -2260,9 +2260,10 @@ stop_ibuf_merges:
...
@@ -2260,9 +2260,10 @@ stop_ibuf_merges:
ut_print_filename
(
stderr
,
space
->
name
);
ut_print_filename
(
stderr
,
space
->
name
);
fprintf
(
stderr
,
",
\n
"
fprintf
(
stderr
,
",
\n
"
"InnoDB: but there are %lu pending"
"InnoDB: but there are %lu pending"
" ibuf merges on it.
\n
"
" operations (most likely ibuf merges)"
" on it.
\n
"
"InnoDB: Loop %lu.
\n
"
,
"InnoDB: Loop %lu.
\n
"
,
(
ulong
)
space
->
n_pending_
ibuf_merge
s
,
(
ulong
)
space
->
n_pending_
op
s
,
(
ulong
)
count
);
(
ulong
)
count
);
}
}
...
@@ -2271,7 +2272,7 @@ stop_ibuf_merges:
...
@@ -2271,7 +2272,7 @@ stop_ibuf_merges:
os_thread_sleep
(
20000
);
os_thread_sleep
(
20000
);
count
++
;
count
++
;
goto
stop_
ibuf_merge
s
;
goto
stop_
new_op
s
;
}
}
}
}
...
@@ -2297,7 +2298,7 @@ try_again:
...
@@ -2297,7 +2298,7 @@ try_again:
}
}
ut_a
(
space
);
ut_a
(
space
);
ut_a
(
space
->
n_pending_
ibuf_merge
s
==
0
);
ut_a
(
space
->
n_pending_
op
s
==
0
);
space
->
is_being_deleted
=
TRUE
;
space
->
is_being_deleted
=
TRUE
;
...
...
storage/innobase/ibuf/ibuf0ibuf.c
View file @
3c1bdb35
...
@@ -4428,7 +4428,7 @@ ibuf_merge_or_delete_for_page(
...
@@ -4428,7 +4428,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace
function. When the counter is > 0, that prevents tablespace
from being dropped. */
from being dropped. */
tablespace_being_deleted
=
fil_inc_pending_
ibuf_merge
s
(
space
);
tablespace_being_deleted
=
fil_inc_pending_
op
s
(
space
);
if
(
UNIV_UNLIKELY
(
tablespace_being_deleted
))
{
if
(
UNIV_UNLIKELY
(
tablespace_being_deleted
))
{
/* Do not try to read the bitmap page from space;
/* Do not try to read the bitmap page from space;
...
@@ -4454,7 +4454,7 @@ ibuf_merge_or_delete_for_page(
...
@@ -4454,7 +4454,7 @@ ibuf_merge_or_delete_for_page(
/* No inserts buffered for this page */
/* No inserts buffered for this page */
if
(
!
tablespace_being_deleted
)
{
if
(
!
tablespace_being_deleted
)
{
fil_decr_pending_
ibuf_merge
s
(
space
);
fil_decr_pending_
op
s
(
space
);
}
}
return
;
return
;
...
@@ -4753,7 +4753,7 @@ reset_bit:
...
@@ -4753,7 +4753,7 @@ reset_bit:
if
(
update_ibuf_bitmap
&&
!
tablespace_being_deleted
)
{
if
(
update_ibuf_bitmap
&&
!
tablespace_being_deleted
)
{
fil_decr_pending_
ibuf_merge
s
(
space
);
fil_decr_pending_
op
s
(
space
);
}
}
#ifdef UNIV_IBUF_COUNT_DEBUG
#ifdef UNIV_IBUF_COUNT_DEBUG
...
...
storage/innobase/include/fil0fil.h
View file @
3c1bdb35
...
@@ -346,20 +346,19 @@ fil_read_first_page(
...
@@ -346,20 +346,19 @@ fil_read_first_page(
ib_uint64_t
*
max_flushed_lsn
);
/*!< out: max of flushed
ib_uint64_t
*
max_flushed_lsn
);
/*!< out: max of flushed
lsn values in data files */
lsn values in data files */
/*******************************************************************//**
/*******************************************************************//**
Increments the count of pending insert buffer page merges, if space is not
Increments the count of pending operation, if space is not being deleted.
being deleted.
@return TRUE if being deleted, and operation should be skipped */
@return TRUE if being deleted, and ibuf merges should be skipped */
UNIV_INTERN
UNIV_INTERN
ibool
ibool
fil_inc_pending_
ibuf_merge
s
(
fil_inc_pending_
op
s
(
/*================
========
*/
/*================*/
ulint
id
);
/*!< in: space id */
ulint
id
);
/*!< in: space id */
/*******************************************************************//**
/*******************************************************************//**
Decrements the count of pending
insert buffer page merge
s. */
Decrements the count of pending
operation
s. */
UNIV_INTERN
UNIV_INTERN
void
void
fil_decr_pending_
ibuf_merge
s
(
fil_decr_pending_
op
s
(
/*=================
========
*/
/*=================*/
ulint
id
);
/*!< in: space id */
ulint
id
);
/*!< in: space id */
#endif
/* !UNIV_HOTBACKUP */
#endif
/* !UNIV_HOTBACKUP */
/*******************************************************************//**
/*******************************************************************//**
...
...
storage/innobase/lock/lock0lock.c
View file @
3c1bdb35
...
@@ -5018,18 +5018,23 @@ lock_rec_block_validate(
...
@@ -5018,18 +5018,23 @@ lock_rec_block_validate(
mtr_t
mtr
;
mtr_t
mtr
;
buf_block_t
*
block
;
buf_block_t
*
block
;
mtr_start
(
&
mtr
);
/* Make sure that the tablespace is not deleted while we are
trying to access the page. */
if
(
!
fil_inc_pending_ops
(
space
))
{
mtr_start
(
&
mtr
);
block
=
buf_page_get_gen
(
space
,
fil_space_get_zip_size
(
space
),
page_no
,
RW_X_LATCH
,
NULL
,
BUF_GET_POSSIBLY_FREED
,
__FILE__
,
__LINE__
,
&
mtr
);
block
=
buf_page_get_gen
(
buf_block_dbg_add_level
(
block
,
SYNC_NO_ORDER_CHECK
);
space
,
fil_space_get_zip_size
(
space
),
page_no
,
RW_X_LATCH
,
NULL
,
BUF_GET_POSSIBLY_FREED
,
__FILE__
,
__LINE__
,
&
mtr
);
buf_block_dbg_add_level
(
block
,
SYNC_NO_ORDER_CHECK
);
ut_ad
(
lock_rec_validate_page
(
block
));
mtr_commit
(
&
mtr
);
ut_ad
(
lock_rec_validate_page
(
block
)
);
fil_decr_pending_ops
(
space
);
mtr_commit
(
&
mtr
);
}
}
}
/*********************************************************************//**
/*********************************************************************//**
...
...
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