Kbase 19998: Why does the TRUNCATE BI command pauses, even when there is little or no information in the BI file?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  08/09/2008 |
|
Status: Verified
GOAL:
Why does the TRUNCATE BI command pauses, even when there is little or no information in the BI file?
FIX:
The BI truncation process consists of three phases:
1. Process the contents of the BI file into the database.
2. Flush the OS buffers containing the database information to disk.
3. Mark the BI file as empty.
The pause occurs after a call to the UNIX sync() routine in step 2. If you marked the BI file as empty after processing and the system crashed before all of the OS buffers were written to disk, there would be no way to recover the transactions from the BI file.
The sync() routine guarantees that all information in memory is written to disk. Per the Posix standard, this operation finishes in 60 seconds, hence the delay between steps 2 and 3.
The pause time in the proutil command can be modified by using the -G parameter:
proutil <db> -C truncate bi -G 0
this will cause proutil to mark the BI file as empty immediately after the BI is processed. The man page for the sync() routine is:
NAME
sync - update disk
SYNOPSIS
#include <unistd.h>
void sync(void);
The sync() routine causes all information in memory that should be on disk to be written out. This includes modified file system meta-data and delayed block I/O. The routine should be used by commands and programs that examine a file system, such as fsck, df, etc. It must be run before a shutdown.
The writing, although scheduled, is not necessarily complete upon return from sync.