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

Function stopAppendOnly

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

Called when the user switches from "appendonly yes" to "appendonly no" * at runtime using the CONFIG command. */

Source from the content-addressed store, hash-verified

234/* Called when the user switches from "appendonly yes" to "appendonly no"
235 * at runtime using the CONFIG command. */
236void stopAppendOnly(void) {
237 serverAssert(server.aof_state != AOF_OFF);
238 flushAppendOnlyFile(1);
239 if (redis_fsync(server.aof_fd) == -1) {
240 serverLog(LL_WARNING,"Fail to fsync the AOF file: %s",strerror(errno));
241 } else {
242 server.aof_fsync_offset = server.aof_current_size;
243 server.aof_last_fsync = server.unixtime;
244 }
245 close(server.aof_fd);
246
247 server.aof_fd = -1;
248 server.aof_selected_db = -1;
249 server.aof_state = AOF_OFF;
250 server.aof_rewrite_scheduled = 0;
251 killAppendOnlyChild();
252 sdsfree(server.aof_buf);
253 server.aof_buf = sdsempty();
254}
255
256/* Called when the user switches from "appendonly no" to "appendonly yes"
257 * at runtime using the CONFIG command. */

Callers 3

updateAppendonlyFunction · 0.85
readSyncBulkPayloadFunction · 0.85
RM_ResetDatasetFunction · 0.85

Calls 5

flushAppendOnlyFileFunction · 0.85
killAppendOnlyChildFunction · 0.85
sdsfreeFunction · 0.85
sdsemptyFunction · 0.85
closeFunction · 0.70

Tested by

no test coverage detected