MCPcopy Create free account
hub / github.com/F-Stack/f-stack / killAppendOnlyChild

Function killAppendOnlyChild

app/redis-6.2.6/src/aof.c:215–232  ·  view source on GitHub ↗

Kills an AOFRW child process if exists */

Source from the content-addressed store, hash-verified

213
214/* Kills an AOFRW child process if exists */
215void killAppendOnlyChild(void) {
216 int statloc;
217 /* No AOFRW child? return. */
218 if (server.child_type != CHILD_TYPE_AOF) return;
219 /* Kill AOFRW child, wait for child exit. */
220 serverLog(LL_NOTICE,"Killing running AOF rewrite child: %ld",
221 (long) server.child_pid);
222 if (kill(server.child_pid,SIGUSR1) != -1) {
223 while(waitpid(-1, &statloc, 0) != server.child_pid);
224 }
225 /* Reset the buffer accumulating changes while the child saves. */
226 aofRewriteBufferReset();
227 aofRemoveTempFile(server.child_pid);
228 resetChildState();
229 server.aof_rewrite_time_start = -1;
230 /* Close pipes used for IPC between the two processes. */
231 aofClosePipes();
232}
233
234/* Called when the user switches from "appendonly yes" to "appendonly no"
235 * at runtime using the CONFIG command. */

Callers 3

prepareForShutdownFunction · 0.85
stopAppendOnlyFunction · 0.85
startAppendOnlyFunction · 0.85

Calls 5

killFunction · 0.85
aofRewriteBufferResetFunction · 0.85
aofRemoveTempFileFunction · 0.85
resetChildStateFunction · 0.85
aofClosePipesFunction · 0.85

Tested by

no test coverage detected