并发提交多个事务时的MVCC_READ_CONFLICT [英] MVCC_READ_CONFLICT when submitting multiple transactions concurrently

查看:399
本文介绍了并发提交多个事务时的MVCC_READ_CONFLICT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个概念性的问题.我正在执行对Composer REST的异步请求,并且收到消息:'error trying invoke chaincode. Error: Peer has rejected transaction \'552b42fa4d2cfd366ff1b7d01371878f53f7553b44f141187c6db86b75f68906\' with cdoe MVCC_READ_CONFLICT',.使用node-sdk时遇到相同的问题.是什么原因呢?应该不是可以异步提交多个事务吗?

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?

推荐答案

Hyperledger Fabric使用无锁乐观并发,并在发生脏读/写操作时进行回滚.您需要尽可能避免按键冲突,并且可能需要在客户端编写重试逻辑.

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.

Fabric的BatchTimeout设置可用于减少延迟(最大程度地减少冲突的机会),但需要付出以下代价:

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

这篇关于并发提交多个事务时的MVCC_READ_CONFLICT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆