MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / bgrewriteaofCommand

Function bgrewriteaofCommand

src/aof.cpp:1929–1941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1927}
1928
1929void bgrewriteaofCommand(client *c) {
1930 if (g_pserver->child_type == CHILD_TYPE_AOF) {
1931 addReplyError(c,"Background append only file rewriting already in progress");
1932 } else if (hasActiveChildProcessOrBGSave()) {
1933 g_pserver->aof_rewrite_scheduled = 1;
1934 addReplyStatus(c,"Background append only file rewriting scheduled");
1935 } else if (rewriteAppendOnlyFileBackground() == C_OK) {
1936 addReplyStatus(c,"Background append only file rewriting started");
1937 } else {
1938 addReplyError(c,"Can't execute an AOF background rewriting. "
1939 "Please check the server logs for more information.");
1940 }
1941}
1942
1943void aofRemoveTempFile(pid_t childpid) {
1944 char tmpfile[256];

Callers

nothing calls this directly

Calls 4

addReplyErrorFunction · 0.85
addReplyStatusFunction · 0.85

Tested by

no test coverage detected