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
bb91facb
Commit
bb91facb
authored
Mar 10, 2020
by
Sachin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
::WAITING removed everything works
parent
6aedaa06
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
18 deletions
+12
-18
sql/log_event_server.cc
sql/log_event_server.cc
+6
-12
sql/rpl_mi.h
sql/rpl_mi.h
+1
-2
sql/sql_table.cc
sql/sql_table.cc
+5
-4
No files found.
sql/log_event_server.cc
View file @
bb91facb
...
...
@@ -1675,12 +1675,9 @@ static int process_commit_alter(THD *thd, uint64 thread_id)
return
1
;
}
/*
start_alter_state
can be either ::REGISTERED or ::WAITING
start_alter_state
must be ::REGISTERED
*/
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
while
(
info
->
state
==
start_alter_state
::
REGISTERED
)
mysql_cond_wait
(
&
info
->
start_alter_cond
,
&
mi
->
start_alter_lock
);
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
DBUG_ASSERT
(
info
->
state
==
start_alter_state
::
REGISTERED
);
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
info
->
state
=
start_alter_state
::
COMMIT_ALTER
;
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
...
...
@@ -1690,8 +1687,8 @@ static int process_commit_alter(THD *thd, uint64 thread_id)
while
(
info
->
state
!=
start_alter_state
::
COMMITTED
)
mysql_cond_wait
(
&
info
->
start_alter_cond
,
&
mi
->
start_alter_lock
);
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
my_free
(
info
);
mysql_cond_destroy
(
&
info
->
start_alter_cond
);
my_free
(
info
);
if
(
write_bin_log
(
thd
,
true
,
thd
->
query
(),
thd
->
query_length
()))
return
2
;
return
0
;
...
...
@@ -1722,12 +1719,9 @@ static int process_rollback_alter(THD *thd, uint64 thread_id)
return
0
;
}
/*
start_alter_state
can be either ::REGISTERED or ::WAITING
start_alter_state
must be ::REGISTERED
*/
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
while
(
info
->
state
==
start_alter_state
::
REGISTERED
)
mysql_cond_wait
(
&
info
->
start_alter_cond
,
&
mi
->
start_alter_lock
);
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
DBUG_ASSERT
(
info
->
state
==
start_alter_state
::
REGISTERED
);
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
info
->
state
=
start_alter_state
::
ROLLBACK_ALTER
;
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
...
...
@@ -1737,8 +1731,8 @@ static int process_rollback_alter(THD *thd, uint64 thread_id)
while
(
info
->
state
!=
start_alter_state
::
COMMITTED
)
mysql_cond_wait
(
&
info
->
start_alter_cond
,
&
mi
->
start_alter_lock
);
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
my_free
(
info
);
mysql_cond_destroy
(
&
info
->
start_alter_cond
);
my_free
(
info
);
if
(
write_bin_log
(
thd
,
true
,
thd
->
query
(),
thd
->
query_length
()))
return
2
;
return
0
;
...
...
sql/rpl_mi.h
View file @
bb91facb
...
...
@@ -148,8 +148,7 @@ typedef struct st_rows_event_tracker
enum
start_alter_state
{
REGISTERED
,
// Start Alter exist
WAITING
,
// WAITING for commit/rollback
REGISTERED
=
0
,
// Start Alter exist, Default state
COMMIT_ALTER
,
// COMMIT the alter
ROLLBACK_ALTER
,
// Rollback the alter
COMMITTED
,
// COMMIT/ROLLBACK Alter written in binlog
...
...
sql/sql_table.cc
View file @
bb91facb
...
...
@@ -9366,12 +9366,12 @@ static void wait_for_master(THD *thd, start_alter_info* info)
{
Master_info
*
mi
=
thd
->
rgi_slave
->
rli
->
mi
;
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
if
(
info
->
state
!=
start_alter_state
::
SHUTDOWN_RECIEVED
)
info
->
state
=
start_alter_state
::
WAITING
;
//
if (info->state != start_alter_state::SHUTDOWN_RECIEVED)
//
info->state= start_alter_state::WAITING;
mysql_mutex_unlock
(
&
mi
->
start_alter_lock
);
mysql_cond_broadcast
(
&
info
->
start_alter_cond
);
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
while
(
info
->
state
==
start_alter_state
::
WAITING
)
while
(
info
->
state
==
start_alter_state
::
REGISTERED
)
{
mysql_cond_wait
(
&
info
->
start_alter_cond
,
&
mi
->
start_alter_lock
);
}
...
...
@@ -9391,7 +9391,7 @@ static int master_result(THD *thd, Master_info *mi, start_alter_info *info,
{
if
(
info
->
state
==
start_alter_state
::
REGISTERED
)
wait_for_master
(
thd
,
info
);
DBUG_ASSERT
(
info
->
state
>
start_alter_state
::
WAITING
);
DBUG_ASSERT
(
info
->
state
>
start_alter_state
::
REGISTERED
);
if
(
info
->
state
==
start_alter_state
::
ROLLBACK_ALTER
)
{
mysql_mutex_lock
(
&
mi
->
start_alter_lock
);
...
...
@@ -9480,6 +9480,7 @@ start_alter_info *get_new_start_alter_info(THD *thd)
return
0
;
}
mysql_cond_init
(
0
,
&
info
->
start_alter_cond
,
NULL
);
// info->start_alter_cond.m_psi= NULL;
return
info
;
}
...
...
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