Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between steal and force in database

Tags:

recovery

It is said that no steal means that transaction s updated buffer is not written to disk before that transaction commits and no force has a similar definition then what's the difference between them?

like image 901
Flamme Avatar asked Oct 19 '15 15:10

Flamme


People also ask

What is steal in DBMS?

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.

What is a force approach in database?

If all pages updated by a transaction are immediately written to disk before the transaction commits, it is called a force approach.

What is steal and no steal in DBMS?

Buffer Pool Management Policies. Steal Policy: Whether the DBMS allows an uncommitted transaction to overwrite the most recent commit- ted value of an object in non-volatile storage (can a transaction write uncommitted changes to disk). 1. STEAL: is allowed 2. NO-STEAL: is not allowed.

What is no steal?

• No Steal – don't allow buffer-pool frames with. uncommited updates to overwrite committed data on disk. – Useful for ensuring atomicity without UNDO logging. – But can cause poor performance.


1 Answers

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.

like image 54
urgentx Avatar answered Sep 23 '22 22:09

urgentx