Persistent cache for some reason was not integrated into command service.
That was resulting in infinite resending of a replayed transaction between Iroha components.
The fix makes CommandServiceImpl aware of persistent cache and the infinite loop is broken now.
Caches lookup strategy during batch processing in command service (even single incoming transaction will be represented as a batch internally):
check command service tx status cache
check persistent storage cache for replays
Benefits
Potentially improved CPU and memory consumption.
Reduced network load.
An infinite resending of a replayed transaction between Iroha components is avoided.
Possible Drawbacks
Weird cache dependency for CommandServiceImpl appeared.
Iroha output should not contain inifinitely repeated message about duplicated transaction from OnDemandOrderingServiceImpl like "Duplicate transaction: ..."
Check that correct statuses are delivered in tx status stream
Signed-off-by: Igor Egorov igor@soramitsu.co.jp
Description of the Change
Persistent cache for some reason was not integrated into command service. That was resulting in infinite resending of a replayed transaction between Iroha components.
The fix makes CommandServiceImpl aware of persistent cache and the infinite loop is broken now.
Caches lookup strategy during batch processing in command service (even single incoming transaction will be represented as a batch internally):
Benefits
Potentially improved CPU and memory consumption. Reduced network load. An infinite resending of a replayed transaction between Iroha components is avoided.
Possible Drawbacks
Weird cache dependency for CommandServiceImpl appeared.
Usage Examples or Tests
compile and run irohad
Check that there is no infinite resending
run repro script https://gist.github.com/igor-egorov/ff56db9ca1de50215d6830f5980155d6
Iroha output should not contain inifinitely repeated message about duplicated transaction from
OnDemandOrderingServiceImpl
like "Duplicate transaction: ..."Check that correct statuses are delivered in tx status stream
repro script https://gist.github.com/igor-egorov/152b821faa335193569dec2246e578fb
You have to compile two versions of irohad: one from
develop
branch, another - from that pr.Run the script with both irohad's and capture the output to files. The statuses (their order) should not differ.