redisLog(REDIS_WARNING,"Used tried to switch on AOF via CONFIG, but I can't open the AOF file: %s",strerror(errno));
returnREDIS_ERR;
}
if(rewriteAppendOnlyFileBackground()==REDIS_ERR){
server.appendonly=0;
close(server.appendfd);
redisLog(REDIS_WARNING,"Used tried to switch on AOF via CONFIG, I can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.",strerror(errno));
returnREDIS_ERR;
}
returnREDIS_OK;
}
/* Write the append only file buffer on disk.
*
* Since we are required to write the AOF before replying to the client,
...
...
@@ -8598,24 +8692,26 @@ static int rewriteAppendOnlyFile(char *filename) {
/* Iterate this DB writing every entry */
while((de=dictNext(di))!=NULL){
robj*key,*o;
sdskeystr=dictGetEntryKey(de);
robjkey,*o;
time_texpiretime;
intswapped;
key=dictGetEntryKey(de);
keystr=dictGetEntryKey(de);
o=dictGetEntryVal(de);
initStaticStringObject(key,keystr);
/* If the value for this key is swapped, load a preview in memory.
* We use a "swapped" flag to remember if we need to free the
* value object instead to just increment the ref count anyway
* in order to avoid copy-on-write of pages if we are forked() */
redisLog(REDIS_WARNING,"Used tried to switch on AOF via CONFIG, but I can't open the AOF file: %s",strerror(errno));
returnREDIS_ERR;
}
if(rewriteAppendOnlyFileBackground()==REDIS_ERR){
server.appendonly=0;
close(server.appendfd);
redisLog(REDIS_WARNING,"Used tried to switch on AOF via CONFIG, I can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.",strerror(errno));
returnREDIS_ERR;
}
returnREDIS_OK;
vp->type=REDIS_VMPOINTER;
vp->storage=REDIS_VM_SWAPPED;
vp->vtype=vtype;
returnvp;
}
/* =================== Virtual Memory - Blocking Side ====================== */