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

Function aofReadDiffFromParent

src/aof.cpp:1538–1548  ·  view source on GitHub ↗

This function is called by the child rewriting the AOF file to read * the difference accumulated from the parent into a buffer, that is * concatenated at the end of the rewrite. */

Source from the content-addressed store, hash-verified

1536 * the difference accumulated from the parent into a buffer, that is
1537 * concatenated at the end of the rewrite. */
1538ssize_t aofReadDiffFromParent(void) {
1539 char buf[65536]; /* Default pipe buffer size on most Linux systems. */
1540 ssize_t nread, total = 0;
1541
1542 while ((nread =
1543 read(g_pserver->aof_pipe_read_data_from_parent,buf,sizeof(buf))) > 0) {
1544 g_pserver->aof_child_diff = sdscatlen(g_pserver->aof_child_diff,buf,nread);
1545 total += nread;
1546 }
1547 return total;
1548}
1549
1550int rewriteAppendOnlyFileRio(rio *aof) {
1551 size_t processed = 0;

Callers 3

saveKeyFunction · 0.85
rewriteAppendOnlyFileRioFunction · 0.85
rewriteAppendOnlyFileFunction · 0.85

Calls 1

sdscatlenFunction · 0.85

Tested by

no test coverage detected