diff --git a/etcdserver/etcdserverpb/raft_internal_stringer.go b/etcdserver/etcdserverpb/raft_internal_stringer.go index f1fcfd88087..362b252cade 100644 --- a/etcdserver/etcdserverpb/raft_internal_stringer.go +++ b/etcdserver/etcdserverpb/raft_internal_stringer.go @@ -64,7 +64,7 @@ func (as *InternalRaftStringer) String() string { case as.Request.Txn != nil: return fmt.Sprintf("header:<%s> txn:<%s>", as.Request.Header.String(), - newLoggableTxnRequest(as.Request.Txn).String(), + NewLoggableTxnRequest(as.Request.Txn).String(), ) default: // nothing to redact @@ -78,7 +78,7 @@ type txnRequestStringer struct { Request *TxnRequest } -func newLoggableTxnRequest(request *TxnRequest) *txnRequestStringer { +func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer { return &txnRequestStringer{request} } diff --git a/etcdserver/util.go b/etcdserver/util.go index f07c4f22575..708fee4cb60 100644 --- a/etcdserver/util.go +++ b/etcdserver/util.go @@ -109,7 +109,8 @@ func warnOfExpensiveRequest(now time.Time, reqStringer fmt.Stringer, respMsg pro warnOfExpensiveGenericRequest(now, reqStringer, "", resp, err) } -func warnOfExpensiveReadOnlyTxnRequest(now time.Time, reqStringer fmt.Stringer, txnResponse *pb.TxnResponse, err error) { +func warnOfExpensiveReadOnlyTxnRequest(now time.Time, r *pb.TxnRequest, txnResponse *pb.TxnResponse, err error) { + reqStringer := pb.NewLoggableTxnRequest(r) var resp string if !isNil(txnResponse) { var resps []string