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

Function aofUpdateCurrentSize

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

Update the server.aof_current_size field explicitly using stat(2) * to check the size of the file. This is useful after a rewrite or after * a restart, normally the size is updated just adding the write length * to the current length, that is much faster. */

Source from the content-addressed store, hash-verified

1832 * a restart, normally the size is updated just adding the write length
1833 * to the current length, that is much faster. */
1834void aofUpdateCurrentSize(void) {
1835 struct redis_stat sb;
1836 mstime_t latency;
1837
1838 latencyStartMonitor(latency);
1839 if (redis_fstat(server.aof_fd,&sb) == -1) {
1840 serverLog(LL_WARNING,"Unable to obtain the AOF file length. stat: %s",
1841 strerror(errno));
1842 } else {
1843 server.aof_current_size = sb.st_size;
1844 }
1845 latencyEndMonitor(latency);
1846 latencyAddSampleIfNeeded("aof-fstat",latency);
1847}
1848
1849/* A background append only file rewriting (BGREWRITEAOF) terminated its work.
1850 * Handle this. */

Callers 2

loadAppendOnlyFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected