Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVCC_READ_CONFLICT when submitting multiple transactions concurrently

I have a conceptual question. I'm performing async requests to Composer REST and I'm getting message: 'error trying invoke chaincode. Error: Peer has rejected transaction \'552b42fa4d2cfd366ff1b7d01371878f53f7553b44f141187c6db86b75f68906\' with cdoe MVCC_READ_CONFLICT',. I got the same problem when using node-sdk. What is the reason for that? Shouldn't it be possible to submit multiple transactions asynchronously?

like image 694
Dan Selman Avatar asked Jul 27 '17 10:07

Dan Selman


Video Answer


1 Answers

Hyperledger Fabric uses lock-free optimistic concurrency, with rollback in case of dirty read/writes. You need to avoid key collisions as far as possible and may need to write retry logic on the client side.

The BatchTimeout setting for Fabric can be used to decrease latency (minimise the chance of collisions) at the expense of throughout:

https://github.com/hyperledger/fabric/blob/release/sampleconfig/configtx.yaml#L144

like image 51
Dan Selman Avatar answered Oct 20 '22 21:10

Dan Selman