From 9d4c726a116ae7733cf4d356573c719505399197 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:21:10 +0530 Subject: [PATCH] Enable verbose logging for some more RPCs (#14770) Signed-off-by: Manan Gupta --- go/vt/vttablet/grpctmserver/server.go | 4 ++-- go/vt/vttablet/tmrpctest/test_tm_rpc.go | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index d0fe5a2cbe1..d7d70194cec 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -300,7 +300,7 @@ func (s *server) PrimaryPosition(ctx context.Context, request *tabletmanagerdata } func (s *server) WaitForPosition(ctx context.Context, request *tabletmanagerdatapb.WaitForPositionRequest) (response *tabletmanagerdatapb.WaitForPositionResponse, err error) { - defer s.tm.HandleRPCPanic(ctx, "WaitForPosition", request, response, false /*verbose*/, &err) + defer s.tm.HandleRPCPanic(ctx, "WaitForPosition", request, response, true /*verbose*/, &err) ctx = callinfo.GRPCCallInfo(ctx) response = &tabletmanagerdatapb.WaitForPositionResponse{} return response, s.tm.WaitForPosition(ctx, request.Position) @@ -426,7 +426,7 @@ func (s *server) InitPrimary(ctx context.Context, request *tabletmanagerdatapb.I } func (s *server) PopulateReparentJournal(ctx context.Context, request *tabletmanagerdatapb.PopulateReparentJournalRequest) (response *tabletmanagerdatapb.PopulateReparentJournalResponse, err error) { - defer s.tm.HandleRPCPanic(ctx, "PopulateReparentJournal", request, response, false /*verbose*/, &err) + defer s.tm.HandleRPCPanic(ctx, "PopulateReparentJournal", request, response, true /*verbose*/, &err) ctx = callinfo.GRPCCallInfo(ctx) response = &tabletmanagerdatapb.PopulateReparentJournalResponse{} return response, s.tm.PopulateReparentJournal(ctx, request.TimeCreatedNs, request.ActionName, request.PrimaryAlias, request.ReplicationPosition) diff --git a/go/vt/vttablet/tmrpctest/test_tm_rpc.go b/go/vt/vttablet/tmrpctest/test_tm_rpc.go index 2393a3fb2f0..94e54f1da25 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -1039,7 +1039,12 @@ func tmRPCTestPopulateReparentJournal(ctx context.Context, t *testing.T, client func tmRPCTestPopulateReparentJournalPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) { err := client.PopulateReparentJournal(ctx, tablet, testTimeCreatedNS, testActionName, testPrimaryAlias, testReplicationPosition) - expectHandleRPCPanic(t, "PopulateReparentJournal", false /*verbose*/, err) + expectHandleRPCPanic(t, "PopulateReparentJournal", true /*verbose*/, err) +} + +func tmRPCTestWaitForPositionPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) { + err := client.WaitForPosition(ctx, tablet, testReplicationPosition) + expectHandleRPCPanic(t, "WaitForPosition", true /*verbose*/, err) } var testInitReplicaCalled = false @@ -1447,6 +1452,7 @@ func Run(t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.T tmRPCTestResetReplicationPanic(ctx, t, client, tablet) tmRPCTestInitPrimaryPanic(ctx, t, client, tablet) tmRPCTestPopulateReparentJournalPanic(ctx, t, client, tablet) + tmRPCTestWaitForPositionPanic(ctx, t, client, tablet) tmRPCTestDemotePrimaryPanic(ctx, t, client, tablet) tmRPCTestUndoDemotePrimaryPanic(ctx, t, client, tablet) tmRPCTestSetReplicationSourcePanic(ctx, t, client, tablet)