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
9fc9d0f2
Commit
9fc9d0f2
authored
Mar 23, 2006
by
brian@zim.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into zim.(none):/home/brian/mysql/dep-5.1
parents
add4b40e
aced1175
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
192 deletions
+7
-192
sql/ha_innodb.cc
sql/ha_innodb.cc
+0
-104
sql/handler.cc
sql/handler.cc
+0
-53
sql/handler.h
sql/handler.h
+0
-5
sql/sql_class.cc
sql/sql_class.cc
+7
-9
sql/sql_repl.cc
sql/sql_repl.cc
+0
-21
No files found.
sql/ha_innodb.cc
View file @
9fc9d0f2
...
@@ -1969,110 +1969,6 @@ innobase_commit_complete(
...
@@ -1969,110 +1969,6 @@ innobase_commit_complete(
return
(
0
);
return
(
0
);
}
}
#ifdef HAVE_REPLICATION
/*********************************************************************
In synchronous replication, reports to InnoDB up to which binlog position
we have sent the binlog to the slave. Note that replication is synchronous
for one slave only. For other slaves, we do nothing in this function. This
function is used in a replication master. */
int
innobase_repl_report_sent_binlog
(
/*=============================*/
/* out: 0 */
THD
*
thd
,
/* in: thread doing the binlog communication to
the slave */
char
*
log_file_name
,
/* in: binlog file name */
my_off_t
end_offset
)
/* in: the offset in the binlog file up to
which we sent the contents to the slave */
{
int
cmp
;
ibool
can_release_threads
=
0
;
if
(
!
innodb_inited
)
{
return
0
;
}
/* If synchronous replication is not switched on, or this thd is
sending binlog to a slave where we do not need synchronous replication,
then return immediately */
if
(
thd
->
server_id
!=
thd
->
variables
.
sync_replication_slave_id
)
{
/* Do nothing */
return
(
0
);
}
pthread_mutex_lock
(
&
innobase_repl_cond_mutex
);
if
(
innobase_repl_state
==
0
)
{
ut_print_timestamp
(
stderr
);
sql_print_warning
(
"Switching MySQL synchronous replication on "
"again at binlog file %s, position %lu"
,
log_file_name
,
(
ulong
)
end_offset
);
innobase_repl_state
=
1
;
}
/* The position should increase monotonically, since just one thread
is sending the binlog to the slave for which we want synchronous
replication. Let us check this, and print an error to the .err log
if that is not the case. */
if
(
innobase_repl_file_name_inited
)
{
cmp
=
strcmp
(
log_file_name
,
innobase_repl_file_name
);
if
(
cmp
<
0
||
(
cmp
==
0
&&
end_offset
<
innobase_repl_pos
))
{
ut_print_timestamp
(
stderr
);
sql_print_error
(
"MySQL synchronous replication has "
"sent binlog to the slave up to file "
"%s, position %lu, but now MySQL "
"reports that it sent the binlog only "
"up to file %s, position %lu"
,
innobase_repl_file_name
,
(
ulong
)
innobase_repl_pos
,
log_file_name
,
(
ulong
)
end_offset
);
}
}
strcpy
(
innobase_repl_file_name
,
log_file_name
);
innobase_repl_pos
=
end_offset
;
innobase_repl_file_name_inited
=
1
;
if
(
innobase_repl_n_wait_threads
>
0
)
{
/* Let us check if some of the waiting threads doing a trx
commit can now proceed */
cmp
=
strcmp
(
innobase_repl_file_name
,
innobase_repl_wait_file_name
);
if
(
cmp
>
0
||
(
cmp
==
0
&&
innobase_repl_pos
>=
innobase_repl_wait_pos
))
{
/* Yes, at least one waiting thread can now proceed:
let us release all waiting threads with a broadcast */
can_release_threads
=
1
;
innobase_repl_wait_file_name_inited
=
0
;
}
}
pthread_mutex_unlock
(
&
innobase_repl_cond_mutex
);
if
(
can_release_threads
)
{
pthread_cond_broadcast
(
&
innobase_repl_cond
);
}
return
(
0
);
}
#endif
/* HAVE_REPLICATION */
/*********************************************************************
/*********************************************************************
Rolls back a transaction or the latest SQL statement. */
Rolls back a transaction or the latest SQL statement. */
...
...
sql/handler.cc
View file @
9fc9d0f2
...
@@ -3316,56 +3316,3 @@ int handler::ha_delete_row(const byte *buf)
...
@@ -3316,56 +3316,3 @@ int handler::ha_delete_row(const byte *buf)
#endif
#endif
return
0
;
return
0
;
}
}
#ifdef HAVE_REPLICATION
/*
Reports to table handlers up to which position we have sent the binlog
to a slave in replication
SYNOPSIS
ha_repl_report_sent_binlog()
thd thread doing the binlog communication to the slave
log_file_name binlog file name
end_offse t the offset in the binlog file up to which we sent the
contents to the slave
NOTES
Only works for InnoDB at the moment
RETURN VALUE
Always 0 (= success)
*/
int
ha_repl_report_sent_binlog
(
THD
*
thd
,
char
*
log_file_name
,
my_off_t
end_offset
)
{
#ifdef WITH_INNOBASE_STORAGE_ENGINE
innobase_repl_report_sent_binlog
(
thd
,
log_file_name
,
end_offset
);
#endif
return
0
;
}
/*
Reports to table handlers that we stop replication to a specific slave
SYNOPSIS
ha_repl_report_replication_stop()
thd thread doing the binlog communication to the slave
NOTES
Does nothing at the moment
RETURN VALUE
Always 0 (= success)
PARAMETERS
*/
int
ha_repl_report_replication_stop
(
THD
*
thd
)
{
return
0
;
}
#endif
/* HAVE_REPLICATION */
sql/handler.h
View file @
9fc9d0f2
...
@@ -1605,11 +1605,6 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht);
...
@@ -1605,11 +1605,6 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht);
#define trans_need_2pc(thd, all) ((total_ha_2pc > 1) && \
#define trans_need_2pc(thd, all) ((total_ha_2pc > 1) && \
!((all ? &thd->transaction.all : &thd->transaction.stmt)->no_2pc))
!((all ? &thd->transaction.all : &thd->transaction.stmt)->no_2pc))
/* semi-synchronous replication */
int
ha_repl_report_sent_binlog
(
THD
*
thd
,
char
*
log_file_name
,
my_off_t
end_offset
);
int
ha_repl_report_replication_stop
(
THD
*
thd
);
#ifdef HAVE_NDB_BINLOG
#ifdef HAVE_NDB_BINLOG
int
ha_reset_logs
(
THD
*
thd
);
int
ha_reset_logs
(
THD
*
thd
);
int
ha_binlog_index_purge_file
(
THD
*
thd
,
const
char
*
file
);
int
ha_binlog_index_purge_file
(
THD
*
thd
,
const
char
*
file
);
...
...
sql/sql_class.cc
View file @
9fc9d0f2
...
@@ -961,14 +961,12 @@ bool select_send::send_data(List<Item> &items)
...
@@ -961,14 +961,12 @@ bool select_send::send_data(List<Item> &items)
return
0
;
return
0
;
}
}
#ifdef WITH_INNOBASE_STORAGE_ENGINE
/*
/*
We may be passing the control from mysqld to the client: release the
We may be passing the control from mysqld to the client: release the
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
by thd
by thd
*/
*/
ha_release_temporary_latches
(
thd
);
ha_release_temporary_latches
(
thd
);
#endif
List_iterator_fast
<
Item
>
li
(
items
);
List_iterator_fast
<
Item
>
li
(
items
);
Protocol
*
protocol
=
thd
->
protocol
;
Protocol
*
protocol
=
thd
->
protocol
;
...
@@ -998,12 +996,12 @@ bool select_send::send_data(List<Item> &items)
...
@@ -998,12 +996,12 @@ bool select_send::send_data(List<Item> &items)
bool
select_send
::
send_eof
()
bool
select_send
::
send_eof
()
{
{
#ifdef WITH_INNOBASE_STORAGE_ENGINE
/*
/*
We may be passing the control from mysqld to the client: release the
We may be passing the control from mysqld to the client: release the
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
by thd */
by thd
*/
ha_release_temporary_latches
(
thd
);
ha_release_temporary_latches
(
thd
);
#endif
/* Unlock tables before sending packet to gain some speed */
/* Unlock tables before sending packet to gain some speed */
if
(
thd
->
lock
)
if
(
thd
->
lock
)
...
...
sql/sql_repl.cc
View file @
9fc9d0f2
...
@@ -386,9 +386,6 @@ impossible position";
...
@@ -386,9 +386,6 @@ impossible position";
goto
err
;
goto
err
;
}
}
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_sent_binlog
(
thd
,
log_file_name
,
pos
);
/*
/*
We need to start a packet with something other than 255
We need to start a packet with something other than 255
to distinguish it from error
to distinguish it from error
...
@@ -475,9 +472,6 @@ impossible position";
...
@@ -475,9 +472,6 @@ impossible position";
goto
err
;
goto
err
;
}
}
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_sent_binlog
(
thd
,
log_file_name
,
my_b_tell
(
&
log
));
/*
/*
No need to save this event. We are only doing simple reads
No need to save this event. We are only doing simple reads
(no real parsing of the events) so we don't need it. And so
(no real parsing of the events) so we don't need it. And so
...
@@ -536,9 +530,6 @@ impossible position";
...
@@ -536,9 +530,6 @@ impossible position";
goto
err
;
goto
err
;
}
}
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_sent_binlog
(
thd
,
log_file_name
,
my_b_tell
(
&
log
));
DBUG_PRINT
(
"info"
,
(
"log event code %d"
,
DBUG_PRINT
(
"info"
,
(
"log event code %d"
,
(
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
));
(
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
));
if
((
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
==
LOAD_EVENT
)
if
((
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
==
LOAD_EVENT
)
...
@@ -652,9 +643,6 @@ impossible position";
...
@@ -652,9 +643,6 @@ impossible position";
goto
err
;
goto
err
;
}
}
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_sent_binlog
(
thd
,
log_file_name
,
my_b_tell
(
&
log
));
if
((
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
==
LOAD_EVENT
)
if
((
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
==
LOAD_EVENT
)
{
{
if
(
send_file
(
thd
))
if
(
send_file
(
thd
))
...
@@ -721,18 +709,12 @@ impossible position";
...
@@ -721,18 +709,12 @@ impossible position";
goto
err
;
goto
err
;
}
}
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_sent_binlog
(
thd
,
log_file_name
,
0
);
packet
->
length
(
0
);
packet
->
length
(
0
);
packet
->
append
(
'\0'
);
packet
->
append
(
'\0'
);
}
}
}
}
end:
end:
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_replication_stop
(
thd
);
end_io_cache
(
&
log
);
end_io_cache
(
&
log
);
(
void
)
my_close
(
file
,
MYF
(
MY_WME
));
(
void
)
my_close
(
file
,
MYF
(
MY_WME
));
...
@@ -744,9 +726,6 @@ impossible position";
...
@@ -744,9 +726,6 @@ impossible position";
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
err:
err:
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_replication_stop
(
thd
);
thd
->
proc_info
=
"Waiting to finalize termination"
;
thd
->
proc_info
=
"Waiting to finalize termination"
;
end_io_cache
(
&
log
);
end_io_cache
(
&
log
);
/*
/*
...
...
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