You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Raymond Raymond <ra...@hotmail.com> on 2006/02/16 05:48:11 UTC

Two questions on derby checkpointing

I have some questions about derby checkpointing. Someone can
help me to make it clear? ^_^.

1. I want to summarize what events will trigger a checkpoint?
On the derby website :
http://db.apache.org/derby/papers/logformats.html
I found such comments:
-------------------------------------------------------------------------------------------------------------------------------------------
With the default values, a new log file is created (this is known as log 
switch) when a log file grows beyond 1MB and a checkpoint happens when the 
amount of log written is 10MB or more from the last checkpoint.

RawStore exposes a checkpoint method which clients can call, or a checkpoint 
is taken automatically by the RawStore when:

1. The log file grows beyond a certain size (configurable, default 1MB)
2. RawStore is shutdown and a checkpoint hasn't been done "for a while"
3. RawStore is recovered and a checkpoint hasn't been done "for a while"
-------------------------------------------------------------------------------------------------------------------------------------------
I am no very clear about what " for a while " means in the second and the 
third comments.
I also want to know are there any other events will trigger a checkpoint 
besides these?


2. As what we discussed in the "incremental checkpointing issue" before,
I need to monitor the data reads and log writes, to gather some runtime
disk I/O information. So far, I found the basic classes to do data reads are 
:
org.apache.derby.impl.store.raw.data.RAFContainer.java
org.apache.derby.impl.store.raw.data.InputStreamContainer.java

the basic class to do log writes is :
org.apache.derby.impl.store.raw.log.LogAccessFile.java

Are there any other classes is involved in data reads and log writes 
directly?

Thanks.


Raymond

_________________________________________________________________
Powerful Parental Controls Let your child discover the best the Internet has 
to offer. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSNŽ Premium right now and get the 
first two months FREE*.


Re: Two questions on derby checkpointing

Posted by Raymond Raymond <ra...@hotmail.com>.
Suresh,thank you very much.

Raymond


>From: Suresh Thalamati <su...@gmail.com>
>Reply-To: <de...@db.apache.org>
>To: derby-dev@db.apache.org
>Subject: Re: Two questions on derby checkpointing
>Date: Thu, 16 Feb 2006 01:11:48 -0800
>
>Raymond Raymond wrote:
>>I have some questions about derby checkpointing. Someone can
>>help me to make it clear? ^_^.
>>
>>1. I want to summarize what events will trigger a checkpoint?
>>On the derby website :
>>http://db.apache.org/derby/papers/logformats.html
>>I found such comments:
>>-------------------------------------------------------------------------------------------------------------------------------------------
>>
>>With the default values, a new log file is created (this is known as log 
>>switch) when a log file grows beyond 1MB and a checkpoint happens when the 
>>amount of log written is 10MB or more from the last checkpoint.
>>
>>RawStore exposes a checkpoint method which clients can call, or a 
>>checkpoint is taken automatically by the RawStore when:
>>
>>1. The log file grows beyond a certain size (configurable, default 1MB)
>>2. RawStore is shutdown and a checkpoint hasn't been done "for a while"
>
>To my knowledge shutdown always does a checkpoint.
>
>
>>3. RawStore is recovered and a checkpoint hasn't been done "for a while"
>
>
>if there is an undo work or if we redo a log worth > 1000 bytes a
>checkpoint is requested.  See the check in LogToFile.java:recover() method 
>with following comment:
>
>// if we can figure out there there is very little in the
>// log (less than 1000 bytes),we haven't done any
>// rollbacks, then don't checkpoint. Otherwise checkpoint.
>
>
>
>>-------------------------------------------------------------------------------------------------------------------------------------------
>>
>>I am no very clear about what " for a while " means in the second and the 
>>third comments.
>>I also want to know are there any other events will trigger a checkpoint 
>>besides these?
>
>1) Online Backup will trigger a checkpoint
>2) Backup related calls freeze , unfreeze that allows users to backup a 
>dataabase using OS copy also will trigger a checkpoint.
>
>3) Inplace commress triggers a checkpoint when doing a truncate of the 
>table.
>
>That's all I can remeber offhand.
>
>
>
>>
>>
>>2. As what we discussed in the "incremental checkpointing issue" before,
>>I need to monitor the data reads and log writes, to gather some runtime
>>disk I/O information. So far, I found the basic classes to do data reads 
>>are :
>>org.apache.derby.impl.store.raw.data.RAFContainer.java
>>org.apache.derby.impl.store.raw.data.InputStreamContainer.java
>>
>>the basic class to do log writes is :
>>org.apache.derby.impl.store.raw.log.LogAccessFile.java
>>
>>Are there any other classes is involved in data reads and log writes 
>>directly?
>
>
>I also think those are the three classes make the actual I/O read/write 
>calls.
>
>
>hope that helps
>-suresh

_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented MicrosoftŽ 
SmartScreen Technology. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSNŽ Premium right now and get the 
first two months FREE*.


Re: Two questions on derby checkpointing

Posted by Suresh Thalamati <su...@gmail.com>.
Raymond Raymond wrote:
> I have some questions about derby checkpointing. Someone can
> help me to make it clear? ^_^.
> 
> 1. I want to summarize what events will trigger a checkpoint?
> On the derby website :
> http://db.apache.org/derby/papers/logformats.html
> I found such comments:
> ------------------------------------------------------------------------------------------------------------------------------------------- 
> 
> With the default values, a new log file is created (this is known as log 
> switch) when a log file grows beyond 1MB and a checkpoint happens when 
> the amount of log written is 10MB or more from the last checkpoint.
> 
> RawStore exposes a checkpoint method which clients can call, or a 
> checkpoint is taken automatically by the RawStore when:
> 
> 1. The log file grows beyond a certain size (configurable, default 1MB)
> 2. RawStore is shutdown and a checkpoint hasn't been done "for a while"

To my knowledge shutdown always does a checkpoint.


> 3. RawStore is recovered and a checkpoint hasn't been done "for a while"


if there is an undo work or if we redo a log worth > 1000 bytes a
checkpoint is requested.  See the check in LogToFile.java:recover() 
method with following comment:

// if we can figure out there there is very little in the
// log (less than 1000 bytes),we haven't done any
// rollbacks, then don't checkpoint. Otherwise checkpoint.



> ------------------------------------------------------------------------------------------------------------------------------------------- 
> 
> I am no very clear about what " for a while " means in the second and 
> the third comments.
> I also want to know are there any other events will trigger a checkpoint 
> besides these?

1) Online Backup will trigger a checkpoint
2) Backup related calls freeze , unfreeze that allows users to backup 
a dataabase using OS copy also will trigger a checkpoint.

3) Inplace commress triggers a checkpoint when doing a truncate of the 
table.

That's all I can remeber offhand.



> 
> 
> 2. As what we discussed in the "incremental checkpointing issue" before,
> I need to monitor the data reads and log writes, to gather some runtime
> disk I/O information. So far, I found the basic classes to do data reads 
> are :
> org.apache.derby.impl.store.raw.data.RAFContainer.java
> org.apache.derby.impl.store.raw.data.InputStreamContainer.java
> 
> the basic class to do log writes is :
> org.apache.derby.impl.store.raw.log.LogAccessFile.java
> 
> Are there any other classes is involved in data reads and log writes 
> directly?


I also think those are the three classes make the actual I/O 
read/write calls.


hope that helps
-suresh