@@ -499,11 +499,11 @@ func (v *validator) processOp(op Operation) {
499
499
if e := (* kvpb .ConditionFailedError )(nil ); errors .As (err , & e ) {
500
500
// If the CPut failed, the actual value (in the ConditionFailedError) is
501
501
// observed, and the CPut's write is not observed.
502
+ observedVal := roachpb.Value {}
502
503
if e .ActualValue != nil {
503
- if valueBytes , err := e .ActualValue .GetBytes (); err == nil {
504
- readObservation .Value = roachpb .MakeValueFromBytes (valueBytes )
505
- }
504
+ observedVal .RawBytes = e .ActualValue .RawBytes
506
505
}
506
+ readObservation .Value = observedVal
507
507
v .curObservations = append (v .curObservations , readObservation )
508
508
} else {
509
509
// If the CPut succeeded, the expected value is observed, and the CPut's
@@ -512,7 +512,11 @@ func (v *validator) processOp(op Operation) {
512
512
// If AllowIfDoesNotExist == true, we don't know if the read found the
513
513
// expected value or no value, so we can't add a read observation.
514
514
// Otherwise, it must have observed the expected value.
515
- readObservation .Value = roachpb .MakeValueFromBytes (t .ExpVal )
515
+ observedVal := roachpb.Value {}
516
+ if t .ExpVal != nil {
517
+ observedVal = roachpb .MakeValueFromBytes (t .ExpVal )
518
+ }
519
+ readObservation .Value = observedVal
516
520
v .curObservations = append (v .curObservations , readObservation )
517
521
}
518
522
if sv , ok := v .tryConsumeWrite (t .Key , t .Seq ); ok {
0 commit comments