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
c0854c3e
Commit
c0854c3e
authored
Oct 28, 2010
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added reporting of fsync to THD wait interface
parent
8fbf0e88
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
6 deletions
+42
-6
include/my_sys.h
include/my_sys.h
+2
-0
include/mysql/plugin_audit.h.pp
include/mysql/plugin_audit.h.pp
+2
-1
include/mysql/plugin_ftparser.h.pp
include/mysql/plugin_ftparser.h.pp
+2
-1
include/mysql/service_thd_wait.h
include/mysql/service_thd_wait.h
+2
-1
mysys/my_sync.c
mysys/my_sync.c
+19
-0
sql/scheduler.cc
sql/scheduler.cc
+15
-3
No files found.
include/my_sys.h
View file @
c0854c3e
...
...
@@ -633,6 +633,8 @@ extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern
int
my_fclose
(
FILE
*
fd
,
myf
MyFlags
);
extern
File
my_fileno
(
FILE
*
fd
);
extern
int
my_chsize
(
File
fd
,
my_off_t
newlength
,
int
filler
,
myf
MyFlags
);
void
thr_set_sync_wait_callback
(
void
(
*
before_sync
)(
void
),
void
(
*
after_sync
)(
void
));
extern
int
my_sync
(
File
fd
,
myf
my_flags
);
extern
int
my_sync_dir
(
const
char
*
dir_name
,
myf
my_flags
);
extern
int
my_sync_dir_by_file
(
const
char
*
file_name
,
myf
my_flags
);
...
...
include/mysql/plugin_audit.h.pp
View file @
c0854c3e
...
...
@@ -42,7 +42,8 @@ typedef enum _thd_wait_type_e {
THD_WAIT_USER_LOCK
=
7
,
THD_WAIT_BINLOG
=
8
,
THD_WAIT_GROUP_COMMIT
=
9
,
THD_WAIT_LAST
=
10
THD_WAIT_SYNC
=
10
,
THD_WAIT_LAST
=
11
}
thd_wait_type
;
extern
struct
thd_wait_service_st
{
void
(
*
thd_wait_begin_func
)(
void
*
,
thd_wait_type
);
...
...
include/mysql/plugin_ftparser.h.pp
View file @
c0854c3e
...
...
@@ -42,7 +42,8 @@ typedef enum _thd_wait_type_e {
THD_WAIT_USER_LOCK
=
7
,
THD_WAIT_BINLOG
=
8
,
THD_WAIT_GROUP_COMMIT
=
9
,
THD_WAIT_LAST
=
10
THD_WAIT_SYNC
=
10
,
THD_WAIT_LAST
=
11
}
thd_wait_type
;
extern
struct
thd_wait_service_st
{
void
(
*
thd_wait_begin_func
)(
void
*
,
thd_wait_type
);
...
...
include/mysql/service_thd_wait.h
View file @
c0854c3e
...
...
@@ -73,7 +73,8 @@ typedef enum _thd_wait_type_e {
THD_WAIT_USER_LOCK
=
7
,
THD_WAIT_BINLOG
=
8
,
THD_WAIT_GROUP_COMMIT
=
9
,
THD_WAIT_LAST
=
10
THD_WAIT_SYNC
=
10
,
THD_WAIT_LAST
=
11
}
thd_wait_type
;
extern
struct
thd_wait_service_st
{
...
...
mysys/my_sync.c
View file @
c0854c3e
...
...
@@ -17,6 +17,16 @@
#include "mysys_err.h"
#include <errno.h>
static
void
(
*
before_sync_wait
)(
void
)
=
0
;
static
void
(
*
after_sync_wait
)(
void
)
=
0
;
void
thr_set_sync_wait_callback
(
void
(
*
before_wait
)(
void
),
void
(
*
after_wait
)(
void
))
{
before_sync_wait
=
before_wait
;
after_sync_wait
=
after_wait
;
}
/*
Sync data in file to disk
...
...
@@ -48,6 +58,8 @@ int my_sync(File fd, myf my_flags)
do
{
if
(
before_sync_wait
)
(
*
before_sync_wait
)();
#if defined(F_FULLFSYNC)
/*
In Mac OS X >= 10.3 this call is safer than fsync() (it forces the
...
...
@@ -75,6 +87,8 @@ int my_sync(File fd, myf my_flags)
int
er
=
errno
;
if
(
!
(
my_errno
=
er
))
my_errno
=
-
1
;
/* Unknown error */
if
(
after_sync_wait
)
(
*
after_sync_wait
)();
if
((
my_flags
&
MY_IGNORE_BADFD
)
&&
(
er
==
EBADF
||
er
==
EINVAL
||
er
==
EROFS
))
{
...
...
@@ -84,6 +98,11 @@ int my_sync(File fd, myf my_flags)
else
if
(
my_flags
&
MY_WME
)
my_error
(
EE_SYNC
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
my_filename
(
fd
),
my_errno
);
}
else
{
if
(
after_sync_wait
)
(
*
after_sync_wait
)();
}
DBUG_RETURN
(
res
);
}
/* my_sync */
...
...
sql/scheduler.cc
View file @
c0854c3e
...
...
@@ -80,12 +80,21 @@ scheduler_functions *thread_scheduler= NULL;
*/
/**@{*/
static
void
scheduler_wait_begin
(
void
)
{
static
void
scheduler_wait_
lock_
begin
(
void
)
{
MYSQL_CALLBACK
(
thread_scheduler
,
thd_wait_begin
,
(
current_thd
,
THD_WAIT_TABLE_LOCK
));
}
static
void
scheduler_wait_end
(
void
)
{
static
void
scheduler_wait_lock_end
(
void
)
{
MYSQL_CALLBACK
(
thread_scheduler
,
thd_wait_end
,
(
current_thd
));
}
static
void
scheduler_wait_sync_begin
(
void
)
{
MYSQL_CALLBACK
(
thread_scheduler
,
thd_wait_begin
,
(
current_thd
,
THD_WAIT_TABLE_LOCK
));
}
static
void
scheduler_wait_sync_end
(
void
)
{
MYSQL_CALLBACK
(
thread_scheduler
,
thd_wait_end
,
(
current_thd
));
}
/**@}*/
...
...
@@ -98,7 +107,10 @@ static void scheduler_wait_end(void) {
mysqld.cc, so this init function will always be called.
*/
static
void
scheduler_init
()
{
thr_set_lock_wait_callback
(
scheduler_wait_begin
,
scheduler_wait_end
);
thr_set_lock_wait_callback
(
scheduler_wait_lock_begin
,
scheduler_wait_lock_end
);
thr_set_sync_wait_callback
(
scheduler_wait_sync_begin
,
scheduler_wait_sync_end
);
}
/*
...
...
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