如果版本存储需要空间并用完,则事务可能会回滚。它不会等待版本存储中的空间,而且您真的不希望它等待。
通常,版本存储由具有使用乐观锁定(例如快照隔离或读提交快照隔离)的隔离级别的事务使用。使用这些的目的通常是为了防止读取器阻塞高度事务性数据库中的写入器,但是如果写入器必须等待版本存储空间被释放,则可能会导致其他写入器的大量阻塞,并且可能会被无休止地阻塞。相反,这些事务被回滚。
版本存储的 tempdb 空间不足会导致以下错误:
3959 - Version store is full. New version(s) could not be added. A transaction that needs to access the version store may be rolled back. Please refer to BOL on how to configure tempdb for versioning.
3966 - Transaction is rolled back when accessing version store. It was earlier marked as victim when the version store was shrunk due to insufficient space in tempdb. This transaction was marked as a victim earlier because it may need the row version(s) that have already been removed to make space in tempdb. Retry the transaction
3967 - Insufficient space in tempdb to hold row versions. Need to shrink the version store to free up some space in tempdb. Transaction (id=%I64d xsn=%I64d spid=%d elapsed_time=%d) has been marked as victim and it will be rolled back if it accesses the version store. If the problem persists, the likely cause is improperly sized tempdb or long-running transactions. Please refer to BOL on how to configure tempdb for versioning.
Run Code Online (Sandbox Code Playgroud)
如错误消息中所述,3967 表示版本存储在 tempdb 中的空间不足,并且特定事务已被标记为受害者。如果此事务命中版本存储,则该事务将被回滚。如果打开的事务没有修改任何额外的行,需要将行添加到版本存储中,那么它不会回滚。
3966 表示标记的事务(来自 3697)已尝试访问版本存储并随后被回滚。
3959 表示 tempdb 没有足够的空间来保存版本存储,但还没有标记为受害者的事务(意味着 tempdb 空间不足但没有事务尝试访问版本存储)。现有事务将不受影响,但需要版本存储的新事务将被回滚。
归档时间: |
|
查看次数: |
447 次 |
最近记录: |