Garbage collection and data storage method and apparatus, and storage system
AssigneeHuawei Technologies Co., Ltd.
InventorsYing Wang, Xiaobao Zhao
Life of this patent
Estimating the term…
Abstract
A data storage method and apparatus, and a storage system are provided. The method is applied to a storage system. The storage system includes at least one first memory and a second memory. The at least one first memory includes a plurality of storage areas. Garbage collection is performed based on each of the plurality of storage areas. In the method, a time length between the earliest expiration time and the latest expiration time in expiration time of valid data stored in a target storage area is limited to be less than or equal to a preset time length, so that the expiration time of the valid data stored in the target storage area is comparatively centralized.
Claims17
A data storage method comprising:
- after a data failure occurs in a second memory, recovering first data associated with the second memory of a storage system to obtain the first data, and obtaining an expiration time of the recovered first data associated with the second memory of the storage system;
- selecting, based on the expiration time of the recovered first data, a target storage area from a plurality of storage areas, wherein the plurality of storage areas belong to at least one first memory of the storage system;
- and
- sending at least a portion of the recovered first data to a first memory in which the target storage area is located, wherein
- after the at least a portion of the recovered first data is stored in the target storage area, the expiration time of the at least a portion of the recovered first data is between an earliest expiration time and a latest expiration time in expiration time of old data stored in the target area.
A storage system, the storage system comprising a processor configured to:
- after a data failure occurs in a second memory, obtain an expiration time of first data associated with the second memory of a storage system, and recover the first data associated with the second memory of a storage system;
- select, based on the expiration time of the recovered first data, a target storage area from a plurality of storage areas, wherein the plurality of storage areas belong to at least one first memory of the storage system;
- and
- send at least a portion of the recovered first data to a first memory in which the target storage area is located, wherein
- after the at least a portion of the recovered first data is stored in the target storage area, the expiration time of the at least a portion of the recovered first data is between an earliest expiration time and a latest expiration time in expiration time of old data stored in the target storage area.
Dependencies are inferred from the claim text.