Provided are a method, system, and program for maintaining data in a first
cache and second cache, wherein a backup cache maintains a backup copy of data
in the first cache, and wherein the first cache is used to cache a first set of
data in a storage system and the second cache is used to cache a second set of
data in the storage system. An unavailable state of the first cache is detected.
In response to detecting the unavailable state, requests to the first set of data
are blocked and at least one space in the second cache is allocated for data in
the backup cache. Requests to the first set of data are allowed to proceed after
the at least one space is allocated in the second cache and before the data in
the backup cache is copied to the at least one allocated space in the second cache.
The data from the backup cache is copied to the allocated at least one space in
the second cache after the requests to the first set of data are allowed to proceed.