db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Can anyone give me some suggestions?
Date Tue, 23 Aug 2005 17:03:35 GMT
Yes, the key is that in normal operation the call to these routines
is always done by a background process which is a different thread
than normal client threads.  So database client threads procede
while the checkpoint procedes.  The buffer cache is not locked for
the duration of the checkpoint, only individual pages for the time
it takes to copy the page from the buffer cache into the OS cache.

Raymond Raymond wrote:
>> From: Mike Matrigali <mikem_app@sbcglobal.net>
>> Reply-To: "Derby Development" <derby-dev@db.apache.org>
>> Ok, just to be clear Derby checkpoints are already asynchronous.
>> The one synchrounous point is that while a page is being written
>> no update that exact page can be happening.
>> Updates to all other pages in the
>> database may be going on concurrently with this operation.  So unless
>> you are worried about concurrency on the single page, I believe
>> Derby checkpoints already do what you describe.
>> In the case of Derby the list is the numerical order list of buffers
>> in the cache, and is always traversed in order.  The checkpoint is
>> done by a background thread asynchronous to other user threads.
> hi, Dear Mike Matrigali ,thanks for your comment. I am a novice of derby.
> I still have some questions about this issue. I looked
> into the present derby source code. I read the source
> of org.apache.derby.impl.store.raw.log.LogToFile.checkpoint()
> and org.apache.derby.impl.store.raw.log.LogToFile.checkpointWithTran(),
> I found that it clean the buffer cache during the checkpoint by calling
> df.checkpoint() (df is an instance of DataFactory)
> I also looked into the source code of
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.checkpoint()
> and org.apache.derby.impl.services.cache.Clock.cleanAll()
> and org.apache.derby.impl.services.cache.Clock.cleanCache()
> which are called nested to write out the dirty pages.
> So, I think, presently in derby,when an checkpoint is being taken, it will
> wait for all the dirty pages being written out and then write out the
> checkpoint
> log and any other things needed to be done.
> Raymond
> _________________________________________________________________
> Take charge with a pop-up guard 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*.

View raw message