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
d694d5f1
Commit
d694d5f1
authored
Apr 27, 2005
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge heikki@bk-internal.mysql.com:/home/bk/mysql-5.0
into hundin.mysql.fi:/home/heikki/mysql-5.0
parents
fe8d8aca
f12cd8c7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
382 additions
and
11 deletions
+382
-11
sql/ha_innodb.cc
sql/ha_innodb.cc
+281
-6
sql/ha_innodb.h
sql/ha_innodb.h
+2
-0
sql/handler.cc
sql/handler.cc
+57
-0
sql/handler.h
sql/handler.h
+5
-1
sql/mysqld.cc
sql/mysqld.cc
+0
-2
sql/set_var.cc
sql/set_var.cc
+0
-2
sql/sql_repl.cc
sql/sql_repl.cc
+37
-0
No files found.
sql/ha_innodb.cc
View file @
d694d5f1
This diff is collapsed.
Click to expand it.
sql/ha_innodb.h
View file @
d694d5f1
...
...
@@ -321,3 +321,5 @@ int innobase_rollback_by_xid(
int
innobase_xa_end
(
THD
*
thd
);
int
innobase_repl_report_sent_binlog
(
THD
*
thd
,
char
*
log_file_name
,
my_off_t
end_offset
);
sql/handler.cc
View file @
d694d5f1
...
...
@@ -2411,3 +2411,60 @@ TYPELIB *ha_known_exts(void)
}
return
&
known_extensions
;
}
/*
Reports to table handlers up to which position we have sent the binlog
to a slave in replication
SYNOPSIS
ha_repl_report_sent_binlog()
NOTES
Only works for InnoDB at the moment
RETURN VALUE
Always 0 (= success)
PARAMETERS
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
ha_repl_report_sent_binlog
(
THD
*
thd
,
char
*
log_file_name
,
my_off_t
end_offset
)
{
#ifdef HAVE_INNOBASE_DB
return
innobase_repl_report_sent_binlog
(
thd
,
log_file_name
,
end_offset
);
#else
/* remove warnings about unused parameters */
thd
=
thd
;
log_file_name
=
log_file_name
;
end_offset
=
end_offset
;
return
0
;
#endif
}
/*
Reports to table handlers that we stop replication to a specific slave
SYNOPSIS
ha_repl_report_replication_stop()
NOTES
Does nothing at the moment
RETURN VALUE
Always 0 (= success)
PARAMETERS
THD *thd in: thread doing the binlog communication to
the slave
*/
int
ha_repl_report_replication_stop
(
THD
*
thd
)
{
thd
=
thd
;
return
0
;
}
sql/handler.h
View file @
d694d5f1
...
...
@@ -843,7 +843,7 @@ int ha_change_key_cache_param(KEY_CACHE *key_cache);
int
ha_change_key_cache
(
KEY_CACHE
*
old_key_cache
,
KEY_CACHE
*
new_key_cache
);
int
ha_end_key_cache
(
KEY_CACHE
*
key_cache
);
/*
weird stuff
*/
/*
report to InnoDB that control passes to the client
*/
int
ha_release_temporary_latches
(
THD
*
thd
);
/* transactions: interface to handlerton functions */
...
...
@@ -875,3 +875,7 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht);
#define trans_need_2pc(thd, all) ((total_ha_2pc > 1) && \
!((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
);
sql/mysqld.cc
View file @
d694d5f1
...
...
@@ -5495,7 +5495,6 @@ The minimum value for this variable is 4096.",
{
"sync-frm"
,
OPT_SYNC_FRM
,
"Sync .frm to disk on create. Enabled by default."
,
(
gptr
*
)
&
opt_sync_frm
,
(
gptr
*
)
&
opt_sync_frm
,
0
,
GET_BOOL
,
NO_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
#ifdef DOES_NOTHING_YET
{
"sync-replication"
,
OPT_SYNC_REPLICATION
,
"Enable synchronous replication."
,
(
gptr
*
)
&
global_system_variables
.
sync_replication
,
...
...
@@ -5511,7 +5510,6 @@ The minimum value for this variable is 4096.",
(
gptr
*
)
&
global_system_variables
.
sync_replication_timeout
,
(
gptr
*
)
&
global_system_variables
.
sync_replication_timeout
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
10
,
0
,
~
0L
,
0
,
1
,
0
},
#endif
{
"table_cache"
,
OPT_TABLE_CACHE
,
"The number of open tables for all threads."
,
(
gptr
*
)
&
table_cache_size
,
(
gptr
*
)
&
table_cache_size
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
64
,
1
,
512
*
1024L
,
...
...
sql/set_var.cc
View file @
d694d5f1
...
...
@@ -956,11 +956,9 @@ struct show_var_st init_vars[]= {
{
"sql_warnings"
,
(
char
*
)
&
sys_sql_warnings
,
SHOW_BOOL
},
#ifdef HAVE_REPLICATION
{
sys_sync_binlog_period
.
name
,(
char
*
)
&
sys_sync_binlog_period
,
SHOW_SYS
},
#ifdef DOES_NOTHING_YET
{
sys_sync_replication
.
name
,
(
char
*
)
&
sys_sync_replication
,
SHOW_SYS
},
{
sys_sync_replication_slave_id
.
name
,
(
char
*
)
&
sys_sync_replication_slave_id
,
SHOW_SYS
},
{
sys_sync_replication_timeout
.
name
,
(
char
*
)
&
sys_sync_replication_timeout
,
SHOW_SYS
},
#endif
#endif
{
sys_sync_frm
.
name
,
(
char
*
)
&
sys_sync_frm
,
SHOW_SYS
},
#ifdef HAVE_TZNAME
...
...
sql/sql_repl.cc
View file @
d694d5f1
...
...
@@ -385,6 +385,11 @@ impossible position";
goto
err
;
}
printf
(
"Binlog file name %s
\n
"
,
log_file_name
);
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
to distinguish it from error
...
...
@@ -470,6 +475,10 @@ impossible position";
my_errno
=
ER_UNKNOWN_ERROR
;
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 real parsing of the events) so we don't need it. And so
...
...
@@ -527,6 +536,13 @@ impossible position";
my_errno
=
ER_UNKNOWN_ERROR
;
goto
err
;
}
printf
(
"Dump loop: %s: Current log position %lu
\n
"
,
log_file_name
,
(
ulong
)
my_b_tell
(
&
log
));
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"
,
(
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
));
if
((
*
packet
)[
LOG_EVENT_OFFSET
+
1
]
==
LOAD_EVENT
)
...
...
@@ -640,6 +656,12 @@ impossible position";
goto
err
;
}
printf
(
"Second loop: %s: Current log position %lu
\n
"
,
log_file_name
,
(
ulong
)
my_b_tell
(
&
log
));
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
(
send_file
(
thd
))
...
...
@@ -704,12 +726,22 @@ impossible position";
my_errno
=
ER_MASTER_FATAL_ERROR_READING_BINLOG
;
goto
err
;
}
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_sent_binlog
(
thd
,
log_file_name
,
0
);
printf
(
"Binlog file name of a new binlog %s
\n
"
,
log_file_name
);
packet
->
length
(
0
);
packet
->
append
(
'\0'
);
}
}
end:
printf
(
"Ending replication
\n
"
);
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_replication_stop
(
thd
);
end_io_cache
(
&
log
);
(
void
)
my_close
(
file
,
MYF
(
MY_WME
));
...
...
@@ -721,6 +753,11 @@ impossible position";
DBUG_VOID_RETURN
;
err:
if
(
thd
->
variables
.
sync_replication
)
ha_repl_report_replication_stop
(
thd
);
printf
(
"Ending replication in error %s
\n
"
,
errmsg
);
thd
->
proc_info
=
"Waiting to finalize termination"
;
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