Skip to content

Commit a4924ec

Browse files
committed
kvclient: let QueryLocks and LeaseInfo requests through txnWriteBuffer
These requests don't interact with buffered writes, so we simply allow the requests and their response to go through the interceptor unchanged. Release note: None
1 parent b3fa0b4 commit a4924ec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/kv/kvclient/kvcoord/txn_interceptor_write_buffer.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ func (twb *txnWriteBuffer) validateRequests(ba *kvpb.BatchRequest) error {
344344
if t.ScanFormat == kvpb.COL_BATCH_RESPONSE {
345345
return unsupportedOptionError(t.Method(), "COL_BATCH_RESPONSE scan format")
346346
}
347+
case *kvpb.QueryLocksRequest, *kvpb.LeaseInfoRequest:
347348
default:
348349
// All other requests are unsupported. Note that we assume EndTxn and
349350
// DeleteRange requests were handled explicitly before this method was
@@ -816,6 +817,11 @@ func (twb *txnWriteBuffer) applyTransformations(
816817
// the request to the KV layer.
817818
baRemote.Requests = append(baRemote.Requests, ru)
818819

820+
case *kvpb.QueryLocksRequest, *kvpb.LeaseInfoRequest:
821+
// These requests don't interact with buffered writes, so we simply
822+
// let them through.
823+
baRemote.Requests = append(baRemote.Requests, ru)
824+
819825
default:
820826
return nil, nil, kvpb.NewError(unsupportedMethodError(t.Method()))
821827
}
@@ -1183,6 +1189,10 @@ func (t transformation) toResp(
11831189
}
11841190
ru.MustSetInner(reverseScanResp)
11851191

1192+
case *kvpb.QueryLocksRequest, *kvpb.LeaseInfoRequest:
1193+
// These requests don't interact with buffered writes, so we simply
1194+
// let the response through unchanged.
1195+
11861196
default:
11871197
return ru, kvpb.NewError(unsupportedMethodError(req.Method()))
11881198
}

0 commit comments

Comments
 (0)