Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
10ce1276
Commit
10ce1276
authored
May 02, 2010
by
antirez
Browse files
On Linux now fdatasync() is used insetad of fsync() in order to flush the AOF file kernel buffers
parent
7aaaad50
Changes
3
Hide whitespace changes
Inline
Side-by-side
config.h
View file @
10ce1276
...
...
@@ -35,4 +35,11 @@
#define HAVE_KQUEUE 1
#endif
/* define aof_fsync to fdatasync() in Linux and fsync() for all the rest */
#ifdef __linux__
#define aof_fsync fdatasync
#else
#define aof_fsync fsync
#endif
#endif
fmacros.h
View file @
10ce1276
...
...
@@ -2,7 +2,7 @@
#define _REDIS_FMACRO_H
#define _BSD_SOURCE
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE
700
#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
...
...
redis.c
View file @
10ce1276
...
...
@@ -37,8 +37,6 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
#define __USE_POSIX199309
#define __USE_UNIX98
#include <signal.h>
#ifdef HAVE_BACKTRACE
...
...
@@ -4049,7 +4047,7 @@ static void echoCommand(redisClient *c) {
static
void
setGenericCommand
(
redisClient
*
c
,
int
nx
,
robj
*
key
,
robj
*
val
,
robj
*
expire
)
{
int
retval
;
long
seconds
;
long
seconds
=
0
;
/* initialized to avoid an harmness warning */
if
(
expire
)
{
if
(
getLongFromObjectOrReply
(
c
,
expire
,
&
seconds
,
NULL
)
!=
REDIS_OK
)
...
...
@@ -8090,7 +8088,9 @@ static void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv
(
server
.
appendfsync
==
APPENDFSYNC_EVERYSEC
&&
now
-
server
.
lastfsync
>
1
))
{
fsync
(
server
.
appendfd
);
/* Let's try to get this data on the disk */
/* aof_fsync is defined as fdatasync() for Linux in order to avoid
* flushing metadata. */
aof_fsync
(
server
.
appendfd
);
/* Let's try to get this data on the disk */
server
.
lastfsync
=
now
;
}
}
...
...
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