如何判断交易是否为conflict-serializable?
How to determine the whether the transaction is conflict-serializable or not?
我有以下 question:
read(T1, x)
read(T2, x)
write(T1, x)
write(T2, x)
commit(T1)
commit(T2)
State whether the schedule is conflict-serializable, recoverable and avoids cascading abort?
我这样处理问题:
----------------------
| T1 | T2 |
----------------------
| read(x) | |
----------------------
| | read(x) |
----------------------
| write(x)| |
----------------------
| | write(x) |
----------------------
| commit | |
----------------------
| | commit |
----------------------
我想是的,因为优先图中没有循环(非循环),所以是conflict-serializable。此外,交易 T1
可以通过交换转换为交易 T2
:
----------------------
| T1 | T2 |
----------------------
| read(x) | |
----------------------
| write(x)| |
----------------------
| commit | |
----------------------
| | read(x) |
----------------------
| | write(x) |
----------------------
| | commit |
----------------------
可以恢复吗?我认为是的,因为 T1
写入后提交,T2
读取、写入和提交。
是无级联的吗?我认为不,因为 T1
和 T2
在写完后没有提交。
这是在避免级联中止吗?我想是的,因为它是可以恢复的。
然而,答案是:
不可序列化冲突
可恢复
避免级联中止
现在,为什么会这样 conflict-seriable?
最有可能的答案是循环发生在 T2
read(x) -> T1 write(x) -> T2 write(x) 之间。
如果我是对的,那为什么附表3是conflict-serializable?
此致
I thought like, since there was no cycle (acyclic) in the precedence graph , it was conflict-serializable.
假设错误。如果我们绘制优先级图:
时间表不是conflict-serializable
可以恢复吗?
- 是的。
T1
首先写入 X
,然后第一个 T1
被提交。
是无级联的吗?
- 没有。
T2
不读取提交的数据。
是否级联?
- 是的。如果出现故障
X
可以恢复到原来的值
我有以下 question:
read(T1, x)
read(T2, x)
write(T1, x)
write(T2, x)
commit(T1)
commit(T2)
State whether the schedule is conflict-serializable, recoverable and avoids cascading abort?
我这样处理问题:
----------------------
| T1 | T2 |
----------------------
| read(x) | |
----------------------
| | read(x) |
----------------------
| write(x)| |
----------------------
| | write(x) |
----------------------
| commit | |
----------------------
| | commit |
----------------------
我想是的,因为优先图中没有循环(非循环),所以是conflict-serializable。此外,交易 T1
可以通过交换转换为交易 T2
:
----------------------
| T1 | T2 |
----------------------
| read(x) | |
----------------------
| write(x)| |
----------------------
| commit | |
----------------------
| | read(x) |
----------------------
| | write(x) |
----------------------
| | commit |
----------------------
可以恢复吗?我认为是的,因为
T1
写入后提交,T2
读取、写入和提交。是无级联的吗?我认为不,因为
T1
和T2
在写完后没有提交。这是在避免级联中止吗?我想是的,因为它是可以恢复的。
然而,答案是:
不可序列化冲突
可恢复
避免级联中止
现在,为什么会这样 conflict-seriable?
最有可能的答案是循环发生在
T2
read(x) -> T1 write(x) -> T2 write(x) 之间。如果我是对的,那为什么附表3是conflict-serializable?
此致
I thought like, since there was no cycle (acyclic) in the precedence graph , it was conflict-serializable.
假设错误。如果我们绘制优先级图:
时间表不是conflict-serializable
可以恢复吗?
- 是的。
T1
首先写入X
,然后第一个T1
被提交。
- 是的。
是无级联的吗?
- 没有。
T2
不读取提交的数据。
- 没有。
是否级联?
- 是的。如果出现故障
X
可以恢复到原来的值
- 是的。如果出现故障