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
b363d975
Commit
b363d975
authored
Nov 10, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Use the alias BTR_PURGE_TREE for pessimistic delete
parent
ae6ebafd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
26 deletions
+15
-26
storage/innobase/ibuf/ibuf0ibuf.cc
storage/innobase/ibuf/ibuf0ibuf.cc
+1
-2
storage/innobase/row/row0import.cc
storage/innobase/row/row0import.cc
+1
-2
storage/innobase/row/row0log.cc
storage/innobase/row/row0log.cc
+2
-4
storage/innobase/row/row0purge.cc
storage/innobase/row/row0purge.cc
+4
-7
storage/innobase/row/row0uins.cc
storage/innobase/row/row0uins.cc
+4
-7
storage/innobase/row/row0umod.cc
storage/innobase/row/row0umod.cc
+3
-4
No files found.
storage/innobase/ibuf/ibuf0ibuf.cc
View file @
b363d975
...
@@ -4011,8 +4011,7 @@ bool ibuf_delete_rec(const page_id_t page_id, btr_pcur_t* pcur,
...
@@ -4011,8 +4011,7 @@ bool ibuf_delete_rec(const page_id_t page_id, btr_pcur_t* pcur,
ibuf_mtr_start
(
mtr
);
ibuf_mtr_start
(
mtr
);
mysql_mutex_lock
(
&
ibuf_mutex
);
mysql_mutex_lock
(
&
ibuf_mutex
);
if
(
!
ibuf_restore_pos
(
page_id
,
search_tuple
,
if
(
!
ibuf_restore_pos
(
page_id
,
search_tuple
,
BTR_PURGE_TREE
,
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
pcur
,
mtr
))
{
pcur
,
mtr
))
{
mysql_mutex_unlock
(
&
ibuf_mutex
);
mysql_mutex_unlock
(
&
ibuf_mutex
);
...
...
storage/innobase/row/row0import.cc
View file @
b363d975
...
@@ -1598,8 +1598,7 @@ tree structure may be changed during a pessimistic delete. */
...
@@ -1598,8 +1598,7 @@ tree structure may be changed during a pessimistic delete. */
inline
dberr_t
IndexPurge
::
purge_pessimistic_delete
()
noexcept
inline
dberr_t
IndexPurge
::
purge_pessimistic_delete
()
noexcept
{
{
dberr_t
err
;
dberr_t
err
;
if
(
m_pcur
.
restore_position
(
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
if
(
m_pcur
.
restore_position
(
BTR_PURGE_TREE
,
&
m_mtr
)
!=
btr_pcur_t
::
CORRUPTED
)
&
m_mtr
)
!=
btr_pcur_t
::
CORRUPTED
)
{
{
ut_ad
(
rec_get_deleted_flag
(
btr_pcur_get_rec
(
&
m_pcur
),
ut_ad
(
rec_get_deleted_flag
(
btr_pcur_get_rec
(
&
m_pcur
),
m_index
->
table
->
not_redundant
()));
m_index
->
table
->
not_redundant
()));
...
...
storage/innobase/row/row0log.cc
View file @
b363d975
...
@@ -1696,8 +1696,7 @@ row_log_table_apply_delete_low(
...
@@ -1696,8 +1696,7 @@ row_log_table_apply_delete_low(
mtr
->
start
();
mtr
->
start
();
index
->
set_modified
(
*
mtr
);
index
->
set_modified
(
*
mtr
);
error
=
btr_pcur_open
(
index
,
entry
,
PAGE_CUR_LE
,
error
=
btr_pcur_open
(
index
,
entry
,
PAGE_CUR_LE
,
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
BTR_PURGE_TREE
,
pcur
,
mtr
);
pcur
,
mtr
);
if
(
error
)
{
if
(
error
)
{
goto
err_exit
;
goto
err_exit
;
}
}
...
@@ -1780,8 +1779,7 @@ row_log_table_apply_delete(
...
@@ -1780,8 +1779,7 @@ row_log_table_apply_delete(
mtr_start
(
&
mtr
);
mtr_start
(
&
mtr
);
index
->
set_modified
(
mtr
);
index
->
set_modified
(
mtr
);
dberr_t
err
=
btr_pcur_open
(
index
,
old_pk
,
PAGE_CUR_LE
,
dberr_t
err
=
btr_pcur_open
(
index
,
old_pk
,
PAGE_CUR_LE
,
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
BTR_PURGE_TREE
,
&
pcur
,
&
mtr
);
&
pcur
,
&
mtr
);
if
(
err
!=
DB_SUCCESS
)
{
if
(
err
!=
DB_SUCCESS
)
{
goto
all_done
;
goto
all_done
;
}
}
...
...
storage/innobase/row/row0purge.cc
View file @
b363d975
...
@@ -216,7 +216,7 @@ row_purge_remove_clust_if_poss_low(
...
@@ -216,7 +216,7 @@ row_purge_remove_clust_if_poss_low(
btr_pcur_get_btr_cur
(
&
node
->
pcur
),
0
,
&
mtr
);
btr_pcur_get_btr_cur
(
&
node
->
pcur
),
0
,
&
mtr
);
}
else
{
}
else
{
dberr_t
err
;
dberr_t
err
;
ut_ad
(
mode
==
(
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
)
);
ut_ad
(
mode
==
BTR_PURGE_TREE
);
btr_cur_pessimistic_delete
(
btr_cur_pessimistic_delete
(
&
err
,
FALSE
,
btr_pcur_get_btr_cur
(
&
node
->
pcur
),
0
,
&
err
,
FALSE
,
btr_pcur_get_btr_cur
(
&
node
->
pcur
),
0
,
false
,
&
mtr
);
false
,
&
mtr
);
...
@@ -257,8 +257,7 @@ row_purge_remove_clust_if_poss(
...
@@ -257,8 +257,7 @@ row_purge_remove_clust_if_poss(
for
(
ulint
n_tries
=
0
;
for
(
ulint
n_tries
=
0
;
n_tries
<
BTR_CUR_RETRY_DELETE_N_TIMES
;
n_tries
<
BTR_CUR_RETRY_DELETE_N_TIMES
;
n_tries
++
)
{
n_tries
++
)
{
if
(
row_purge_remove_clust_if_poss_low
(
if
(
row_purge_remove_clust_if_poss_low
(
node
,
BTR_PURGE_TREE
))
{
node
,
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
))
{
return
(
true
);
return
(
true
);
}
}
...
@@ -349,10 +348,8 @@ row_purge_remove_sec_if_poss_tree(
...
@@ -349,10 +348,8 @@ row_purge_remove_sec_if_poss_tree(
mtr
.
start
();
mtr
.
start
();
index
->
set_modified
(
mtr
);
index
->
set_modified
(
mtr
);
search_result
=
row_search_index_entry
(
search_result
=
row_search_index_entry
(
index
,
entry
,
BTR_PURGE_TREE
,
index
,
entry
,
&
pcur
,
&
mtr
);
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
&
pcur
,
&
mtr
);
switch
(
search_result
)
{
switch
(
search_result
)
{
case
ROW_NOT_FOUND
:
case
ROW_NOT_FOUND
:
...
...
storage/innobase/row/row0uins.cc
View file @
b363d975
...
@@ -207,9 +207,8 @@ row_undo_ins_remove_clust_rec(
...
@@ -207,9 +207,8 @@ row_undo_ins_remove_clust_rec(
}
else
{
}
else
{
index
->
set_modified
(
mtr
);
index
->
set_modified
(
mtr
);
}
}
ut_a
(
ut_a
(
node
->
pcur
.
restore_position
(
BTR_PURGE_TREE
,
&
mtr
)
node
->
pcur
.
restore_position
(
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
==
btr_pcur_t
::
SAME_ALL
);
&
mtr
)
==
btr_pcur_t
::
SAME_ALL
);
btr_cur_pessimistic_delete
(
&
err
,
FALSE
,
&
node
->
pcur
.
btr_cur
,
0
,
true
,
btr_cur_pessimistic_delete
(
&
err
,
FALSE
,
&
node
->
pcur
.
btr_cur
,
0
,
true
,
&
mtr
);
&
mtr
);
...
@@ -272,7 +271,7 @@ row_undo_ins_remove_sec_low(
...
@@ -272,7 +271,7 @@ row_undo_ins_remove_sec_low(
mode
=
BTR_MODIFY_LEAF
|
BTR_ALREADY_S_LATCHED
;
mode
=
BTR_MODIFY_LEAF
|
BTR_ALREADY_S_LATCHED
;
mtr_s_lock_index
(
index
,
&
mtr
);
mtr_s_lock_index
(
index
,
&
mtr
);
}
else
{
}
else
{
ut_ad
(
mode
==
(
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
)
);
ut_ad
(
mode
==
BTR_PURGE_TREE
);
mtr_sx_lock_index
(
index
,
&
mtr
);
mtr_sx_lock_index
(
index
,
&
mtr
);
}
}
...
@@ -349,9 +348,7 @@ row_undo_ins_remove_sec(
...
@@ -349,9 +348,7 @@ row_undo_ins_remove_sec(
/* Try then pessimistic descent to the B-tree */
/* Try then pessimistic descent to the B-tree */
retry:
retry:
err
=
row_undo_ins_remove_sec_low
(
err
=
row_undo_ins_remove_sec_low
(
BTR_PURGE_TREE
,
index
,
entry
,
thr
);
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
index
,
entry
,
thr
);
/* The delete operation may fail if we have little
/* The delete operation may fail if we have little
file space left: TODO: easiest to crash the database
file space left: TODO: easiest to crash the database
...
...
storage/innobase/row/row0umod.cc
View file @
b363d975
...
@@ -356,8 +356,7 @@ row_undo_mod_clust(
...
@@ -356,8 +356,7 @@ row_undo_mod_clust(
}
}
mtr
.
start
();
mtr
.
start
();
if
(
pcur
->
restore_position
(
if
(
pcur
->
restore_position
(
BTR_PURGE_TREE
,
&
mtr
)
!=
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
,
&
mtr
)
!=
btr_pcur_t
::
SAME_ALL
)
{
btr_pcur_t
::
SAME_ALL
)
{
goto
mtr_commit_exit
;
goto
mtr_commit_exit
;
}
}
...
@@ -504,7 +503,7 @@ row_undo_mod_del_mark_or_remove_sec_low(
...
@@ -504,7 +503,7 @@ row_undo_mod_del_mark_or_remove_sec_low(
mode
=
BTR_MODIFY_LEAF
|
BTR_ALREADY_S_LATCHED
;
mode
=
BTR_MODIFY_LEAF
|
BTR_ALREADY_S_LATCHED
;
mtr_s_lock_index
(
index
,
&
mtr
);
mtr_s_lock_index
(
index
,
&
mtr
);
}
else
{
}
else
{
ut_ad
(
mode
==
(
BTR_MODIFY_TREE
|
BTR_LATCH_FOR_DELETE
)
);
ut_ad
(
mode
==
BTR_PURGE_TREE
);
mtr_sx_lock_index
(
index
,
&
mtr
);
mtr_sx_lock_index
(
index
,
&
mtr
);
}
}
}
else
{
}
else
{
...
@@ -634,7 +633,7 @@ row_undo_mod_del_mark_or_remove_sec(
...
@@ -634,7 +633,7 @@ row_undo_mod_del_mark_or_remove_sec(
}
}
err
=
row_undo_mod_del_mark_or_remove_sec_low
(
node
,
thr
,
index
,
err
=
row_undo_mod_del_mark_or_remove_sec_low
(
node
,
thr
,
index
,
entry
,
BTR_
MODIFY_TREE
|
BTR_LATCH_FOR_DELET
E
);
entry
,
BTR_
PURGE_TRE
E
);
return
(
err
);
return
(
err
);
}
}
...
...
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