From 5b18a8cf68e446ae0f71ad01928592747402638f Mon Sep 17 00:00:00 2001 From: adityamaru Date: Mon, 27 Nov 2023 15:29:11 +0000 Subject: [PATCH] server: reduce log spam on canceled batch requests In #102793 we added server side logging for batch requests that would encounted a context cancelation or timeout. This was primarily motivated by the need to understand why export requests sent during a backup were spending most of their time and timing out. This unintentionally added log spam for other kinds of internal requests such as HeartbeatTxn, QueryTxn, and EndTxn requests. This change limits this log line to only be printed when the corresponding request is an export request. Fixes: None Release note: None --- pkg/server/node.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/server/node.go b/pkg/server/node.go index 3d73d25f6570..19c586eab84f 100644 --- a/pkg/server/node.go +++ b/pkg/server/node.go @@ -1361,7 +1361,10 @@ func (n *Node) batchInternal( // replica to notice the cancellation and return a response. For this reason, // we log the server-side trace of the cancelled request to help debug what // the request was doing at the time it noticed the cancellation. - if pErr != nil && ctx.Err() != nil { + // + // To avoid log spam for now we only log the trace if the request was an + // ExportRequest. + if pErr != nil && ctx.Err() != nil && args.IsSingleExportRequest() { if sp := tracing.SpanFromContext(ctx); sp != nil && !sp.IsNoop() { recording := sp.GetConfiguredRecording() if recording.Len() != 0 {