Previous Topic: OverviewNext Topic: Restrictions


Processing

The DEFRAG function is necessarily an I/O instensive process. Before two blocks can be merged, they are written to DASD, if they are already in the pipeline. Each write in the merge process is an immediate write.

When two blocks are chosen to be merged, their block numbers and information are written to IXX control block. If the Multi-User Facility fails, restart (or any open of the DBID for update) uses this information to ensure that the index is consistent in regard to those two blocks. If you choose not to restart the DBID and then attempt to open the DBID as read-only, the open fails with a return code 43(005).

The merged-to block is always written first. The merged-from block is then deleted and written. Write I/O errors during the DEFRAG process are unlikely. If any should occur, however, they are handled in the following way. If it is on the first block (the merged-to block) the block is simply marked invalid, which requires a future user of the block to reread it from DASD, and the DEFRAG terminates. If it is on the second block (the newly deleted block), the index is marked in the Multi-User Facility memory as unusable. No I/O reads at the DXX level are allowed. You should close the DBID and correct the cause of the I/O error. When the DBID is reopened for update, the same correcting code that exists for system failure runs and deletes the second block. If the I/O error persists, the index has to be initialized and rebuilt using the RETIX function, that is, dealt with the same as any other I/O error problem.