
2-74 IBM Informix OnLine Database Server Administrator’s Guide
How OnLine Synchronizes Buffer Flushing
How OnLine Synchronizes Buffer Flushing
Bufferflushingoccurs within thecontextofOnLine activity. When OnLineis
firstinitiated,allbuffersareempty. Asprocessingoccurs,datapagesareread
from disk into the buffers and user processes begin to modify these pages.
(Refertopage 2-73foranexplanationofthe“before-imagesfirst”rule,which
isthereasonthatsynchronizationisnecessary.In addition,page 2-73liststhe
four events that prompt buffer-pool flushing and cross-references to further
background information.)
Before a page in shared memory is modified for the first time, a copy of the
page“before-image”is written tothephysical log buffer. Subsequentmodifi-
cations to that page in shared memory do not result in additional “before-
images”being written to thephysicallog;onlythefirst modification does so.
After each modification, a record of the change is written to the logical log
buffer if the database was created with logging or if the change affected the
database schema.
MLRU queuesbegintofillwithmodifiedpages. Each modifiedpageincludes
a timestamp that describes the time at which the page was modified.
Eventually the number of modified buffers in the MLRU queues reaches
LRU_MAX_DIRTY and page cleaning begins.
The pages in the physical log buffer are always flushed to disk prior to
flushing the pages that are contained in the modified buffers in the shared-
memory buffer pool. (Refer to page 2-73.)
When page cleaning is initiated from the shared-memory buffer pool, the
daemon process performing the page cleaning must coordinate the flushing
so that the physical log buffer is flushed first.
Howisthisdone? The answer istimestampcomparison.(Refer to page 2-44 for
a definition of a timestamp.)
Shared memory contains a structure that stores a timestamp each time the
physical log buffer is flushed. If a tbpgcl or tbinit daemon needs to flush a
page in a shared-memory buffer, the daemon process compares the
timestampinthemodifiedbufferwiththetimestampthatindicatesthepoint
when the physical log buffer was last flushed.
Komentarze do niniejszej Instrukcji