Skip to content

Commit

Permalink
database: Differentiate causes of failure for the sake of the log
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Jun 24, 2024
1 parent 46381e8 commit 1650a68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion database.pike
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,10 @@ __async__ void replication_watchdog() {
live[0]->confirmed_flush_lsn,
repl[0]->received_lsn, repl[0]->latest_end_lsn,
);
//I'm not sure what causes the LSN to be null, but I suspect it means replication isn't happening.
if (!repl[0]->latest_end_lsn) query_rw("notify \"scream.emergency\", 'REPL WDOG: LSN is null!!'");
//If the local LSN hasn't advanced in an entire minute, scream.
if (repl[0]->latest_end_lsn == last_desync_lsn) query_rw("notify \"scream.emergency\"");
if (repl[0]->latest_end_lsn == last_desync_lsn) query_rw("notify \"scream.emergency\", 'REPL WDOG: LSN has not advanced'");
last_desync_lsn = repl[0]->latest_end_lsn;
}

Expand Down

0 comments on commit 1650a68

Please sign in to comment.