Previous Topic

Next Topic

Improved Handling of Header Updates During Server Shutdown

A transaction controlled file, (the c-treeACE SYSLOGDT.FCS file in this case) had its update flag set following auto recovery after a header write failed when closing the file. c-treeACE then failed to start with error 14 for that file.

In the case observed, c-treeACE was shutting down, and the syslog thread failed to write the header of SYSLOGDT.FCS file before closing the file. When the header write failed, the update flag was left set on disk, however, the update flag in the file control block in memory was set to zero. As a result, the final checkpoint closed the file without attempting to write the header to disk, and the final checkpoint completed, leaving no reference to the file as an open file at shutdown.

When writing the header while closing a file, if the write fails logic is already in place to shut down c-treeACE if the file is under transaction control. New logic is introduced to set the update flag to a special value to if the update flag has been reset to zero. Doing this ensures that if a final checkpoint occurs, the final checkpoint also attempts to write the header. If the final checkpoint is able to write the header, it closes the file and the file is not marked corrupt. However, if the final checkpoint also fails to write the header, error handling code will terminate the server (ctcatend()), and the logic detects a recursive call to ctcatend() and it exits the process without writing the final checkpoint.