Affects Version/s: None
Fix Version/s: 1.6.73
Sprint:EV 18.17 Service Pack, EV 18.18 Service Pack 2
Primary doesn't preserve the order of requests it applied them, so it may lead to different results of dynamic validation and Suspicious Exception on non-primaries.
It may lead to a lot of View Changes.
- When master primary creates a PrePrepare it iterates through requests in some order, let's say [R1, R2, R3, R4, R5]
- Let's assume that request R1 and R2 can be created only after R3, so they fail dynamic validation.
- As a result, a list of valid requests is [R3, R4, R5], and a list of invalid is [R1, R2].
- When PrePrepare is created, it get a list of reqs as valid + invalid, that is [R3, R4, R5, R1, R2], which is not equal to the initial list the master primary iterated through.
- Non-primary replicas will apply PrePrepares in the order as specified in PrePrepare, that is [R3, R4, R5, R1, R2], and for it R1 and R2 will pass dynamic validation since R3 is already created.
- So, non-primaries will raise Suspicious code and trigger view change.
- Preserve the order of requests for master primary in PrePrepare
- Have a bitmask to mark invalid requests
- Extend dynamic validation to eack the bitmask
- Enhance creation of Ordered requests to get only the valid ones