A background saving child (BGSAVE) terminated its work. Handle this. * This function covers the case of actual BGSAVEs. */
| 3592 | /* A background saving child (BGSAVE) terminated its work. Handle this. |
| 3593 | * This function covers the case of actual BGSAVEs. */ |
| 3594 | static void backgroundSaveDoneHandlerDisk(int exitcode, bool fCancelled) { |
| 3595 | if (!fCancelled && exitcode == 0) { |
| 3596 | serverLog(LL_NOTICE, |
| 3597 | "Background saving terminated with success"); |
| 3598 | g_pserver->dirty = g_pserver->dirty - g_pserver->dirty_before_bgsave; |
| 3599 | g_pserver->lastsave = time(NULL); |
| 3600 | g_pserver->lastbgsave_status = C_OK; |
| 3601 | latencyEndMonitor(g_pserver->rdb_save_latency); |
| 3602 | latencyAddSampleIfNeeded("rdb-save",g_pserver->rdb_save_latency); |
| 3603 | } else if (!fCancelled && exitcode != 0) { |
| 3604 | serverLog(LL_WARNING, "Background saving error"); |
| 3605 | g_pserver->lastbgsave_status = C_ERR; |
| 3606 | } else { |
| 3607 | mstime_t latency; |
| 3608 | |
| 3609 | serverLog(LL_WARNING, |
| 3610 | "Background saving cancelled"); |
| 3611 | latencyStartMonitor(latency); |
| 3612 | rdbRemoveTempFile(g_pserver->rdbThreadVars.tmpfileNum, 0); |
| 3613 | latencyEndMonitor(latency); |
| 3614 | latencyAddSampleIfNeeded("rdb-unlink-temp-file",latency); |
| 3615 | } |
| 3616 | } |
| 3617 | |
| 3618 | /* A background saving child (BGSAVE) terminated its work. Handle this. |
| 3619 | * This function covers the case of RDB -> Slaves socket transfers for |
no test coverage detected