You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. Revision in etcd is a global logical clock for operations that start at 1. This ensures that there were no transactions executed on etcd before so etcd is empty.
. This validation is because this is an implicit assumption of the linearization code, that without this assertion would return hard to discern error.
We can try to improve the linearization to allow non empty code. So why linearization doesn't support non-empty database? Because it needs to a complete view of database, so it can simulate it. Assuming it's empty was just easier to implement.
// Start from CompactRevision equal -1 as etcd allows client to compact revision 0 for some reason.
CompactRevision: -1,
KeyValues: map[string]ValueRevision{},
KeyLeases: map[string]int64{},
Leases: map[int64]EtcdLease{},
}
}
To improve it we could just replace the Read of revision 1 at the beginning with operation to download the state of database and change the model to accept this state as initial one.
Steps;
We still need to make a special request at before all other requests. But now instead of checking revision == 1, we just need to read the database state. Changes in
lg.Fatal("Failed empty database at start check", zap.Error(err))
}
.
In validation we still need to confirm if the special Read request is present. However the conditions are different, we need to make sure it precedes all other requests that reads the whole database contents (or at least the prefix of all keys used in the robustness test). Changes in
We would want to add a way in EtcdState to represent a state that etcd is not initialized, during which the Step method will only allow a read requests. We could hardcode the same request as in step 2.
What would you like to be added?
This task is a little harder as it requires diving into robustness linearization model, interested contributor beware!
Currently we are validating that database is empty before running tests
etcd/tests/antithesis/test-template/robustness/main.go
Lines 96 to 99 in 4976738
This is done by reading revision of etcd before any traffic is sent and checking if revision is equal
1
etcd/tests/robustness/traffic/traffic.go
Lines 207 to 227 in 4976738
This is also checked as first step of validation
etcd/tests/robustness/validate/validate.go
Lines 113 to 127 in 4976738
We can try to improve the linearization to allow non empty code. So why linearization doesn't support non-empty database? Because it needs to a complete view of database, so it can simulate it. Assuming it's empty was just easier to implement.
etcd/tests/robustness/model/deterministic.go
Lines 99 to 108 in 4976738
To improve it we could just replace the Read of revision 1 at the beginning with operation to download the state of database and change the model to accept this state as initial one.
Steps;
revision == 1
, we just need to read the database state. Changes inetcd/tests/antithesis/test-template/robustness/main.go
Lines 96 to 99 in 4976738
etcd/tests/robustness/validate/validate.go
Lines 113 to 127 in 4976738
Why is this needed?
Allow multiple runs of antithesis locally.
/cc @henrybear327 @nwnt
The text was updated successfully, but these errors were encountered: