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
81bc79a7
Commit
81bc79a7
authored
Jul 25, 2007
by
tomas@whalegate.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#30017 log-slave-updates incorrect behavior for cluster
- let the receiving injector thread decide what to do
parent
483555d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
13 deletions
+50
-13
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+37
-13
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+13
-0
No files found.
sql/ha_ndbcluster.cc
View file @
81bc79a7
...
...
@@ -2812,10 +2812,16 @@ int ha_ndbcluster::write_row(byte *record)
if
(
unlikely
(
m_slow_path
))
{
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
op
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
else
if
(
thd
->
slave_thread
)
/*
ignore OPTION_BIN_LOG for slave thd. It is used to indicate
log-slave-updates option. This is instead handled in the
injector thread, by looking explicitly at the
opt_log_slave_updates flag.
*/
if
(
thd
->
slave_thread
)
op
->
setAnyValue
(
thd
->
server_id
);
else
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
op
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
}
m_rows_changed
++
;
...
...
@@ -3101,10 +3107,16 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
if
(
unlikely
(
m_slow_path
))
{
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
op
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
else
if
(
thd
->
slave_thread
)
/*
ignore OPTION_BIN_LOG for slave thd. It is used to indicate
log-slave-updates option. This is instead handled in the
injector thread, by looking explicitly at the
opt_log_slave_updates flag
*/
if
(
thd
->
slave_thread
)
op
->
setAnyValue
(
thd
->
server_id
);
else
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
op
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
}
/*
Execute update operation if we are not doing a scan for update
...
...
@@ -3168,12 +3180,18 @@ int ha_ndbcluster::delete_row(const byte *record)
if
(
unlikely
(
m_slow_path
))
{
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
((
NdbOperation
*
)
trans
->
getLastDefinedOperation
())
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
else
if
(
thd
->
slave_thread
)
/*
ignore OPTION_BIN_LOG for slave thd. It is used to indicate
log-slave-updates option. This is instead handled in the
injector thread, by looking explicitly at the
opt_log_slave_updates flag
*/
if
(
thd
->
slave_thread
)
((
NdbOperation
*
)
trans
->
getLastDefinedOperation
())
->
setAnyValue
(
thd
->
server_id
);
else
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
((
NdbOperation
*
)
trans
->
getLastDefinedOperation
())
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
}
if
(
!
(
m_primary_key_update
||
m_delete_cannot_batch
))
// If deleting from cursor, NoCommit will be handled in next_result
...
...
@@ -3207,10 +3225,16 @@ int ha_ndbcluster::delete_row(const byte *record)
if
(
unlikely
(
m_slow_path
))
{
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
op
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
else
if
(
thd
->
slave_thread
)
/*
ignore OPTION_BIN_LOG for slave thd. It is used to indicate
log-slave-updates option. This is instead handled in the
injector thread, by looking explicitly at the
opt_log_slave_updates flag
*/
if
(
thd
->
slave_thread
)
op
->
setAnyValue
(
thd
->
server_id
);
else
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
op
->
setAnyValue
(
NDB_ANYVALUE_FOR_NOLOGGING
);
}
}
...
...
sql/ha_ndbcluster_binlog.cc
View file @
81bc79a7
...
...
@@ -114,6 +114,9 @@ NDB_SHARE *ndb_apply_status_share= 0;
NDB_SHARE
*
ndb_schema_share
=
0
;
pthread_mutex_t
ndb_schema_share_mutex
;
extern
my_bool
opt_log_slave_updates
;
static
my_bool
g_ndb_log_slave_updates
;
/* Schema object distribution handling */
HASH
ndb_schema_objects
;
typedef
struct
st_ndb_schema_object
{
...
...
@@ -3297,6 +3300,14 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
originating_server_id
);
return
0
;
}
else
if
(
!
g_ndb_log_slave_updates
)
{
/*
This event comes from a slave applier since it has an originating
server id set. Since option to log slave updates is not set, skip it.
*/
return
0
;
}
TABLE
*
table
=
share
->
table
;
DBUG_ASSERT
(
trans
.
good
());
...
...
@@ -3949,6 +3960,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
!
IS_NDB_BLOB_PREFIX
(
pOp
->
getEvent
()
->
getTable
()
->
getName
()));
DBUG_ASSERT
(
gci
<=
ndb_latest_received_binlog_epoch
);
/* initialize some variables for this epoch */
g_ndb_log_slave_updates
=
opt_log_slave_updates
;
i_ndb
->
setReportThreshEventGCISlip
(
ndb_report_thresh_binlog_epoch_slip
);
i_ndb
->
setReportThreshEventFreeMem
(
ndb_report_thresh_binlog_mem_usage
);
...
...
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