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
d2bdd789
Commit
d2bdd789
authored
Dec 28, 2018
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Master_info counters transition to Atomic_counter
parent
656a702c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
23 deletions
+13
-23
include/my_counter.h
include/my_counter.h
+3
-0
sql/log_event.cc
sql/log_event.cc
+3
-7
sql/mysqld.h
sql/mysqld.h
+1
-0
sql/rpl_mi.h
sql/rpl_mi.h
+3
-3
sql/slave.cc
sql/slave.cc
+3
-10
sql/sql_class.cc
sql/sql_class.cc
+0
-1
sql/sql_statistics.cc
sql/sql_statistics.cc
+0
-1
sql/table.cc
sql/table.cc
+0
-1
No files found.
include/my_counter.h
View file @
d2bdd789
...
...
@@ -28,6 +28,9 @@ template <typename Type> class Atomic_counter
Type
sub
(
Type
i
)
{
return
m_counter
.
fetch_sub
(
i
,
std
::
memory_order_relaxed
);
}
public:
Atomic_counter
(
Type
val
)
:
m_counter
(
val
)
{}
Atomic_counter
()
{}
Type
operator
++
(
int
)
{
return
add
(
1
);
}
Type
operator
--
(
int
)
{
return
sub
(
1
);
}
...
...
sql/log_event.cc
View file @
d2bdd789
...
...
@@ -53,7 +53,6 @@
#include "rpl_constants.h"
#include "sql_digest.h"
#include "zlib.h"
#include "my_atomic.h"
#define my_b_write_string(A, B) my_b_write((A), (uchar*)(B), (uint) (sizeof(B) - 1))
...
...
@@ -8055,16 +8054,13 @@ Gtid_log_event::do_apply_event(rpl_group_info *rgi)
switch
(
flags2
&
(
FL_DDL
|
FL_TRANSACTIONAL
))
{
case
FL_TRANSACTIONAL
:
my_atomic_add64_explicit
((
volatile
int64
*
)
&
mi
->
total_trans_groups
,
1
,
MY_MEMORY_ORDER_RELAXED
);
mi
->
total_trans_groups
++
;
break
;
case
FL_DDL
:
my_atomic_add64_explicit
((
volatile
int64
*
)
&
mi
->
total_ddl_groups
,
1
,
MY_MEMORY_ORDER_RELAXED
);
mi
->
total_ddl_groups
++
;
break
;
default:
my_atomic_add64_explicit
((
volatile
int64
*
)
&
mi
->
total_non_trans_groups
,
1
,
MY_MEMORY_ORDER_RELAXED
);
mi
->
total_non_trans_groups
++
;
}
if
(
flags2
&
FL_STANDALONE
)
...
...
sql/mysqld.h
View file @
d2bdd789
...
...
@@ -23,6 +23,7 @@
#include "my_decimal.h"
/* my_decimal */
#include "mysql_com.h"
/* SERVER_VERSION_LENGTH */
#include "my_atomic.h"
#include "my_counter.h"
#include "mysql/psi/mysql_file.h"
/* MYSQL_FILE */
#include "mysql/psi/mysql_socket.h"
/* MYSQL_SOCKET */
#include "sql_list.h"
/* I_List */
...
...
sql/rpl_mi.h
View file @
d2bdd789
...
...
@@ -329,13 +329,13 @@ class Master_info : public Slave_reporting_capability
/* No of DDL event group */
volatile
uint64
total_ddl_groups
;
Atomic_counter
<
uint64
>
total_ddl_groups
;
/* No of non-transactional event group*/
volatile
uint64
total_non_trans_groups
;
Atomic_counter
<
uint64
>
total_non_trans_groups
;
/* No of transactional event group*/
volatile
uint64
total_trans_groups
;
Atomic_counter
<
uint64
>
total_trans_groups
;
/* domain-id based filter */
Domain_id_filter
domain_id_filter
;
...
...
sql/slave.cc
View file @
d2bdd789
...
...
@@ -3407,16 +3407,9 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
// Slave_SQL_Running_State
protocol
->
store
(
slave_sql_running_state
,
&
my_charset_bin
);
uint64
events
;
events
=
(
uint64
)
my_atomic_load64_explicit
((
volatile
int64
*
)
&
mi
->
total_ddl_groups
,
MY_MEMORY_ORDER_RELAXED
);
protocol
->
store
(
events
);
events
=
(
uint64
)
my_atomic_load64_explicit
((
volatile
int64
*
)
&
mi
->
total_non_trans_groups
,
MY_MEMORY_ORDER_RELAXED
);
protocol
->
store
(
events
);
events
=
(
uint64
)
my_atomic_load64_explicit
((
volatile
int64
*
)
&
mi
->
total_trans_groups
,
MY_MEMORY_ORDER_RELAXED
);
protocol
->
store
(
events
);
protocol
->
store
(
mi
->
total_ddl_groups
);
protocol
->
store
(
mi
->
total_non_trans_groups
);
protocol
->
store
(
mi
->
total_trans_groups
);
if
(
full
)
{
...
...
sql/sql_class.cc
View file @
d2bdd789
...
...
@@ -68,7 +68,6 @@
#include "wsrep_mysqld.h"
#include "wsrep_thd.h"
#include "sql_connect.h"
#include "my_atomic.h"
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
...
...
sql/sql_statistics.cc
View file @
d2bdd789
...
...
@@ -29,7 +29,6 @@
#include "sql_statistics.h"
#include "opt_range.h"
#include "uniques.h"
#include "my_atomic.h"
#include "sql_show.h"
#include "sql_partition.h"
...
...
sql/table.cc
View file @
d2bdd789
...
...
@@ -44,7 +44,6 @@
#include "sql_cte.h"
#include "ha_sequence.h"
#include "sql_show.h"
#include <atomic>
/* For MySQL 5.7 virtual fields */
#define MYSQL57_GENERATED_FIELD 128
...
...
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