The UP tracks utilization summary information for all log files.
Unlike the UtilizationTracker, the UP is not accessed under the log write latch and is instead synchronized on itself for protecting the cache. It is not accessed during the primary data access path, except for when flushing (writing) file summary LNs. This occurs in the following cases:
- The summary information is flushed at the end of a checkpoint. This allows tracking to occur in memory in between checkpoints, and replayed during recovery.
- When committing the truncateDatabase and removeDatabase operations, the summary information is flushed because detail tracking for those operations is not replayed during recovery
- The evictor will ask the UtilizationTracker to flush the largest summary if the memory taken by the tracker exeeds its budget.
The cache is populated by the RecoveryManager just before performing the initial checkpoint. The UP must be open and populated in order to respond to requests to flush summaries and to evict tracked detail, even if the cleaner is disabled.
WARNING: While synchronized on this object, eviction is not permitted. If it were, this could cause deadlocks because the order of locking would be the UP object and then the evictor. During normal eviction the order is to first lock the evictor and then the UP, when evicting tracked detail.
The methods in this class synchronize to protect the cached summary information. Some methods also access the UP database. However, because eviction must not occur while synchronized, UP database access is not performed while synchronized except in one case: when inserting a new summary record. In that case we disallow eviction during the database operation.