MVCC conflict when I benchmark Java chaincode (update function) only 1tx per second. #hyperledger-fabric #fabric-chaincode #consensus #raft
Hi everyone, I have this wiered MVCC-conflict issue. It appears occasionally as I benchmark my Java chaincode. I tried everything I possibly could to prevent its occurance.
Could it be a racing condition? such that a that when the transaction method tries to read a key and update the key, such that another version incremental happens between the read and update? I mean could that happen given my extreme settings?
|
|
Hi Ali, Yes. MVCC - Multi Version Concurrency Control. It occurs exactly when like you mentioned. You need to design the chaincode in such a way to avoid frequent same key update as much as possible. If for testing purposes alone, write a new key on every transaction.
On Fri, 8 May 2020, 11:49 am Ali Abdulaziz, <aakzubaidi@...> wrote:
|
|
ِThanks Prasnth for your reply. So, you think it is a racing condition. Just to confirm with you. So, what the best way to update a value bases on its previous value? I need an example that does not impact throughput or latency that much. I do not want to go through key management and I do not want to trust client for making delta values for me or any interference from the client. I am seeking a solution at the chaincode level. So any suggestion or examples please?
|
|
David Enyeart
If you send a steady flow of updates for the same key, you will always have some transactions in flight (endorsement or ordering phase) while earlier transactions are committing on peers. Since the later transaction's reads are now outdated, the chaincode execution is considered invalid, and those transactions will get invalidated as MVCC conflict. ِThanks Prasnth for your reply. So, you think it is a racing condition. Just to confirm with you. So, what the best way to update a value bases on its previous value? I need an example that does not impact throughput or latency that much. I do not want to go through key management and I do not want to trust client for making delta values for me or any interference from the client. I am seeking a solution at the chaincode level. So any suggestion or examples please?
|
|