Sunday, 4 October 2026

What is Compensation Log Records (CLRs)

A Compensation Log Record (CLR) is a special transaction log record generated by SQL Server during a rollback operation. When SQL Server undoes a change, it logs the undo action itself as a CLR. This ensures that rollback operations are also recoverable. If SQL Server crashes while rolling back a transaction, recovery can continue from the point already undone rather than repeating the same undo work. CLRs are therefore a critical part of SQL Server's ARIES recovery algorithm and guarantee reliable crash recovery.

Many people think Rollback removes log records that is wrong. Rollback never removes log records. Instead, it adds more log records. Rollback is fully logged and generates Compensation Log Records.

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts