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
a4b29743
Commit
a4b29743
authored
Jun 22, 2002
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slave.h, slave.cc:
Do not flush the position to master.info file if we have a transaction open
parent
6504a393
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
sql/slave.cc
sql/slave.cc
+26
-3
sql/slave.h
sql/slave.h
+6
-0
No files found.
sql/slave.cc
View file @
a4b29743
...
...
@@ -907,6 +907,12 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
event_len
);
char
llbuff
[
22
];
mi
->
event_len
=
event_len
;
/* Added by Heikki: InnoDB internally stores the
master log position it has processed so far;
position to store is really
mi->pos + mi->pending + mi->event_len
since we must store the pos of the END of the
current log event */
if
(
ev
)
{
int
type_code
=
ev
->
get_type_code
();
...
...
@@ -1017,7 +1023,16 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
delete
ev
;
mi
->
inc_pos
(
event_len
);
flush_master_info
(
mi
);
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
)))
{
/* We only flush the master info position to the master.info file if
the transaction is not open any more: an incomplete transaction will
be rolled back automatically in crash recovery in transactional
table handlers */
flush_master_info
(
mi
);
}
break
;
}
...
...
@@ -1139,10 +1154,16 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
}
mi
->
inc_pos
(
event_len
);
flush_master_info
(
mi
);
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
)))
flush_master_info
(
mi
);
break
;
}
/* Question: in a START or STOP event, what happens if we have transaction
open? */
case
START_EVENT
:
mi
->
inc_pos
(
event_len
);
flush_master_info
(
mi
);
...
...
@@ -1168,7 +1189,9 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
mi
->
pos
=
4
;
// skip magic number
pthread_cond_broadcast
(
&
mi
->
cond
);
pthread_mutex_unlock
(
&
mi
->
lock
);
flush_master_info
(
mi
);
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTO_COMMIT
|
OPTION_BEGIN
)))
flush_master_info
(
mi
);
#ifndef DBUG_OFF
if
(
abort_slave_event_count
)
++
events_till_abort
;
...
...
sql/slave.h
View file @
a4b29743
...
...
@@ -12,6 +12,12 @@ typedef struct st_master_info
{
char
log_file_name
[
FN_REFLEN
];
ulonglong
pos
,
pending
;
int
event_len
;
/* Added by Heikki: InnoDB internally stores the
master log position it has processed so far; the
position to store is really the sum
pos + pending + event_len
here since we must store the pos of the END of the
current log event */
File
fd
;
// we keep the file open, so we need to remember the file pointer
IO_CACHE
file
;
// the variables below are needed because we can change masters on the fly
...
...
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