From fa8a6c0e94405f03345293f43a6b3ad74c734750 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 10 Feb 2022 08:34:30 +0200 Subject: [PATCH] Reduce logging of walkeeper normal operations. It was printing a lot of stuff to the log with INFO level, for routine things like receiving or sending messages. Reduce the noise. The amount of logging was excessive, and it was also consuming a fair amount of CPU (about 20% of safekeeper's CPU usage in a little test I ran). --- walkeeper/src/safekeeper.rs | 2 +- walkeeper/src/send_wal.rs | 4 ++-- zenith_utils/src/pq_proto.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/walkeeper/src/safekeeper.rs b/walkeeper/src/safekeeper.rs index a3d21c239f..ff57aa1cda 100644 --- a/walkeeper/src/safekeeper.rs +++ b/walkeeper/src/safekeeper.rs @@ -774,7 +774,7 @@ where } let resp = self.append_response(); - info!( + trace!( "processed AppendRequest of len {}, end_lsn={:?}, commit_lsn={:?}, truncate_lsn={:?}, resp {:?}", msg.wal_data.len(), msg.h.end_lsn, diff --git a/walkeeper/src/send_wal.rs b/walkeeper/src/send_wal.rs index b219455c69..a8b4e33ad2 100644 --- a/walkeeper/src/send_wal.rs +++ b/walkeeper/src/send_wal.rs @@ -167,7 +167,7 @@ impl ReplicationConn { let buf = Bytes::copy_from_slice(&m[9..]); let reply = ZenithFeedback::parse(buf); - info!("ZenithFeedback is {:?}", reply); + trace!("ZenithFeedback is {:?}", reply); // Only pageserver sends ZenithFeedback, so set the flag. // This replica is the source of information to resend to compute. state.zenith_feedback = Some(reply); @@ -385,7 +385,7 @@ impl ReplicationConn { start_pos += send_size as u64; - info!("sent WAL up to {}", start_pos); + trace!("sent WAL up to {}", start_pos); // Decide whether to reuse this file. If we don't set wal_file here // a new file will be opened next time. diff --git a/zenith_utils/src/pq_proto.rs b/zenith_utils/src/pq_proto.rs index 694a990448..89be25cb54 100644 --- a/zenith_utils/src/pq_proto.rs +++ b/zenith_utils/src/pq_proto.rs @@ -13,7 +13,7 @@ use std::io::{self, Cursor}; use std::str; use std::time::{Duration, SystemTime}; use tokio::io::AsyncReadExt; -use tracing::info; +use tracing::{trace, warn}; pub type Oid = u32; pub type SystemId = u64; @@ -956,7 +956,7 @@ impl ZenithFeedback { } _ => { let len = buf.get_i32(); - info!( + warn!( "ZenithFeedback parse. unknown key {} of len {}. Skip it.", key, len ); @@ -964,7 +964,7 @@ impl ZenithFeedback { } } } - info!("ZenithFeedback parsed is {:?}", zf); + trace!("ZenithFeedback parsed is {:?}", zf); zf } }