Skip to content

Commit 89b6743

Browse files
committed
kv: migrate off log.Dev
These are the last calls to `log.Dev`. Closes #152584. Epic: none
1 parent 0fed78c commit 89b6743

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

pkg/kv/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestClientRetryNonTxn(t *testing.T) {
176176
}
177177
notify <- struct{}{}
178178
if err != nil {
179-
log.Dev.Errorf(context.Background(), "error on non-txn request: %s", err)
179+
log.KvExec.Errorf(context.Background(), "error on non-txn request: %s", err)
180180
}
181181
doneCall <- errors.Wrapf(
182182
err, "%d: expected success on non-txn call to %s",

pkg/kv/db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (s *CrossRangeTxnWrapperSender) Send(
218218
ctx context.Context, ba *kvpb.BatchRequest,
219219
) (*kvpb.BatchResponse, *kvpb.Error) {
220220
if ba.Txn != nil {
221-
log.Dev.Fatalf(ctx, "CrossRangeTxnWrapperSender can't handle transactional requests")
221+
log.KvExec.Fatalf(ctx, "CrossRangeTxnWrapperSender can't handle transactional requests")
222222
}
223223

224224
br, pErr := s.wrapped.Send(ctx, ba)
@@ -1167,7 +1167,7 @@ func (db *DB) sendUsingSender(
11671167
br, pErr := sender.Send(ctx, ba)
11681168
if pErr != nil {
11691169
if log.V(1) {
1170-
log.Dev.Infof(ctx, "failed batch: %s", pErr)
1170+
log.KvExec.Infof(ctx, "failed batch: %s", pErr)
11711171
}
11721172
return nil, pErr
11731173
}

pkg/kv/range_lookup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ func RangeLookup(
249249
if rc == kvpb.INCONSISTENT {
250250
return nil, nil, nil
251251
}
252-
log.Dev.Warningf(ctx, "range lookup of key %s found only non-matching ranges %v; retrying",
252+
log.KvExec.Warningf(ctx, "range lookup of key %s found only non-matching ranges %v; retrying",
253253
key, prefetchedRanges)
254254
}
255255

256256
ctxErr := ctx.Err()
257257
if ctxErr == nil {
258-
log.Dev.Fatalf(ctx, "retry loop broke before context expired")
258+
log.KvExec.Fatalf(ctx, "retry loop broke before context expired")
259259
}
260260
return nil, nil, ctxErr
261261
}
@@ -320,7 +320,7 @@ func lookupRangeFwdScan(
320320
RequestHeader: kvpb.RequestHeaderFromSpan(bounds.AsRawSpanWithNoLocals()),
321321
})
322322
if !TestingIsRangeLookup(ba) {
323-
log.Dev.Fatalf(ctx, "BatchRequest %v not detectable as RangeLookup", ba)
323+
log.KvExec.Fatalf(ctx, "BatchRequest %v not detectable as RangeLookup", ba)
324324
}
325325

326326
br, pErr := sender.Send(ctx, ba)
@@ -394,7 +394,7 @@ func lookupRangeRevScan(
394394
RequestHeader: kvpb.RequestHeaderFromSpan(revBounds.AsRawSpanWithNoLocals()),
395395
})
396396
if !TestingIsRangeLookup(ba) {
397-
log.Dev.Fatalf(ctx, "BatchRequest %v not detectable as RangeLookup", ba)
397+
log.KvExec.Fatalf(ctx, "BatchRequest %v not detectable as RangeLookup", ba)
398398
}
399399

400400
br, pErr := sender.Send(ctx, ba)

pkg/kv/txn.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (txn *Txn) TestingSetPriority(priority enginepb.TxnPriority) {
406406
// non-randomized, priority for the transaction.
407407
txn.mu.userPriority = roachpb.UserPriority(-priority)
408408
if err := txn.mu.sender.SetUserPriority(txn.mu.userPriority); err != nil {
409-
log.Dev.Fatalf(context.TODO(), "%+v", err)
409+
log.KvExec.Fatalf(context.TODO(), "%+v", err)
410410
}
411411
txn.mu.Unlock()
412412
}
@@ -1056,7 +1056,7 @@ func (txn *Txn) rollback(ctx context.Context) *kvpb.Error {
10561056
// already committed. We don't spam the logs with those.
10571057
log.VEventf(ctx, 2, "async rollback failed: %s", pErr)
10581058
} else {
1059-
log.Dev.Infof(ctx, "async rollback failed: %s", pErr)
1059+
log.KvExec.Infof(ctx, "async rollback failed: %s", pErr)
10601060
}
10611061
}
10621062
return nil
@@ -1172,7 +1172,7 @@ func (txn *Txn) exec(ctx context.Context, fn func(context.Context, *Txn) error)
11721172
// We sent transactional requests, so the TxnCoordSender was supposed to
11731173
// turn retryable errors into TransactionRetryWithProtoRefreshError. Note that this
11741174
// applies only in the case where this is the root transaction.
1175-
log.Dev.Fatalf(ctx, "unexpected UnhandledRetryableError at the txn.exec() level: %s", err)
1175+
log.KvExec.Fatalf(ctx, "unexpected UnhandledRetryableError at the txn.exec() level: %s", err)
11761176
}
11771177
} else if t := (*kvpb.TransactionRetryWithProtoRefreshError)(nil); errors.As(err, &t) {
11781178
if txn.ID() != t.PrevTxnID {
@@ -1219,13 +1219,13 @@ func (txn *Txn) exec(ctx context.Context, fn func(context.Context, *Txn) error)
12191219
txn.DebugName(), attempt, err, maxRetries, rollbackErr,
12201220
),
12211221
ErrAutoRetryLimitExhausted)
1222-
log.Dev.Warningf(ctx, "%v", err)
1222+
log.KvExec.Warningf(ctx, "%v", err)
12231223
break
12241224
}
12251225

12261226
const warnEvery = 10
12271227
if attempt%warnEvery == 0 {
1228-
log.Dev.Warningf(ctx, "have retried transaction: %s %d times, most recently because of the "+
1228+
log.KvExec.Warningf(ctx, "have retried transaction: %s %d times, most recently because of the "+
12291229
"retryable error: %s. Is the transaction stuck in a retry loop?", txn.DebugName(), attempt, err)
12301230
}
12311231

@@ -1395,7 +1395,7 @@ func (txn *Txn) Send(
13951395
if requestTxnID != retryErr.PrevTxnID {
13961396
// KV should not return errors for transactions other than the one that sent
13971397
// the request.
1398-
log.Dev.Fatalf(ctx, "retryable error for the wrong txn. "+
1398+
log.KvExec.Fatalf(ctx, "retryable error for the wrong txn. "+
13991399
"requestTxnID: %s, retryErr.PrevTxnID: %s. retryErr: %s",
14001400
requestTxnID, retryErr.PrevTxnID, retryErr)
14011401
}
@@ -1629,7 +1629,7 @@ func (txn *Txn) UpdateStateOnRemoteRetryableErr(ctx context.Context, pErr *kvpb.
16291629
defer txn.mu.Unlock()
16301630

16311631
if pErr.TransactionRestart() == kvpb.TransactionRestart_NONE {
1632-
log.Dev.Fatalf(ctx, "unexpected non-retryable error: %s", pErr)
1632+
log.KvExec.Fatalf(ctx, "unexpected non-retryable error: %s", pErr)
16331633
}
16341634

16351635
// If the transaction has been reset since this request was sent,

pkg/kv/txn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func TestWrongTxnRetry(t *testing.T) {
432432

433433
var retries int
434434
txnClosure := func(ctx context.Context, outerTxn *Txn) error {
435-
log.Dev.Infof(ctx, "outer retry")
435+
log.KvExec.Infof(ctx, "outer retry")
436436
retries++
437437
// Ensure the KV transaction is created.
438438
if err := outerTxn.Put(ctx, "a", "b"); err != nil {

0 commit comments

Comments
 (0)