@@ -17,6 +17,7 @@ import (
17
17
"github.com/cockroachdb/cockroach/pkg/rpc"
18
18
"github.com/cockroachdb/cockroach/pkg/rpc/nodedialer"
19
19
"github.com/cockroachdb/cockroach/pkg/util"
20
+ "github.com/cockroachdb/cockroach/pkg/util/buildutil"
20
21
"github.com/cockroachdb/cockroach/pkg/util/log"
21
22
"github.com/cockroachdb/cockroach/pkg/util/tracing"
22
23
"github.com/cockroachdb/errors"
@@ -208,14 +209,23 @@ func (gt *grpcTransport) sendBatch(
208
209
log .VEvent (ctx , 2 , "sending batch request" )
209
210
reply , err := iface .Batch (ctx , ba )
210
211
log .VEvent (ctx , 2 , "received batch response" )
211
- // If we queried a remote node, perform extra validation.
212
- if reply != nil && ! rpc .IsLocal (iface ) {
213
- if err == nil {
214
- for i := range reply .Responses {
215
- err = reply .Responses [i ].GetInner ().Verify (ba .Requests [i ].GetInner ())
216
- if err != nil {
217
- log .Errorf (ctx , "verification of response for %s failed: %v" , ba .Requests [i ].GetInner (), err )
218
- break
212
+
213
+ // We don't have any strong reason to keep verifying the checksum of the
214
+ // response. However, since this check has historically caught some bugs, we
215
+ // are keeping it in Test builds for not.
216
+ // TODO(ibrahim): There is a path to remove Value checksum computations and
217
+ // verifications. More details are available in:
218
+ // https://github.com/cockroachdb/cockroach/issues/145541#issuecomment-2917225539
219
+ if buildutil .CrdbTestBuild {
220
+ // If we queried a remote node, perform extra validation.
221
+ if reply != nil && ! rpc .IsLocal (iface ) {
222
+ if err == nil {
223
+ for i := range reply .Responses {
224
+ err = reply .Responses [i ].GetInner ().Verify (ba .Requests [i ].GetInner ())
225
+ if err != nil {
226
+ log .Errorf (ctx , "verification of response for %s failed: %v" , ba .Requests [i ].GetInner (), err )
227
+ break
228
+ }
219
229
}
220
230
}
221
231
}
0 commit comments