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
92dec44e
Commit
92dec44e
authored
18 years ago
by
mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#19122: Need to close handlers before drop/rename phase
Fixed comments
parent
30817b89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
sql/sql_partition.cc
sql/sql_partition.cc
+18
-8
No files found.
sql/sql_partition.cc
View file @
92dec44e
...
...
@@ -5742,7 +5742,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
be no new threads accessing the table. They will be hanging on the
name lock.
5) Close all tables that have already been opened but didn't stumble on
the abort locked previously.
the abort locked previously. This is done as part of the
get_name_lock call.
6) We are now ready to release all locks we got in this thread.
7) Write the bin log
Unfortunately the writing of the binlog is not synchronised with
...
...
@@ -5817,15 +5818,24 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
3) Lock all partitions in TL_WRITE_ONLY to ensure that no users
are still using the old partitioning scheme. Wait until all
ongoing users have completed before progressing.
4) Write binlog
5) Now the change is completed except for the installation of the
4) Get a name lock on the table. This ensures that we can release all
locks on the table and since no one can open the table, there can
be no new threads accessing the table. They will be hanging on the
name lock.
5) Close all tables that have already been opened but didn't stumble on
the abort locked previously. This is done as part of the
get_name_lock call.
6) Close all table handlers and unlock all handlers but retain name lock
7) Write binlog
8) Now the change is completed except for the installation of the
new frm file. We thus write an action in the log to change to
the shadow frm file
6
) Install the new frm file of the table where the partitions are
9
) Install the new frm file of the table where the partitions are
added to the table.
7) Wait until all accesses using the old frm file has completed
8) Remove entries from ddl log
9) Complete query
10)Wait until all accesses using the old frm file has completed
11)Remove entries from ddl log
12)Release name lock
13)Complete query
*/
if
(
write_log_add_change_partition
(
lpt
)
||
ERROR_INJECT_CRASH
(
"crash_add_partition_1"
)
||
...
...
@@ -5905,7 +5915,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
7) Close all tables opened but not yet locked, after this call we are
certain that no other thread is in the lock wait queue or has
opened the table. The name lock will ensure that they are blocked
on the open call.
on the open call.
This is achieved also by get_name_lock call.
8) Close all partitions opened by this thread, but retain name lock.
9) Write bin log
10) Prepare handlers for rename and delete of partitions
...
...
This diff is collapsed.
Click to expand it.
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