@@ -204,6 +204,10 @@ pub struct Workload {
204
204
/// Data collected to evaluate the average commit time [ns].
205
205
tot_commit_time : u64 ,
206
206
n_successfull_commit : u64 ,
207
+ /// Whether to ensure the correct application of the changest after every commit.
208
+ ensure_changeset : bool ,
209
+ /// Whether to ensure the correctness of the state after every crash.
210
+ ensure_snapshot : bool ,
207
211
}
208
212
209
213
impl Workload {
@@ -242,6 +246,8 @@ impl Workload {
242
246
bitbox_seed,
243
247
tot_commit_time : 0 ,
244
248
n_successfull_commit : 0 ,
249
+ ensure_changeset : workload_params. ensure_changeset ,
250
+ ensure_snapshot : workload_params. ensure_snapshot ,
245
251
}
246
252
}
247
253
@@ -324,6 +330,10 @@ impl Workload {
324
330
rr : & comms:: RequestResponse ,
325
331
changeset : & Vec < KeyValueChange > ,
326
332
) -> anyhow:: Result < ( ) > {
333
+ if !self . ensure_changeset {
334
+ return Ok ( ( ) ) ;
335
+ }
336
+
327
337
for change in changeset {
328
338
match change {
329
339
KeyValueChange :: Insert ( key, value)
@@ -402,6 +412,10 @@ impl Workload {
402
412
rr : & comms:: RequestResponse ,
403
413
changeset : & Vec < KeyValueChange > ,
404
414
) -> anyhow:: Result < ( ) > {
415
+ if !self . ensure_changeset {
416
+ return Ok ( ( ) ) ;
417
+ }
418
+
405
419
// Given a reverted changeset, we need to ensure that each modified/deleted key
406
420
// is equal to its previous state and that each new key is not available.
407
421
for change in changeset {
@@ -437,6 +451,10 @@ impl Workload {
437
451
}
438
452
439
453
async fn ensure_snapshot_validity ( & self , rr : & comms:: RequestResponse ) -> anyhow:: Result < ( ) > {
454
+ if !self . ensure_snapshot {
455
+ return Ok ( ( ) ) ;
456
+ }
457
+
440
458
for ( i, ( key, expected_value) ) in ( self . state . committed . state . iter ( ) ) . enumerate ( ) {
441
459
let value = rr. send_request_query ( * key) . await ?;
442
460
if & value != expected_value {
0 commit comments