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