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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
68e0fd67
Commit
68e0fd67
authored
Feb 05, 2007
by
tomas@poseidon.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge poseidon.mysql.com:/home/tomas/mysql-5.1-telco-cga
into poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
parents
aad58e26
b3fa3c8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+36
-0
No files found.
sql/ha_ndbcluster_binlog.cc
View file @
68e0fd67
...
...
@@ -97,6 +97,7 @@ static ulonglong ndb_latest_received_binlog_epoch= 0;
NDB_SHARE
*
ndb_apply_status_share
=
0
;
NDB_SHARE
*
ndb_schema_share
=
0
;
pthread_mutex_t
ndb_schema_share_mutex
;
/* Schema object distribution handling */
HASH
ndb_schema_objects
;
...
...
@@ -621,6 +622,7 @@ static int ndbcluster_binlog_end(THD *thd)
pthread_mutex_destroy
(
&
injector_mutex
);
pthread_cond_destroy
(
&
injector_cond
);
pthread_mutex_destroy
(
&
ndb_schema_share_mutex
);
#endif
DBUG_RETURN
(
0
);
}
...
...
@@ -1271,6 +1273,16 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
int
no_storage_nodes
=
g_ndb_cluster_connection
->
no_db_nodes
();
bitmap_init
(
&
schema_subscribers
,
bitbuf
,
sizeof
(
bitbuf
)
*
8
,
FALSE
);
bitmap_set_all
(
&
schema_subscribers
);
/* begin protect ndb_schema_share */
pthread_mutex_lock
(
&
ndb_schema_share_mutex
);
if
(
ndb_schema_share
==
0
)
{
pthread_mutex_unlock
(
&
ndb_schema_share_mutex
);
if
(
ndb_schema_object
)
ndb_free_schema_object
(
&
ndb_schema_object
,
FALSE
);
DBUG_RETURN
(
0
);
}
(
void
)
pthread_mutex_lock
(
&
ndb_schema_share
->
mutex
);
for
(
i
=
0
;
i
<
no_storage_nodes
;
i
++
)
{
...
...
@@ -1283,6 +1295,9 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
}
}
(
void
)
pthread_mutex_unlock
(
&
ndb_schema_share
->
mutex
);
pthread_mutex_unlock
(
&
ndb_schema_share_mutex
);
/* end protect ndb_schema_share */
if
(
updated
)
{
bitmap_clear_bit
(
&
schema_subscribers
,
node_id
);
...
...
@@ -1478,6 +1493,14 @@ end:
&
abstime
);
if
(
thd
->
killed
)
break
;
/* begin protect ndb_schema_share */
pthread_mutex_lock
(
&
ndb_schema_share_mutex
);
if
(
ndb_schema_share
==
0
)
{
pthread_mutex_unlock
(
&
ndb_schema_share_mutex
);
break
;
}
(
void
)
pthread_mutex_lock
(
&
ndb_schema_share
->
mutex
);
for
(
i
=
0
;
i
<
no_storage_nodes
;
i
++
)
{
...
...
@@ -1487,6 +1510,8 @@ end:
bitmap_intersect
(
&
schema_subscribers
,
tmp
);
}
(
void
)
pthread_mutex_unlock
(
&
ndb_schema_share
->
mutex
);
pthread_mutex_unlock
(
&
ndb_schema_share_mutex
);
/* end protect ndb_schema_share */
/* remove any unsubscribed from ndb_schema_object->slock */
bitmap_intersect
(
&
ndb_schema_object
->
slock_bitmap
,
&
schema_subscribers
);
...
...
@@ -1910,8 +1935,14 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
ndb_binlog_tables_inited
&&
ndb_binlog_running
)
sql_print_information
(
"NDB Binlog: ndb tables initially "
"read only on reconnect."
);
/* begin protect ndb_schema_share */
pthread_mutex_lock
(
&
ndb_schema_share_mutex
);
free_share
(
&
ndb_schema_share
);
ndb_schema_share
=
0
;
pthread_mutex_unlock
(
&
ndb_schema_share_mutex
);
/* end protect ndb_schema_share */
close_cached_tables
((
THD
*
)
0
,
0
,
(
TABLE_LIST
*
)
0
,
FALSE
);
// fall through
case
NDBEVENT
:
:
TE_ALTER
:
...
...
@@ -2278,6 +2309,7 @@ int ndbcluster_binlog_start()
pthread_mutex_init
(
&
injector_mutex
,
MY_MUTEX_INIT_FAST
);
pthread_cond_init
(
&
injector_cond
,
NULL
);
pthread_mutex_init
(
&
ndb_schema_share_mutex
,
MY_MUTEX_INIT_FAST
);
/* Create injector thread */
if
(
pthread_create
(
&
ndb_binlog_thread
,
&
connection_attrib
,
...
...
@@ -3966,8 +3998,12 @@ err:
}
if
(
ndb_schema_share
)
{
/* begin protect ndb_schema_share */
pthread_mutex_lock
(
&
ndb_schema_share_mutex
);
free_share
(
&
ndb_schema_share
);
ndb_schema_share
=
0
;
pthread_mutex_unlock
(
&
ndb_schema_share_mutex
);
/* end protect ndb_schema_share */
}
/* remove all event operations */
...
...
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