在eXtremeDB中,MVCC模式Read Committed隔离级别的问题

场景如下:

       1. Insert 100000 records in database.

       2. Then to start 2 threads, one thread is traversing the table and at the same time, the other thread is updating database.

      

       But in read committed isolation, some time, it can get 100001 records from traversing table result. However, I can’t find this phenomenon in Repeatable Read isolation.


表结构如下:

 class A {

    unsigned<4> ui4;
    string      tag;
    
          tree <ui4> Idxui4;
    /*list;*/
};

 

"update A set tag=%s where ui4=%


This is the expected behavior. If it is unacceptable for your application, then don’t use the “read-committed” isolation level but instead use the default MVCC “repeatable-read” level (especially taking into account that “read-committed” doesn't provide any significant performance benefits).


Update may change position of record in index and the same object will be traversed twice during index scan.


In MVCC update of the object always cause creation of new version. If there are multiple concurrent threads, there can be more than one version of the same object visible for the current transaction (in different moments of time). 


 To get a consistent snapshot of the table, you need to use “repeatable-read” isolation level. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值