@@ -111,23 +111,25 @@ func closeItersOnBatch(m *metaTestRunner, reader readWriterID) (results []opRefe
111
111
func generateMVCCScan (
112
112
ctx context.Context , m * metaTestRunner , reverse bool , inconsistent bool , args []string ,
113
113
) * mvccScanOp {
114
- key := m .keyGenerator .parse (args [0 ])
115
- endKey := m .keyGenerator .parse (args [1 ])
114
+ reader := readWriterID (args [0 ])
115
+ key := m .keyGenerator .parse (args [1 ])
116
+ endKey := m .keyGenerator .parse (args [2 ])
116
117
if endKey .Less (key ) {
117
118
key , endKey = endKey , key
118
119
}
119
120
var ts hlc.Timestamp
120
121
var txn txnID
121
122
if inconsistent {
122
- ts = m .pastTSGenerator .parse (args [2 ])
123
+ ts = m .pastTSGenerator .parse (args [3 ])
123
124
} else {
124
- txn = txnID (args [2 ])
125
+ txn = txnID (args [3 ])
125
126
}
126
- maxKeys := int64 (m .floatGenerator .parse (args [3 ]) * 32 )
127
- targetBytes := int64 (m .floatGenerator .parse (args [4 ]) * (1 << 20 ))
128
- allowEmpty := m .boolGenerator .parse (args [5 ])
127
+ maxKeys := int64 (m .floatGenerator .parse (args [4 ]) * 32 )
128
+ targetBytes := int64 (m .floatGenerator .parse (args [5 ]) * (1 << 20 ))
129
+ allowEmpty := m .boolGenerator .parse (args [6 ])
129
130
return & mvccScanOp {
130
131
m : m ,
132
+ reader : reader ,
131
133
key : key .Key ,
132
134
endKey : endKey .Key ,
133
135
ts : ts ,
@@ -427,6 +429,7 @@ func (m mvccFindSplitKeyOp) run(ctx context.Context) string {
427
429
428
430
type mvccScanOp struct {
429
431
m * metaTestRunner
432
+ reader readWriterID
430
433
key roachpb.Key
431
434
endKey roachpb.Key
432
435
ts hlc.Timestamp
@@ -439,17 +442,13 @@ type mvccScanOp struct {
439
442
}
440
443
441
444
func (m mvccScanOp ) run (ctx context.Context ) string {
445
+ reader := m .m .getReadWriter (m .reader )
442
446
var txn * roachpb.Transaction
443
447
if ! m .inconsistent {
444
448
txn = m .m .getTxn (m .txn )
445
449
m .ts = txn .ReadTimestamp
446
450
}
447
- // While MVCCScanning on a batch works in Pebble, it does not in rocksdb.
448
- // This is due to batch iterators not supporting SeekForPrev. For now, use
449
- // m.engine instead of a readWriterGenerator-generated engine.Reader, otherwise
450
- // we will try MVCCScanning on batches and produce diffs between runs on
451
- // different engines that don't point to an actual issue.
452
- result , err := storage .MVCCScan (ctx , m .m .engine , m .key , m .endKey , m .ts , storage.MVCCScanOptions {
451
+ result , err := storage .MVCCScan (ctx , reader , m .key , m .endKey , m .ts , storage.MVCCScanOptions {
453
452
Inconsistent : m .inconsistent ,
454
453
Tombstones : true ,
455
454
Reverse : m .reverse ,
@@ -1143,6 +1142,7 @@ var opGenerators = []opGenerator{
1143
1142
return generateMVCCScan (ctx , m , false , false , args )
1144
1143
},
1145
1144
operands : []operandType {
1145
+ operandReadWriter ,
1146
1146
operandMVCCKey ,
1147
1147
operandMVCCKey ,
1148
1148
operandTransaction ,
@@ -1159,6 +1159,7 @@ var opGenerators = []opGenerator{
1159
1159
return generateMVCCScan (ctx , m , false , true , args )
1160
1160
},
1161
1161
operands : []operandType {
1162
+ operandReadWriter ,
1162
1163
operandMVCCKey ,
1163
1164
operandMVCCKey ,
1164
1165
operandPastTS ,
@@ -1175,6 +1176,7 @@ var opGenerators = []opGenerator{
1175
1176
return generateMVCCScan (ctx , m , true , false , args )
1176
1177
},
1177
1178
operands : []operandType {
1179
+ operandReadWriter ,
1178
1180
operandMVCCKey ,
1179
1181
operandMVCCKey ,
1180
1182
operandTransaction ,
0 commit comments