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
8b4a0686
Commit
8b4a0686
authored
Dec 04, 2008
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/innodb+: ibuf_insert_low(): Remove a race condition related to
buf_pool_watch_occurred() and add explaining comments.
parent
13ee04a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
13 deletions
+23
-13
ibuf/ibuf0ibuf.c
ibuf/ibuf0ibuf.c
+23
-13
No files found.
ibuf/ibuf0ibuf.c
View file @
8b4a0686
...
@@ -3249,14 +3249,6 @@ ibuf_insert_low(
...
@@ -3249,14 +3249,6 @@ ibuf_insert_low(
btr_pcur_open
(
ibuf
->
index
,
ibuf_entry
,
PAGE_CUR_LE
,
mode
,
&
pcur
,
&
mtr
);
btr_pcur_open
(
ibuf
->
index
,
ibuf_entry
,
PAGE_CUR_LE
,
mode
,
&
pcur
,
&
mtr
);
/* Don't buffer deletes if the page has been read in to the buffer
pool. */
if
(
op
==
IBUF_OP_DELETE
&&
buf_pool_watch_occurred
(
space
,
page_no
))
{
err
=
DB_STRONG_FAIL
;
goto
function_exit
;
}
/* Find out the volume of already buffered inserts for the same index
/* Find out the volume of already buffered inserts for the same index
page */
page */
min_n_recs
=
0
;
min_n_recs
=
0
;
...
@@ -3265,12 +3257,30 @@ ibuf_insert_low(
...
@@ -3265,12 +3257,30 @@ ibuf_insert_low(
?
&
min_n_recs
?
&
min_n_recs
:
NULL
,
&
mtr
);
:
NULL
,
&
mtr
);
if
(
op
==
IBUF_OP_DELETE
&&
min_n_recs
<
2
)
{
if
(
op
==
IBUF_OP_DELETE
)
{
/* The page could become empty after the record is
if
(
min_n_recs
<
2
deleted. Refuse to buffer the operation. */
||
buf_pool_watch_occurred
(
space
,
page_no
))
{
err
=
DB_STRONG_FAIL
;
/* The page could become empty after the
record is deleted, or the page has been read
in to the buffer pool. Refuse to buffer the
operation. */
err
=
DB_STRONG_FAIL
;
goto
function_exit
;
goto
function_exit
;
}
/* The buffer pool watch is needed for IBUF_OP_DELETE
because of latching order considerations. We can
check buf_pool_watch_occurred() only after latching
the insert buffer B-tree pages that contain buffered
changes for the page. We never buffer IBUF_OP_DELETE,
unless some IBUF_OP_INSERT or IBUF_OP_DELETE_MARK have
been previously buffered for the page. Because there
are buffered operations for the page, the insert
buffer B-tree page latches held by mtr will guarantee
that no changes for the user page will be merged
before mtr_commit(&mtr). We must not mtr_commit(&mtr)
until after the IBUF_OP_DELETE has been buffered. */
}
}
#ifdef UNIV_IBUF_COUNT_DEBUG
#ifdef UNIV_IBUF_COUNT_DEBUG
...
...
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