@@ -2867,7 +2867,7 @@ func (r *Replica) RefreshLeaderlessWatcherUnavailableStateForTesting(
2867
2867
// manner via the replica scanner, see #130199. This functionality is disabled
2868
2868
// by default for this reason.
2869
2869
func (r * Replica ) maybeEnqueueProblemRange (
2870
- ctx context.Context , now time.Time , leaseValid , isLeaseholder bool , shouldLog bool ,
2870
+ ctx context.Context , now time.Time , leaseValid , isLeaseholder bool , maybeLog bool ,
2871
2871
) {
2872
2872
2873
2873
// The method expects the caller to provide whether the lease is valid and
@@ -2908,44 +2908,28 @@ func (r *Replica) maybeEnqueueProblemRange(
2908
2908
r .store .metrics .DecommissioningNudgerEnqueue .Inc (1 )
2909
2909
// TODO(dodeca12): Figure out a better way to track the
2910
2910
// decommissioning nudger enqueue failures/errors.
2911
+ level := log .Level (2 )
2912
+ if maybeLog {
2913
+ level = log .Level (0 )
2914
+ }
2911
2915
r .store .replicateQueue .AddAsyncWithCallback (ctx , r ,
2912
2916
allocatorimpl .AllocatorReplaceDecommissioningVoter .Priority (), processCallback {
2913
2917
onEnqueueResult : func (indexOnHeap int , err error ) {
2914
- if shouldLog {
2915
- if err != nil {
2916
- log .KvDistribution .Infof (ctx ,
2917
- "decommissioning nudger failed to enqueue range %v due to %v" , r .Desc (), err )
2918
- } else {
2919
- log .KvDistribution .Infof (ctx ,
2920
- "decommissioning nudger successfully enqueued range %v at index %d" , r .Desc (), indexOnHeap )
2921
- }
2918
+ if err != nil {
2919
+ log .KvDistribution .VInfof (ctx , level ,
2920
+ "decommissioning nudger failed to enqueue range %v due to %v" , r .Desc (), err )
2922
2921
} else {
2923
- if err != nil {
2924
- log .KvDistribution .VInfof (ctx , 2 ,
2925
- "decommissioning nudger failed to enqueue range %v due to %v" , r .Desc (), err )
2926
- } else {
2927
- log .KvDistribution .VInfof (ctx , 2 ,
2928
- "decommissioning nudger successfully enqueued range %v at index %d" , r .Desc (), indexOnHeap )
2929
- }
2922
+ log .KvDistribution .VInfof (ctx , level ,
2923
+ "decommissioning nudger successfully enqueued range %v at index %d" , r .Desc (), indexOnHeap )
2930
2924
}
2931
2925
},
2932
2926
onProcessResult : func (err error ) {
2933
- if shouldLog {
2934
- if err != nil {
2935
- log .KvDistribution .Infof (ctx ,
2936
- "decommissioning nudger failed to process range %v due to %v" , r .Desc (), err )
2937
- } else {
2938
- log .KvDistribution .Infof (ctx ,
2939
- "decommissioning nudger successfully processed replica %s" , r .Desc ())
2940
- }
2927
+ if err != nil {
2928
+ log .KvDistribution .VInfof (ctx , level ,
2929
+ "decommissioning nudger failed to process range %v due to %v" , r .Desc (), err )
2941
2930
} else {
2942
- if err != nil {
2943
- log .KvDistribution .VInfof (ctx , 2 ,
2944
- "decommissioning nudger failed to process range %v due to %v" , r .Desc (), err )
2945
- } else {
2946
- log .KvDistribution .VInfof (ctx , 2 ,
2947
- "decommissioning nudger successfully processed replica %s" , r .Desc ())
2948
- }
2931
+ log .KvDistribution .VInfof (ctx , level ,
2932
+ "decommissioning nudger successfully processed replica %s" , r .Desc ())
2949
2933
}
2950
2934
},
2951
2935
})
0 commit comments