From 1650a68d3e80ecd408ac4bcfe39bad9b0d11171b Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Tue, 25 Jun 2024 09:34:22 +1000 Subject: [PATCH] database: Differentiate causes of failure for the sake of the log --- database.pike | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database.pike b/database.pike index 91659afe..d2e97a9e 100644 --- a/database.pike +++ b/database.pike @@ -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; }