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

Reply via email to