Home > OS >  When using redis in dump. RDB file with temp directory appeared - 1976. The RDB file how to return a
When using redis in dump. RDB file with temp directory appeared - 1976. The RDB file how to return a

Time:09-25

When using redis in dump. RDB with temp directory generated + pid. The RDB file, don't know how to, nor colleagues created in the code, I asked him what is generated when he don't know, because can't test restart will be generated, so more troublesome, the younger brother is also use redis soon, don't understand the question is how to return a responsibility, hope to help solve, Daniel

CodePudding user response:

CodePudding user response:

Check the specific what process, trashy word need not tube, or deleted

CodePudding user response:

Is useless, but I don't know why have this file, the Internet can't find similar problems, a long time but you know, the programmer is not what they expected in all feel uncomfortable!

CodePudding user response:

 
/* the Save the DB on disk. Return C_ERR on error, C_OK on success. */
Int rdbSave (char * filename) {
Char tmpfile [256].
Char CWD [MAXPATHLEN];/* Current working dir path for error messages. */
FILE *fp;
Rio RDB.
Int the error=0;

Snprintf (tmpfile, 256, "temp - % d.r db", (int) getpid ());
Fp=fopen (tmpfile, "w");
if (! Fp) {
Char * CWDP=getcwd (CWD, MAXPATHLEN);
ServerLog (LL_WARNING,
"Failed opening the RDB file % s) (in server root dir % s"
"For saving: % s",
The filename,
CWDP? CWDP: "unknown",
The strerror (errno));
Return C_ERR;
}

RioInitWithFile (& amp; RDB, fp);
If (rdbSaveRio (& amp; RDB, & amp; The error)=={C_ERR)
Errno=error;
Goto werr;
}

CodePudding user response:

reference 4 floor N33_ soot response:
 
/* the Save the DB on disk. Return C_ERR on error, C_OK on success. */
Int rdbSave (char * filename) {
Char tmpfile [256].
Char CWD [MAXPATHLEN];/* Current working dir path for error messages. */
FILE *fp;
Rio RDB.
Int the error=0;

Snprintf (tmpfile, 256, "temp - % d.r db", (int) getpid ());
Fp=fopen (tmpfile, "w");
if (! Fp) {
Char * CWDP=getcwd (CWD, MAXPATHLEN);
ServerLog (LL_WARNING,
"Failed opening the RDB file % s) (in server root dir % s"
"For saving: % s",
The filename,
CWDP? CWDP: "unknown",
The strerror (errno));
Return C_ERR;
}

RioInitWithFile (& amp; RDB, fp);
If (rdbSaveRio (& amp; RDB, & amp; The error)=={C_ERR)
Errno=error;
Goto werr;
}
what do you mean this is the mechanism of redis itself?

CodePudding user response:

Hello, I have seen this situation, my guess is that: when the trigger RDB redis persistence, if redis data in the memory is too big, can temporarily stored in the temp - pid. RDB file, and then from the temp - pid. RDB file copy to your RDB redis persistence file;
  • Related