Reputation: 359
It is said that No-Steal policy means that transaction's updated buffer block is not written to the disk before the transaction commits and No-Force policy has a similar definition.
What's the difference between them?
Upvotes: 32
Views: 24441
Reputation: 17964
They may look similar, but they are not the same.
Look at this diagram:
Transaction's buffer blocks ...
Upvotes: 3
Reputation: 3931
Suppose a transaction T1 wants to read a data object X, but the working memory is full with all the other transactions' work. So T1 needs to clear some memory, which it does by kicking some other page in working memory to stable storage. This can be dangerous, because we can't be sure that what T1 is pushing to stable storage has been committed yet. This is known as stealing.
Forcing means that every time a transaction commits, all the affected pages will be pushed to stable storage. This is inefficient, because each page may be written by many transactions and will slow the system down.
Most crash recovery uses a steal/no-force approach, accepting the risks of writing possibly uncommitted data to memory to gain the speed of not forcing all commit effects to memory.
Upvotes: 70
Reputation:
In no-force approach, the updated page is not written to disk even after the transaction is committed. It is done to reduce I/O overhead.
Upvotes: -2