Method, device, and computer program product for managing storage system
Embodiments of the present disclosure relate to a method, an electronic device, and a computer program product for managing a storage system. The method includes: determining multiple storage units provided by multiple storage devices, each storage unit in the multiple storage units having a storage space allocated from a first number of storage devices among the multiple storage devices; dividing the multiple storage units into at least one storage unit group based on a total number of the multiple storage devices and the first number, each storage unit group in the at least one storage unit group including a second number of storage units; and storing, based on a logical address of to-be-stored data, the to-be-stored data into the at least one storage unit group. Embodiments of the present disclosure can allocate storage resources more reasonably and thus improve the performance of a storage system for processing sequential data.
1. A method for managing a storage system, including:
determining multiple storage units provided by multiple storage devices, each storage unit in the multiple storage units having a storage space allocated from a first number of storage devices among the multiple storage devices;
dividing the multiple storage units into at least one storage unit group based on a total number of the multiple storage devices and the first number, each storage unit group in the at least one storage unit group including a second number of storage units, wherein for each storage unit group in the at least one storage unit group, the storage unit group has a storage space allocated from a third number of storage devices among the multiple storage devices, the third number equaling the first number multiplied by the second number, wherein each storage unit within a single storage unit group has storage space allocated from a unique subset of the multiple storage device; and
storing, based on a logical address of to-be-stored data, the to-be-stored data into the at least one storage unit group.
2. The method according to claim 1 , wherein dividing the multiple storage units into the at least one storage unit group includes:
determining, based on the total number of the multiple storage devices and the first number, a threshold number of storage unit groups that can be provided by the multiple storage devices;
determining the second number based on the threshold number and the total number of the multiple storage units; and
dividing the multiple storage units into the at least one storage unit group based on the second number.
3. The method according to claim 1 , wherein storing, based on a logical address of the to-be-stored data, the to-be-stored data into the at least one storage unit group includes:
determining an identifier for a storage unit group based on the logical address of the to-be-stored data, a size of the storage unit, and the second number; and
storing the to-be-stored data to a target storage unit group with the identifier in the at least one storage unit group.
4. The method according to claim 3 , wherein storing the to-be-stored data to a target storage unit group with the identifier in the at least one storage unit group includes:
storing, in an interlaced manner, multiple sequential data blocks included in the to-be-stored data into a second number of storage units in the target storage unit group.
5. The method according to claim 1 , further including:
updating the second number in response to an increase in the total number of the multiple storage devices;
determining whether the updated second number is greater than the second number before the update; and
determining at least one updated storage unit group if it is determined that the updated second number is greater than the second number before the update, each storage unit group in the at least one updated storage unit group having the updated second number of storage units.
6. The method according to claim 5 , wherein determining at least one updated storage unit group includes:
for each storage unit in the multiple storage units, determining whether the storage unit stores data; and
if it is determined that the storage unit has stored data, determining the storage unit, each of the other storage units in a storage unit group that included the storage unit before the update, and a fourth number of storage units having no data stored as an updated storage unit group, the fourth number being a difference between the updated second number and the second number before the update.
7. The method according to claim 5 , further including:
determining a storage unit group included stored data before the update, wherein the stored data included multiple data blocks; and
migrating, based on logical addresses of multiple data blocks included in stored data before the update, a size of the storage unit, and the updated second number, the multiple data blocks sequentially to the at least one updated storage unit group in an order of the logical addresses from small to large.
8. An electronic device, including:
at least one processor; and
at least one memory storing computer program instructions, which when executed by the at least one processor, cause the electronic device to perform actions, the actions including:
determining multiple storage units provided by multiple storage devices, each storage unit in the multiple storage units having a storage space allocated from a first number of storage devices among the multiple storage devices;
dividing the multiple storage units into at least one storage unit group based on a total number of the multiple storage devices and the first number, each storage unit group in the at least one storage unit group including a second number of storage units, wherein for each storage unit group in the at least one storage unit group, the storage unit group has a storage space allocated from a third number of storage devices among the multiple storage devices, the third number equaling the first number multiplied by the second number, wherein each storage unit within a single storage unit group has storage space allocated from a unique subset of the multiple storage device; and
storing, based on a logical address of to-be-stored data, the to-be-stored data into the at least one storage unit group.
9. The electronic device according to claim 8 , wherein dividing the multiple storage units into the at least one storage unit group includes:
determining, based on the total number of the multiple storage devices and the first number, a threshold number of storage unit groups that can be provided by the multiple storage devices;
determining the second number based on the threshold number and the total number of the multiple storage units; and
dividing the multiple storage units into the at least one storage unit group based on the second number.
10. The electronic device according to claim 8 , wherein storing, based on a logical address of the to-be-stored data, the to-be-stored data into the at least one storage unit group includes:
determining an identifier for a storage unit group based on the logical address of the to-be-stored data, a size of the storage unit, and the second number; and
storing the to-be-stored data to a target storage unit group with the identifier in the at least one storage unit group.
11. The electronic device according to claim 10 , wherein storing the to-be-stored data to a target storage unit group with the identifier in the at least one storage unit group includes:
storing, in an interlaced manner, multiple sequential data blocks included in the to-be-stored data into a second number of storage units in the target storage unit group.
12. The electronic device according to claim 8 , wherein the actions further include:
updating the second number in response to an increase in the total number of the multiple storage devices;
determining whether the updated second number is greater than the second number before the update; and
determining at least one updated storage unit group if it is determined that the updated second number is greater than the second number before the update, each storage unit group in the at least one updated storage unit group having the updated second number of storage units.
13. The electronic device according to claim 12 , wherein determining at least one updated storage unit group includes:
for each storage unit in the multiple storage units, determining whether the storage unit stores data; and
if it is determined that the storage unit has stored data, determining the storage unit, each of the other storage units in a storage unit group that included the storage unit before the update, and a fourth number of storage units having no data stored as an updated storage unit group, the fourth number being a difference between the updated second number and the second number before the update.
14. The electronic device according to claim 12 , wherein the actions further include:
determining a storage unit group included stored data before the update, wherein the stored data included multiple data blocks; and
migrating, based on logical addresses of multiple data blocks included in stored data before the update, a size of the storage unit, and the updated second number, the multiple data blocks sequentially to the at least one updated storage unit group in an order of the logical addresses from small to large.
15. A computer program product tangibly stored on a non-volatile computer-readable medium and including machine-executable instructions, which when executed by a device, cause the device to perform a method, the method comprising:
determining multiple storage units provided by multiple storage devices, each storage unit in the multiple storage units having a storage space allocated from a first number of storage devices among the multiple storage devices;
dividing the multiple storage units into at least one storage unit group based on a total number of the multiple storage devices and the first number, each storage unit group in the at least one storage unit group including a second number of storage units, wherein for each storage unit group in the at least one storage unit group, the storage unit group has a storage space allocated from a third number of storage devices among the multiple storage devices, the third number equaling the first number multiplied by the second number, wherein each storage unit within a single storage unit group has storage space allocated from a unique subset of the multiple storage device; and
storing, based on a logical address of to-be-stored data, the to-be-stored data into the at least one storage unit group.
16. The computer program product according to claim 15 , wherein dividing the multiple storage units into the at least one storage unit group includes:
determining, based on the total number of the multiple storage devices and the first number, a threshold number of storage unit groups that can be provided by the multiple storage devices;
determining the second number based on the threshold number and the total number of the multiple storage units; and
dividing the multiple storage units into the at least one storage unit group based on the second number.
17. The computer program product according to claim 15 , wherein storing, based on a logical address of the to-be-stored data, the to-be-stored data into the at least one storage unit group includes:
determining an identifier for a storage unit group based on the logical address of the to-be-stored data, a size of the storage unit, and the second number; and
storing the to-be-stored data to a target storage unit group with the identifier in the at least one storage unit group.
18. The computer program product according to claim 17 , wherein storing the to-be-stored data to a target storage unit group with the identifier in the at least one storage unit group includes:
storing, in an interlaced manner, multiple sequential data blocks included in the to-be-stored data into a second number of storage units in the target storage unit group.