Manage logs

From Version 9.1.0, IBM MQ supports automatic log management and automatic media recovery of linear logs. Circular logs are nearly self-managing, but sometimes need intervention to resolve space problems.

Note: Automatic and archive log management are not valid on IBM i.

On circular logging, the queue manager reclaims freed space in the log files. This activity is not apparent to the user, and we do not usually see the amount of disk space used reduce, because the space allocated is quickly reused.

From IBM MQ Version 9.1.0 we can delete secondary files when using circular logging. See RESET QMGR TYPE(REDUCELOG) for more information.

On linear logging, the log might fill if a checkpoint has not been taken for a long time, or if a long-running transaction wrote a log record a long time ago. The queue manager tries to take checkpoints often enough to avoid the first problem.

If the log fills, message AMQ7463 is issued. In addition, if the log fills because a long-running transaction has prevented the space being released, message AMQ7465 is issued.

Of the log records, only those written since the start of the last complete checkpoint, and those written by any active transactions, are needed to restart the queue manager.

Over time, the oldest log records written become unnecessary for restarting the queue manager.

When a long-running transaction is detected, activity is scheduled to asynchronously rollback that transaction. If, for some unexpected reason, that asynchronous rollback were to fail, some MQI calls return MQRC_RESOURCE_PROBLEM in that situation.

Note that space is reserved to commit or roll back all in-flight transactions, so MQCMIT or MQBACK should not fail.

The queue manager rolls back transactions that run for a long duration. An application that has a transaction is rolled back in this way cannot perform subsequent MQPUT or MQGET operations specifying sync point under the same transaction.

However, transactions ended manually start a new log. Note, that whereas new log space is allocated immediately, log space that has been released takes a finite time to be freed up.

An attempt to put or get a message under sync point in this state returns MQRC_BACKED_OUT. The application can then issue MQCMIT, which returns MQRC_BACKED_OUT, or MQBACK and start a new transaction. When the transaction consuming too much log space has been rolled back, the log space is released and the queue manager continues to operate normally.

  • What happens when a disk gets full
    The queue manager logging component can cope with a full disk, and with full log files. If the disk containing the log fills, the queue manager issues message AMQ6709 and an error record is taken.
  • Manage log files
    Allocate sufficient space for the log files. For linear logging, we can delete old log files when they are no longer required.
  • Coldstart: What to do if log extents are missing or corrupt
    If your enterprise loses some or all of the log extents needed for restart recovery, the queue manager will be unable to replay the recovery log and so fails to restart. If you require your queue manager to restart when the recovery log is corrupt in any way, at the expense of maintaining data integrity, it is possible to do so, although strongly discouraged. This process is known as coldstarting a queue manager.

Parent topic: Logging: Making sure that messages are not lost