From 5160e67ded1e6ffc89d4c33d6130ff02ff145005 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 4 Apr 2026 02:14:35 +0000 Subject: [PATCH] Downgrade SQL Server AOAG failover logs from error to warn During SQL Server Always On Availability Group failovers, two conditions can occur that are expected and recoverable but were previously logged at error level, triggering unnecessary Sentry alerts: 1. Uninitialized LSN in CDC stream - when a capture instance temporarily has no LSN after failover 2. Upstream LSN going backwards - when the new primary reports a lower max LSN than previously seen Both cases are already handled gracefully (skip and continue), so downgrade from error/soft_panic_or_log to warn level. Fixes MaterializeInc/database-issues#9986 https://claude.ai/code/session_015rRQ5puqtBufPEQ5RoUtjt --- src/sql-server-util/src/cdc.rs | 2 +- src/storage/src/source/sql_server/progress.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql-server-util/src/cdc.rs b/src/sql-server-util/src/cdc.rs index c48f0c5f92480..ca313b783cfc2 100644 --- a/src/sql-server-util/src/cdc.rs +++ b/src/sql-server-util/src/cdc.rs @@ -282,7 +282,7 @@ impl<'a, M: SqlServerCdcMetrics> CdcStream<'a, M> { if db_max_lsn > curr_lsn { for (instance, instance_lsn) in &self.capture_instances { let Some(instance_lsn) = instance_lsn.as_ref() else { - tracing::error!(?instance, "found uninitialized LSN!"); + tracing::warn!(?instance, "found uninitialized LSN!"); continue; }; diff --git a/src/storage/src/source/sql_server/progress.rs b/src/storage/src/source/sql_server/progress.rs index a1db4508c528f..6bd083e80a652 100644 --- a/src/storage/src/source/sql_server/progress.rs +++ b/src/storage/src/source/sql_server/progress.rs @@ -150,7 +150,7 @@ pub(crate) fn render>( Some(prev) => prev, }; if known_lsn < prev_known_lsn { - mz_ore::soft_panic_or_log!( + tracing::warn!( "upstream SQL Server went backwards \ in time, current LSN: {known_lsn}, \ last known {prev_known_lsn}",