mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
added config.h for #ifdef business isolation, added fstat64 for Mac OS X
This commit is contained in:
parent
ec93bba353
commit
dde65f3f3c
2
TODO
2
TODO
@ -1,12 +1,10 @@
|
||||
BEFORE REDIS 1.0.0-rc1
|
||||
|
||||
* Add number of keys for every DB in INFO
|
||||
* maxmemory support
|
||||
* Resize the expires and Sets hash tables if needed as well? For Sets the right moment to check for this is probably in SREM
|
||||
* What happens if the saving child gets killed or segfaults instead of ending normally? Handle this.
|
||||
* check 'server.dirty' everywere. Make it proprotional to the number of objects modified.
|
||||
* Shutdown must kill other background savings before to start saving. Otherwise the DB can get replaced by the child that rename(2) after the parent for some reason. Child should trap the signal and remove the temp file name.
|
||||
* Objects sharing configuration, add the directive `objectsharingpool <size>`
|
||||
* Make sure to convert all the fstat() calls to 64bit versions.
|
||||
* Cover most of the source code with test-redis.tcl
|
||||
|
||||
|
20
config.h
Normal file
20
config.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
/* malloc_size() */
|
||||
#ifdef __APPLE__
|
||||
#include <malloc/malloc.h>
|
||||
#define HAVE_MALLOC_SIZE
|
||||
#define redis_malloc_size(p) malloc_size(p)
|
||||
#endif
|
||||
|
||||
/* define redis_fstat to fstat or fstat64() */
|
||||
#ifdef __APPLE__
|
||||
#define redis_fstat fstat64
|
||||
#define redis_stat stat64
|
||||
#else
|
||||
#define redis_fstat fstat
|
||||
#define redis_stat stat
|
||||
#endif
|
||||
|
||||
#endif
|
6
redis.c
6
redis.c
@ -60,6 +60,8 @@
|
||||
#include "lzf.h" /* LZF compression library */
|
||||
#include "pqsort.h" /* Partial qsort for SORT+LIMIT */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/* Error codes */
|
||||
#define REDIS_OK 0
|
||||
#define REDIS_ERR -1
|
||||
@ -3866,7 +3868,7 @@ static void updateSalvesWaitingBgsave(int bgsaveerr) {
|
||||
startbgsave = 1;
|
||||
slave->replstate = REDIS_REPL_WAIT_BGSAVE_END;
|
||||
} else if (slave->replstate == REDIS_REPL_WAIT_BGSAVE_END) {
|
||||
struct stat buf;
|
||||
struct redis_stat buf;
|
||||
|
||||
if (bgsaveerr != REDIS_OK) {
|
||||
freeClient(slave);
|
||||
@ -3874,7 +3876,7 @@ static void updateSalvesWaitingBgsave(int bgsaveerr) {
|
||||
continue;
|
||||
}
|
||||
if ((slave->repldbfd = open(server.dbfilename,O_RDONLY)) == -1 ||
|
||||
fstat(slave->repldbfd,&buf) == -1) {
|
||||
redis_fstat(slave->repldbfd,&buf) == -1) {
|
||||
freeClient(slave);
|
||||
redisLog(REDIS_WARNING,"SYNC failed. Can't open/stat DB after BGSAVE: %s", strerror(errno));
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user