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. */
| 1832 | * a restart, normally the size is updated just adding the write length |
| 1833 | * to the current length, that is much faster. */ |
| 1834 | void 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. */ |
no outgoing calls
no test coverage detected