Repository navigation
Conversation
6763b14 to
59b0397
Compare
6a3ea63 to
d56813b
Compare
d56813b to
de4b325
Compare
|
Considering the importance and complexity of the PR, AI was also used to review the behaviour. Issues1. Hook ordering puts the idempotency check after the audit insert → duplicate rows, then hard failure on the 3rd callOrders in the single
Trace of requests with key
We might want to consider use Two independent fixes are needed:
Note this is also a regression relative to 2. No atomic key claim → the idempotency guarantee doesn't hold under concurrency
This needs a unique index on We should eagerly store incoming command + idempotency and fail-fast if such entries already exists: replay till result is gathered / timeout. 3. In-flight and failed commands are not detected
The store already exposes
4.
|
|
@adamsaghy the order of the hooks was actually intentional... have to look at the notes concerning potential failure scenarios, but as for the order you could look at this also as a feature... if we do as suggested then you'll have no trace a duplicate attempt ever happened (could be malicious)... if that works for you then good for me. Please confirm before I start changing. |
|
Concerning the scenario 7: |
|
Concerning scenario 6: I'm not entirely sure if this is a false flag, but async and disruptor mode are disabled and unusable anyway. For now this is out of scope. |
|
Concerning minor issue "The check hook needs @ConditionalOnBean(CommandStore.class)": this is the intended behavior. A store should always be available. If we don't then it should not be possible to start. And that's the case here. |
|
Concerning rest of minor issues: most of them fixed. |
|
Concerning scenario 5: check added. |
|
Concerning scenario 4: Introduced |
|
Concerning scenario 3: Added a new query that checks for existence of command by idempotency without relying on response object. Should be fixed. |
|
Concerning scenario 2: Added unique constraint and made sure that any duplicate keys get removed from storage to avoid conflicts when the Liquibase script is executed. |
de4b325 to
efc3798
Compare
|
Concerning scenario 1: changed hook order, idempotency now before audit, but the core hooks are still running first; this is intentional because if something fails I want to have some context (e.g. IP address); introduced a |
efc3798 to
de98fbf
Compare
|
This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days. |
Description
Implement idempotency feature for new command processing.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.