reset password
Author Message
rhardytran
Posts: 8
Posted 11:17 Nov 15, 2010 |

Question about commit method (Commit;)?

By default, the Commit method will cause a flush of all data to disk within the operating system. The Commit method has an optional parameter that controls this called ForceFlush and it defaults to True. Passing False as the ForceFlush parameter will improve the performance of a commit operation at the expense of possible data corruption if the application is improperly terminated after the commit takes place.


So, does our hw 5 commit method flush all data from buffer to disk by default?  It's import to know this requirement.  Thanks

cysun
Posts: 2935
Posted 11:26 Nov 15, 2010 |

I didn't find the ForceFlush thing you are talking about. Which file/class is it in?

Generally speaking, when to flush depends on the recovery/concurrency control mechanism. For this assignment, since you already know the recovery mechanism is undo/redo, you can decide when to flush.

rhardytran
Posts: 8
Posted 12:05 Nov 15, 2010 |
cysun wrote:

I didn't find the ForceFlush thing you are talking about. Which file/class is it in?

Generally speaking, when to flush depends on the recovery/concurrency control mechanism. For this assignment, since you already know the recovery mechanism is undo/redo, you can decide when to flush.

I look commit method in Transaction.java which called RecoverMgr.commit().  What it does is flush all buffer related to its transaction number, then write transaction to log and last flush the transaction.  So  yes, it flush all data prior commit.

cysun
Posts: 2935
Posted 13:22 Nov 15, 2010 |
rhardytran wrote:
cysun wrote:

I didn't find the ForceFlush thing you are talking about. Which file/class is it in?

Generally speaking, when to flush depends on the recovery/concurrency control mechanism. For this assignment, since you already know the recovery mechanism is undo/redo, you can decide when to flush.

I look commit method in Transaction.java which called RecoverMgr.commit().  What it does is flush all buffer related to its transaction number, then write transaction to log and last flush the transaction.  So  yes, it flush all data prior commit.

You said there's a ForceFlush option that causes a "flush of all data to disk within the operating system". I couldn't find that part. And yes, transaction commit does flush the buffers used by the transaction and its log. For this assignment it's up to you to decide whether you want to keep this behavior or change it, but either way you need to ensure the correctness of the undo/redo recovery.

rhardytran
Posts: 8
Posted 13:51 Nov 15, 2010 |
cysun wrote:
rhardytran wrote:
cysun wrote:

I didn't find the ForceFlush thing you are talking about. Which file/class is it in?

Generally speaking, when to flush depends on the recovery/concurrency control mechanism. For this assignment, since you already know the recovery mechanism is undo/redo, you can decide when to flush.

I look commit method in Transaction.java which called RecoverMgr.commit().  What it does is flush all buffer related to its transaction number, then write transaction to log and last flush the transaction.  So  yes, it flush all data prior commit.

You said there's a ForceFlush option that causes a "flush of all data to disk within the operating system". I couldn't find that part. And yes, transaction commit does flush the buffers used by the transaction and its log. For this assignment it's up to you to decide whether you want to keep this behavior or change it, but either way you need to ensure the correctness of the undo/redo recovery.

My mistake, there is no ForceFlush option in commit method. Thanks your reply.  It helps