Skip to content

Commit a036487

Browse files
Temporarily disable V3 response diff logging (#1607)
This commit disables the logging of V3 response diffs by commenting out the `log.Printf` statement in `internal/server/mirror.go`. The corresponding test in `internal/server/mirror_test.go` has also been updated to reflect this change. A `TODO` has been added to re-enable the logging and the test once structured logging is in place. Currently the diff takes up multiple log lines, and also it's not super useful since Spanner Graph isn't being updated regularly. We'll get an initial sample of diffs between today's release and the release that contains this PR, and then we can re-enable when (a) we can use structured logging for nicer diffs, and (b) Spanner Graph contents are more up-to-date. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent b625bc4 commit a036487

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

internal/server/mirror.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ func (s *Server) doMirror(
124124
}
125125

126126
if diff := cmp.Diff(originalResp, v3Resp, protocmp.Transform()); diff != "" {
127-
log.Printf("V3 mirrored call had a different response. V3 Method: %s, skipCache: %t, Diff: %s", rpcMethod, skipCache, diff)
127+
// TODO(hqpho): Re-enable once structured logging is ready.
128+
// log.Printf("V3 mirrored call had a different response. V3 Method: %s, skipCache: %t, Diff: %s", rpcMethod, skipCache, diff)
128129
metrics.RecordV3Mismatch(ctx)
129130
}
130131
}

internal/server/mirror_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,12 @@ func TestMaybeMirrorV3_ResponseMismatch(t *testing.T) {
205205
s.maybeMirrorV3(ctx, v2Req, v2Resp, 0, v3Call, &mirrorWg)
206206
mirrorWg.Wait()
207207

208-
logOutput := buf.String()
209-
if strings.Count(logOutput, "V3 mirrored call had a different response") != 2 {
210-
t.Errorf("log output should contain 2 diff warnings, but got: %q", logOutput)
211-
}
208+
// logOutput := buf.String()
209+
// TODO(hqpho): Re-enable this test once structured logging is ready and
210+
// the V3 response diff logging is re-enabled.
211+
// if strings.Count(logOutput, "V3 mirrored call had a different response") != 2 {
212+
// t.Errorf("log output should contain 2 diff warnings, but got: %q", logOutput)
213+
// }
212214

213215
var rm metricdata.ResourceMetrics
214216
if err := reader.Collect(context.Background(), &rm); err != nil {

0 commit comments

Comments
 (0)