MVCC_READ_CONFLICT when submitting multiple transactions concurrently

前端 未结 2 1091
遥遥无期
遥遥无期 2021-01-05 06:16

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 trans

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-05 07:08

    When you submit a transaction, the peer generates a read and write set. This read/write set is then used when the transaction is committed to the ledger. It contains the name of the variables to be read/written and their version when they were read. If, during the time between set creation and committing, a different transaction was committed and changed the version of the variable, the original transaction will be rejected during committal because the version when read is not the current version.

    To address this, you will have to create data and transaction structures which avoid concurrently editing the same key. A sample way to do this is provided in fabric-samples here:

    https://github.com/hyperledger/fabric-samples/tree/release/high-throughput

提交回复
热议问题