WO2019062370A1 - 一种存储系统中垃圾回收的方法及装置 - Google Patents

一种存储系统中垃圾回收的方法及装置 Download PDF

Info

Publication number
WO2019062370A1
WO2019062370A1 PCT/CN2018/100738 CN2018100738W WO2019062370A1 WO 2019062370 A1 WO2019062370 A1 WO 2019062370A1 CN 2018100738 W CN2018100738 W CN 2018100738W WO 2019062370 A1 WO2019062370 A1 WO 2019062370A1
Authority
WO
WIPO (PCT)
Prior art keywords
fingerprint
mapping
virtual
unit number
controller
Prior art date
Application number
PCT/CN2018/100738
Other languages
English (en)
French (fr)
Inventor
布罗姆利格雷厄姆
张巍
余小安
张志雄
马特詹姆斯
蓝文海
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019062370A1 publication Critical patent/WO2019062370A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a method and an apparatus for garbage collection in a storage system.
  • GC Garbage Collection
  • the controller of the storage system scans the container mapping to find out which storage spaces corresponding to the containers can be released, and generates a virtual logical unit number (VLUN) remapping.
  • the controller needs to select in the virtual logical unit number remapping.
  • the remapping B1 related to the host A1 is sent, and the remapping B1 is sent to the host A1, so that the host A1 updates the pre-stored virtual logical unit number mapping based on the remapping B1; again, after the host A1 update is completed, the host A1 A notification that the update is complete is sent to the controller.
  • the controller will send remapping (B2, B3, ...) to multiple hosts (A2, A3, ...) in turn. It should be noted that the controller will send a remapping to the next host after the host update is completed.
  • the controller sequentially interacts with a plurality of hosts to update the virtual logical unit number mapping, resulting in low recovery efficiency.
  • the embodiments of the present application provide a method and an apparatus for garbage collection in a storage system to improve the recovery efficiency of the garbage collection technology.
  • the embodiment of the present application provides a method for garbage collection in a storage system, where the storage system includes a controller and a first container unit number, and the method includes:
  • the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number to the storage space corresponding to the storage address of the second container unit number;
  • the controller generates a virtual remapping according to the container mapping, where the container mapping is used to indicate that the storage address of the first container unit number points to the storage address of the first virtual logical unit number, and the virtual remapping includes the first virtual mapping and the second virtual mapping, first The virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the first container unit number, and the second virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the second container unit number;
  • the controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space can be accessed by at least two hosts;
  • the controller releases the storage space corresponding to the first container unit number.
  • the controller after the controller generates the virtual remapping according to the container mapping, the controller stores the virtual remapping into the target storage space, where the virtual remapping of the target storage space can be virtual remapping by at least two hosts, at least The two hosts can concurrently obtain related virtual remapping from the target storage space of the controller. At least two hosts can update their respective virtual maps independently according to the virtual remapping, thereby implementing updates of at least two hosts. Then, the controller can release the storage space corresponding to the first container unit number.
  • the controller stores the virtual remapping into the target storage space, at least two hosts do not need to process the virtual remapping sequentially, but independently process the virtual remapping in the target storage space to implement the first container unit number.
  • the parallel storage of the storage space corresponding to the storage address greatly improves the garbage collection efficiency.
  • the method before the controller releases the storage space corresponding to the first container unit number, the method further includes:
  • the controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping, where the fingerprint mapping is used to indicate that the fingerprint of the data block points to a storage address of the first container unit number, and the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping, and the first fingerprint mapping a storage address indicating that the fingerprint of the valid data block points to the first container unit number, and the second fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the second container unit number;
  • the controller stores the fingerprint remapping into the target storage space.
  • the method further includes:
  • the controller updates the fingerprint map stored by the controller according to the fingerprint remapping in the target storage space.
  • the method further includes:
  • the controller generates first fingerprint update information, where the first fingerprint update information is used to indicate whether the fingerprint mapping is successfully updated by the controller;
  • the controller stores the first fingerprint update information into the target storage space.
  • the controller may generate the fingerprint remapping according to the container mapping and the fingerprint mapping. After the controller generates fingerprint remapping, the fingerprint remapping can be stored in the target storage space.
  • the controller detects that there is fingerprint remapping in the target storage space, the controller remaps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space. Then, the controller stores the first fingerprint update information for indicating whether the fingerprint mapping is successfully updated by the controller into the target storage space.
  • the controller can process the fingerprint remapping in the target storage space in parallel to implement parallel recovery of the storage space corresponding to the storage address of the first container unit number. Further, the recycling efficiency of the garbage collection technology is greatly improved.
  • the fingerprint remapping of the target storage space is used for access by at least one fingerprint server.
  • the method further includes:
  • the controller receives the second fingerprint update information sent by the at least one fingerprint server, where the second fingerprint update information is used to indicate whether the fingerprint mapping is successfully updated by the at least one fingerprint server;
  • the controller stores the second fingerprint update information into the target storage space.
  • the controller may generate the fingerprint remapping according to the container mapping and the fingerprint mapping.
  • the fingerprint remapping can be stored in the target storage space.
  • the fingerprint server needs to delete the pre-stored first fingerprint mapping and add the second fingerprint mapping.
  • the fingerprint server updates the fingerprint mapping according to the fingerprint remapping, the fingerprint server sends to the controller second fingerprint update information indicating whether the fingerprint mapping is successfully updated by the fingerprint server. Then, the controller stores the second fingerprint update information into the target storage space.
  • At least one fingerprint server can process the fingerprint remapping in the target storage space in parallel to implement parallel storage space corresponding to the storage address of the first container unit number. Recycling, which greatly improves the recycling efficiency of waste recycling technology.
  • the container mapping further includes a first initial version number corresponding to the storage address of the first container unit number
  • the fingerprint mapping further includes a second initial version number corresponding to the storage address of the first container unit number
  • An initial version number is the same as the second initial version number
  • the method also includes:
  • the controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number, and the target version number is greater than the first initial version number;
  • the controller When the controller receives a reference request sent by the host and adds a valid data block to the storage address of the first container unit number, the controller determines a target version number corresponding to the storage address of the first container unit number in the container map, and Determining a second initial version number corresponding to a storage address of the first container unit number in the fingerprint mapping;
  • the fingerprint server in the controller deletes the fingerprint mapping corresponding to the first container unit number, or the controller rejects the increase sent by the host to the first A reference request for a valid data block in the storage address of the container unit number.
  • the controller After the controller remaps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space, the controller does not need to generate fingerprint update information for indicating whether the fingerprint mapping is successfully updated, and does not need to be in the target storage space.
  • the fingerprint update information is stored, and even if the controller fails to update the fingerprint mapping successfully, the recovery effect of the storage space corresponding to the first container unit number is not affected, thereby simplifying the garbage collection process and improving the recycling efficiency of the garbage collection technology.
  • the embodiment of the present application provides a method for garbage collection in a storage system, where the method includes: the host mounts a first virtual logical unit number; the host stores a first virtual mapping; and the first virtual mapping is used to indicate the first The storage address of the virtual logical unit points to the storage address of the first container unit number;
  • the host acquires a virtual remapping in a target storage space in the storage system, where the virtual remapping of the target storage space is accessible by at least two hosts, the virtual remapping includes a first virtual map and a second virtual map, and the second virtual map is used for Indicates that the storage address of the first virtual logical unit number points to the storage address of the second container unit number; the second container unit number stores the valid data in the first container unit number;
  • the host deletes the first virtual map and stores the second virtual map.
  • the controller stores the virtual remapping into the target storage space, where the virtual remapping of the target storage space can be virtual remapping by at least two hosts, at least The two hosts can concurrently obtain related virtual remapping from the target storage space of the controller. At least two hosts can update their respective virtual maps independently according to the virtual remapping, thereby implementing updates of at least two hosts. Then, the controller can release the storage space corresponding to the first container unit number.
  • the controller stores the virtual remapping into the target storage space, at least two hosts do not need to process the virtual remapping sequentially, but independently process the virtual remapping in the target storage space to implement the first container unit number.
  • the parallel storage of the storage space corresponding to the storage address greatly improves the garbage collection efficiency.
  • the embodiment of the present application provides a device for garbage collection in a storage system, where the device is applied to a storage system, where the storage system further includes a first container unit number, and the device includes:
  • a copying module configured to copy a data block in a storage space corresponding to a storage address of the first container unit number into a storage space corresponding to a storage address of the second container unit number;
  • a virtual remapping generating module configured to generate a virtual remapping according to the container mapping, where the container mapping is used to indicate that the storage address of the first container unit number points to a storage address of the first virtual logical unit number, and the virtual remapping includes the first virtual mapping and the first a virtual mapping, where the first virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the first container unit number, and the second virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the second container The storage address of the unit number;
  • a storage module configured to store the virtual remapping into the target storage space, where the virtual remapping of the target storage space is accessible by at least two hosts;
  • the release module is configured to release the storage space corresponding to the first container unit number.
  • the device further includes:
  • a fingerprint remapping generating module configured to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, where the fingerprint mapping is used to indicate that the fingerprint of the data block points to a storage address of the first container unit number, and the fingerprint remapping includes the first fingerprint mapping and the second fingerprint Mapping, the first fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the first container unit number, and the second fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the second container unit number; Stored in the target storage space.
  • the device further includes:
  • an update module configured to update the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
  • the device further includes:
  • the fingerprint update information generating module is configured to generate first fingerprint update information, where the first fingerprint update information is used to indicate whether the fingerprint mapping is successfully updated by the controller; and the first fingerprint update information is stored in the target storage space.
  • the fingerprint remapping of the target storage space is used for access by at least one fingerprint server.
  • the device further includes:
  • the receiving module is configured to receive second fingerprint update information sent by the at least one fingerprint server, where the second fingerprint update information is used to indicate whether the fingerprint mapping is successfully updated by the at least one fingerprint server; and the second fingerprint update information is stored in the target storage space.
  • the container mapping further includes a first initial version number corresponding to the storage address of the first container unit number
  • the fingerprint mapping further includes a second initial version number corresponding to the storage address of the first container unit number
  • An initial version number is the same as the second initial version number
  • the device further includes:
  • a modification module configured to modify a first initial version number corresponding to a storage address of the first container unit number in the container mapping to a target version number, where the target version number is greater than the first initial version number
  • a determining module configured to: when the controller receives a reference request sent by the host and add a valid data block of the storage address of the first container unit number, determine a target version corresponding to the storage address of the first container unit number in the container mapping And a second initial version number corresponding to the storage address of the first container unit number in the fingerprint mapping;
  • a deleting module configured to delete the fingerprint mapping corresponding to the first container unit number when the second initial version number is different from the target version number, or reject the storage address sent by the host to the storage address of the first container unit number A reference request for a valid data block.
  • an embodiment of the present application provides a device for garbage collection in a storage system, where the device includes:
  • a mounting module configured to mount the first virtual logical unit number; storing the first virtual mapping; the first virtual mapping is used to indicate that the storage address of the first virtual logical unit points to a storage address of the first container unit number;
  • An obtaining module configured to obtain a virtual remapping in a target storage space in the storage system, where the virtual remapping of the target storage space is accessible by at least two hosts, the virtual remapping includes a first virtual mapping and a second virtual mapping, and second The virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the second container unit number; the second container unit number stores the valid data in the first container unit number;
  • the deleting module is configured to delete the first virtual mapping and store the second virtual mapping.
  • an embodiment of the present application provides a controller, where the controller includes: a processor and a memory, wherein the memory stores an operation instruction executable by the processor, and the processor reads an operation instruction in the memory for the operation
  • the controller includes: a processor and a memory, wherein the memory stores an operation instruction executable by the processor, and the processor reads an operation instruction in the memory for the operation
  • the embodiment of the present application provides a host, where the host includes: a processor and a memory, wherein the memory stores an operation instruction executable by the processor, and the processor reads an operation instruction in the memory for implementing the The method described in the second aspect or any of the possible implementations of the second aspect.
  • FIG. 1 is a schematic diagram of a storage system and a host according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for garbage collection in a storage system according to an embodiment of the present application
  • FIG. 3 is a flowchart of a method for garbage collection in another storage system according to an embodiment of the present application
  • FIG. 4 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application
  • FIG. 5 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 6 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 7 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of another apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of another apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of a storage system and a host according to an embodiment of the present application.
  • the computer cluster 10 and the storage system 20 are included in the scenario diagram shown in FIG. 1.
  • the computer cluster 10 includes a plurality of hosts, such as a host 11, a host 12, and a host 13, and the storage system 20 includes a controller 21, a controller 22, and a controller.
  • a plurality of controllers, such as 23, the storage system further includes a memory 31, a memory 32, a memory 33, and the like.
  • the controller 21 manages the container unit number of the memory 31
  • the controller 22 manages the container unit number of the memory 32
  • the controller 23 manages the container unit number of the memory 33.
  • the fingerprint server may be disposed inside the controller or external to the controller, so the fingerprint server is not shown in FIG.
  • the memory may be a solid state hard disk, a mechanical hard disk, or the like, and the memory type is not specifically limited in the present invention.
  • each host mounts a virtual logical unit number (hereinafter referred to as a virtual logical unit number as a VLUN).
  • the size of the storage space corresponding to each VLUN can be set by the user of each host. set.
  • the storage space corresponding to each VLUN is divided into a plurality of storage units, each of which is used to store data blocks, and each storage unit can be indicated by using a logical block address (hereinafter referred to as a logical block address is simply referred to as LBA).
  • LBA logical block address
  • the user of the host 11 sets the storage space of the VLUN 1 to 1 GB, and divides the 1 GB storage space into a plurality of storage units, each of which is 512 bytes or 4 Kbytes.
  • each controller In combination with the scenario shown in Figure 1, each controller generates a plurality of container unit numbers in advance (hereinafter, the container unit number is simply referred to as a PLUN), and allocates a certain storage space for each PLUN, and the storage corresponding to each PLUN.
  • the space is divided into a plurality of storage units, each of which is used to store data blocks, each of which can be indicated by an LBA.
  • the controller 21 allocates 1 GB of storage space for the PLUN 1, allocates the 1 GB of storage space to the memory 31, and divides the memory 31 into a plurality of storage units, each of which is 512 bytes or 4 Kbytes.
  • the host 11 calculates that the fingerprint of the data A is FP1 and transmits the fingerprint FP1 to the fingerprint server.
  • the fingerprint server may be integrated inside the controller or may be separately disposed outside the controller.
  • the fingerprint server will determine whether the fingerprint FP1 has been stored in advance.
  • the fingerprint server determines that the fingerprint FP1 is pre-stored, the fingerprint server sends the storage address (PLUN1, LBA1, 4KB) of the container unit number corresponding to the fingerprint FP1 to the host 11; since the PLUN1 belongs to the controller 21, the host 11 will Sending a reference request for a data block in a storage space corresponding to one (PLUN1, LBA1, 4KB) to the controller 21, wherein a storage space corresponding to (PLUN1, LBA1, 4KB) is one storage unit of the memory 31; the controller 21 Will agree to the reference request and establish a container mapping (PLUN1, LBA1, 4KB->VLUN1, LBA1, 4KB); host 11 will establish a virtual mapping (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB).
  • the fingerprint server determines that the fingerprint FP1 has not been stored, the fingerprint server sends an instruction to the host 11 that the FP1 has not been stored; after receiving the instruction, the host 11 requests the controller 21 for a PLUN corresponding to (VLUN1, LBA1); The controller 21 sends a new storage address (PLUN1, LBA2, 4KB) to the host 11, and no storage space is stored in the storage space corresponding to (PLUN1, LBA2, 4KB), wherein (PLUN1, LBA2, 4KB) corresponds to the storage space.
  • VLUN1, LBA1 VLUN1, LBA1
  • the controller 21 sends a new storage address (PLUN1, LBA2, 4KB) to the host 11, and no storage space is stored in the storage space corresponding to (PLUN1, LBA2, 4KB), wherein (PLUN1, LBA2, 4KB) corresponds to the storage space.
  • the controller 21 establishes a container mapping (PLUN1, LBA2, 4KB->VLUN1, LBA1, 4KB); the host 11 establishes a virtual mapping (VLUN1, LBA1, 4KB->PLUN1, LBA2, 4KB);
  • the fingerprint server establishes fingerprint mapping (FP1->PLUN1, LBA2, 4KB).
  • the host 11 can use the storage space corresponding to the PLUN 1 of the controller 21
  • the host 12 and the host 13 in the computer cluster 10 can also use the PLUN 1 corresponding to the controller 21 .
  • Storage space can also use the storage space corresponding to the PLUNs belonging to the controllers such as the controller 22 and the controller 23 in the storage system 20.
  • FIG. 2 is a flowchart of a method for garbage collection in a storage system according to an embodiment of the present application.
  • each host does not need to process the virtual remapping sequentially, but independently processes the virtual remapping in the target storage space to implement Parallel recovery of the storage space corresponding to the storage address of the first container unit number, thereby greatly improving the garbage collection efficiency.
  • the method includes the following steps.
  • Step S11 The controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number.
  • the method for garbage collection provided by the embodiment of the present application can be applied to a storage system.
  • the storage system can include a controller and a first container unit number.
  • the host Before the step S11, the host has established a first virtual mapping, the first virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the first container unit number, and the controller has also established the container mapping, and the container mapping The storage address indicating the first container unit number points to the storage address of the first virtual logical unit number.
  • step S11 the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number to the storage space corresponding to the storage address of the second container unit number, indicating that the controller needs to release the first container.
  • the storage space corresponding to the unit number so it is necessary to copy the valid data block in the first container unit number to the storage space corresponding to the storage address of the second container unit number.
  • the container mapping is (PLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB), and the first virtual logical unit number is VLUN1.
  • the storage address of the first virtual logical unit number is (VLUN1, LBA1, 4KB), the first container unit number is PLUN1, the storage address of the first container unit number is (PLUN1, LBA1, 4KB), and the second container unit number is PLUN2.
  • the storage address of the second container unit number is (PLUN2, LBA1, 4KB).
  • the valid data block is stored in the storage space corresponding to (PLUN1, LBA1, 4KB).
  • the controller needs to release the storage space corresponding to PLUN1, the controller needs to store the corresponding storage (PLUN1, LBA1, 4KB) first.
  • the valid data blocks in the space are copied to the storage space corresponding to (PLUN2, LBA1, 4KB), and the PLUN1 is ready to be released.
  • Step S12 The controller generates a virtual remapping according to the container mapping.
  • the controller After the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number to the storage space corresponding to the storage address of the second container unit number, the controller further needs to generate a virtual weight according to the container mapping. Map so that at least two hosts can update the virtual map based on the virtual remapping.
  • the virtual remapping includes a first virtual map and a second virtual map, where the first virtual map is used to indicate that the storage address of the first virtual logical unit number points to a storage address of the first container unit number, and the second virtual map is used to indicate the first virtual map The storage address of the logical unit number points to the storage address of the second container unit number.
  • the first virtual map is used to indicate a virtual map that at least two hosts need to delete, and the second virtual map is used to indicate that at least two hosts need to be added with a virtual map.
  • the virtual remapping includes a first virtual map and a second virtual map
  • the first virtual map is (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB)
  • the second virtual map is (VLUN1, LBA1, 4KB->PLUN2, LBA1, 4KB).
  • Step S13 The controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space is accessible by at least two hosts.
  • the controller After the controller generates the virtual remapping according to the container mapping, the controller needs to store the virtual remapping into the target storage space, so that at least two hosts can actively obtain the virtual remapping in the target storage space.
  • Virtual remapping can be stored in the target storage space in the form of files, documents, or logs.
  • the target storage space in the controller is not limited to one, and may be plural.
  • the amount of target storage space and the size of each target storage space can be automatically configured by the controller or configured in advance by the staff.
  • the host that references the storage address of the first container unit number can actively obtain the virtual remapping in the target storage space to update the first virtual mapping of the host itself.
  • the first virtual mapping previously stored by the host 11 is (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB), and the PLUN1 belongs to the controller 21.
  • the controller 21 stores the virtual remapping to the target storage space, both the host 11 and the host that references the storage address of the PLUN 1 actively acquire the virtual remapping in the target storage space.
  • the virtual remapping includes a first virtual mapping and a second virtual mapping.
  • the first virtual mapping is (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB)
  • the second virtual mapping is (VLUN1, LBA1, 4KB->PLUN2, LBA1 4KB)
  • the first virtual mapping is a virtual mapping that the host 11 needs to delete
  • the second virtual mapping is a virtual mapping that the host 11 needs to add.
  • the host 11 After the host 11 obtains the virtual remapping, the host 11 deletes the first virtual map (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB) stored in advance, and stores the second virtual map (VLUN1, LBA1, 4KB-> PLUN2, LBA1, 4KB), indicating that the storage address (VLUN1, LBA1, 4KB) of the first virtual logical unit number of the host 11 no longer points to the storage address (PLUN1, LBA1, 4KB) of the first container unit number, but points to The storage address of the second container unit number (PLUN2, LBA1, 4KB).
  • the storage address of the first container unit number and the storage address of the second container unit number may each include multiple pieces of information, and is not limited to one piece of information.
  • the storage address of the first container unit number includes (PLUN1, LBA1, 4KB), (PLUN1, LBA2, 4KB), (PLUN1, LBA3, 4KB), and (PLUN1, LBA4, 4KB), etc.; Storage addresses include (PLUN2, LBA1, 4KB), (PLUN2, LBA2, 4KB), (PLUN2, LBA3, 4KB), and (PLUN2, LBA4, 4KB).
  • the container mapping, the first virtual mapping, and the second virtual mapping may include multiple mappings, and is not limited to one mapping.
  • the container mapping includes (PLUN1, LBA1, 4KB->VLUN1, LBA1, 4KB), (PLUN1, LBA2, 4KB->VLUN1, LBA2, 4KB), (PLUN1, LBA3, 4KB->VLUN1, LBA3, 4KB) and (PLUN1, LBA4, 4KB->VLUN1, LBA4, 4KB);
  • the first virtual mapping includes (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB), (VLUN1, LBA2, 4KB->PLUN1, LBA2, 4KB) (VLUN1, LBA3, 4KB->PLUN1, LBA3, 4KB) and (VLUN1, LBA4, 4KB->PLUN1, LBA4, 4KB);
  • the second virtual mapping includes (VLUN1, LBA1, 4KB->PLUN2, LBA1, 4KB ), (VLUN1, LBA2, 4KB->PLUN2, LBA2, 4KB), (VLUN1, LBA3, 4KB->PLUN2, LBA3, 4KB) and (VLUN1, LBA4, 4KB->PL
  • Step S14 The controller releases the storage space corresponding to the first container unit number.
  • the controller After the host that validates the valid data block of the storage address of the first container unit number is successfully updated according to the virtual remapping, the controller further needs to update the container mapping associated with the storage address of the first container unit number, and the fingerprint server It is also necessary to update the fingerprint mapping associated with the storage address of the first container unit number. After the related information such as the virtual mapping, the fingerprint mapping, and the container mapping associated with the first container unit number is completely updated, the controller may release the storage space corresponding to the first container unit number.
  • the controller stores the virtual remapping into the target storage space, where the virtual remapping of the target storage space can be accessed by at least two hosts. Remapping, at least two hosts can concurrently obtain related virtual remapping from the target storage space of the controller. At least two hosts can update their respective virtual mappings independently according to the virtual remapping, thereby implementing updates of at least two hosts. Then, the controller can release the storage space corresponding to the first container unit number.
  • the controller stores the virtual remapping into the target storage space, at least two hosts do not need to process the virtual remapping sequentially, but independently process the virtual remapping in the target storage space to implement the first container unit number.
  • the parallel storage of the storage space corresponding to the storage address greatly improves the garbage collection efficiency.
  • FIG. 3 is a flowchart of a method for garbage collection in another storage system according to an embodiment of the present application.
  • the embodiment shown in Fig. 3 is an improved embodiment based on Fig. 2, so the same contents as Fig. 2 can be seen in the embodiment shown in Fig. 2.
  • the method shown in Figure 3 includes the following steps.
  • Step S21 The controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number.
  • Step S22 The controller generates a virtual remapping according to the container mapping.
  • Step S23 The controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space is accessible by at least two hosts.
  • Step S24 The controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
  • the controller After the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number, the controller further needs to map according to the container and the fingerprint.
  • a fingerprint remapping is generated so that the controller can update the virtual map based on the fingerprint remapping.
  • the fingerprint mapping is used to indicate that the fingerprint of the data block points to the storage address of the first container unit number
  • the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping
  • the first fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the first container unit
  • the second fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the second container unit number.
  • the first fingerprint mapping is used to indicate the fingerprint mapping that the controller needs to delete
  • the second fingerprint mapping is used to indicate that the controller needs to increase the fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • Step S25 The controller stores the fingerprint remapping into the target storage space.
  • Fingerprint remapping can be stored in the target storage space in the form of files, documents, or logs.
  • Step S26 The controller updates the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
  • the controller when the controller detects that there is fingerprint remapping in the target storage space, the controller needs to delete the pre-stored first fingerprint mapping and add the second fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • the controller detects fingerprint remapping in the target storage space, the controller needs to delete the pre-stored first fingerprint mapping (FP1->PLUN1, LBA1, 4KB) and add the second fingerprint mapping (FP1->PLUN2, LBA1) , 4KB).
  • Step S27 The controller generates first fingerprint update information, where the first fingerprint update information is used to indicate whether the fingerprint mapping is successfully updated by the controller.
  • the controller After the controller re-maps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space, the controller needs to generate first fingerprint update information to indicate whether the fingerprint mapping is successfully updated by the controller. If the fingerprint mapping is successfully updated by the controller, the first fingerprint update information is used to indicate that the fingerprint mapping is successfully updated by the controller; if the fingerprint mapping is failed to be updated by the controller, the first fingerprint update information is used to indicate that the fingerprint mapping is updated by the controller. failure.
  • Step S28 The controller stores the first fingerprint update information into the target storage space.
  • the controller may store the first fingerprint update information in the target storage space, so that the controller determines whether the first fingerprint update information and the related update information can be released.
  • the storage space corresponding to a container unit number.
  • the controller may release the storage space corresponding to the first container unit number.
  • Step S29 The controller releases the storage space corresponding to the first container unit number.
  • the controller since the controller pre-stores the container mapping and fingerprint mapping corresponding to the first container unit number, the controller can generate fingerprint remapping according to the container mapping and the fingerprint mapping. After the controller generates fingerprint remapping, the fingerprint remapping can be stored in the target storage space. When the controller detects that there is fingerprint remapping in the target storage space, the controller remaps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space. Then, the controller stores the first fingerprint update information for indicating whether the fingerprint mapping is successfully updated by the controller into the target storage space.
  • the controller may use the multi-thread parallel processing of the fingerprint remapping in the target storage space to implement the storage space corresponding to the storage address of the first container unit number.
  • Parallel recycling which greatly improves the recycling efficiency of garbage recycling technology.
  • FIG. 4 is a flowchart of another method for garbage collection in a storage system according to an embodiment of the present application.
  • the embodiment shown in Fig. 4 is an improved embodiment based on Fig. 2, so the same content as Fig. 2 can be seen in the embodiment shown in Fig. 2.
  • the fingerprint server is located inside the controller.
  • the method shown in Figure 4 includes the following steps.
  • Step S31 The controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number.
  • Step S32 The controller generates a virtual remapping according to the container mapping.
  • Step S33 The controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space is accessible by at least two hosts.
  • Step S34 The controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
  • the controller After the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number, the controller further needs to map according to the container and the fingerprint.
  • a fingerprint remapping is generated so that the controller can update the virtual map based on the fingerprint remapping.
  • the fingerprint mapping is used to indicate that the fingerprint of the data block points to the storage address of the first container unit number
  • the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping
  • the first fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the first container unit
  • the second fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the second container unit number.
  • the first fingerprint mapping is used to indicate the fingerprint mapping that the controller needs to delete
  • the second fingerprint mapping is used to indicate that the controller needs to increase the fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • Step S35 The controller stores the fingerprint remapping into the target storage space.
  • Fingerprint remapping can be stored in the target storage space in the form of files, documents, or logs.
  • Step S36 The controller remaps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space.
  • the controller needs to update the fingerprint mapping stored by the controller according to the fingerprint remapping when the controller detects the fingerprint remapping in the target storage space, that is, the controller needs to delete the pre-stored first fingerprint mapping and add the second fingerprint. Mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • the controller detects fingerprint remapping in the target storage space, the controller needs to delete the pre-stored first fingerprint mapping (FP1->PLUN1, LBA1, 4KB) and add the second fingerprint mapping (FP1->PLUN2, LBA1) , 4KB).
  • the controller may fail to update, that is, the controller cannot successfully delete the first fingerprint mapping, and the second fingerprint mapping cannot be successfully added. Even if the controller fails to update, it will not affect the controller to release the storage space corresponding to the first container unit number.
  • Step S37 The controller releases the storage space corresponding to the first container unit number.
  • the controller When the controller receives the notification of successfully updating the virtual remapping sent by the host, it indicates that the host has deleted the first virtual mapping and adds the second virtual mapping, and then the controller can release the first container unit number. The storage space does not need to consider whether the fingerprint remapping is updated successfully.
  • Step S38 The controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number, and the target version number is greater than the first initial version number.
  • the container mapping further includes a first initial version number corresponding to the storage address of the first container unit number
  • the fingerprint mapping further includes a second initial version number corresponding to the storage address of the first container unit number, the first initial The version number is the same as the second initial version number.
  • the controller After the controller releases the storage space corresponding to the first container unit number, the controller needs to modify the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number, and the target version number is further Will be greater than the first initial version number.
  • the purpose of this is that if the controller fails to update the fingerprint mapping, that is, the controller cannot successfully delete the first fingerprint mapping, and cannot successfully add the second fingerprint mapping, at least the version number in the container mapping can be guaranteed.
  • the version number of the first fingerprint map pre-stored by the controller is different, and is used to indicate that the fingerprint mapping update fails.
  • Step S39 when the controller receives a reference request for adding a valid data block in the storage address of the first container unit number sent by the host, the controller determines the target corresponding to the storage address of the first container unit number in the container mapping. a version number, and a second initial version number corresponding to a storage address of the first container unit number in the fingerprint mapping.
  • the controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container map to the target version number, if a host sends the storage to the controller to increase the storage of the first container unit number The reference request of the valid data block in the address, then the controller needs to determine the target version number corresponding to the storage address of the first container unit number in the container map, and determine the storage address corresponding to the first container unit number in the fingerprint map. Second initial version number.
  • Step S40 When the second initial version number is different from the target version number, the fingerprint server in the controller deletes the fingerprint mapping corresponding to the first container unit number.
  • the controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number. If the controller fails to update the fingerprint mapping, the first fingerprint mapping will not be deleted, and the version number in the container mapping is different from the version number of the first fingerprint mapping stored in advance by the controller, so the second initial The version number is different from the target version number.
  • the controller rejects the reference request sent by the host to increase the valid data block in the storage address of the first container unit number; the host detects that the controller refuses to increase once to the first When the reference request of the valid data block in the storage address of the container unit number is requested, the host sends a deletion instruction for deleting the fingerprint mapping corresponding to the first container unit number to the fingerprint server in the controller; the fingerprint server in the controller receives the host sending When the delete command is issued, the fingerprint server deletes the fingerprint map corresponding to the first container unit number.
  • the controller after the controller remaps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space, the controller does not need to generate fingerprint update information indicating whether the fingerprint mapping is successfully updated. It is also unnecessary to store the fingerprint update information in the target storage space, even if the controller fails to update the fingerprint mapping successfully, the recovery effect of the storage space corresponding to the first container unit number is not affected, thereby simplifying the garbage collection process and improving The recycling efficiency of garbage collection technology.
  • FIG. 5 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application.
  • the embodiment shown in Fig. 5 is an improved embodiment based on Fig. 2, so the same content as Fig. 2 can be seen in the embodiment shown in Fig. 2.
  • the method shown in Figure 5 includes the following steps.
  • Step S41 The controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number.
  • Step S42 The controller generates a virtual remapping according to the container mapping.
  • Step S43 The controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space is accessible by at least two hosts.
  • Step S44 The controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
  • the controller After the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number, the controller further needs to map according to the container and the fingerprint.
  • a fingerprint remapping is generated so that the controller can update the virtual map based on the fingerprint remapping.
  • the fingerprint mapping is used to indicate that the fingerprint of the data block points to the storage address of the first container unit number
  • the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping
  • the first fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the first container unit
  • the second fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the second container unit number.
  • the first fingerprint mapping is used to indicate the fingerprint mapping that the controller needs to delete
  • the second fingerprint mapping is used to indicate that the controller needs to increase the fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • Step S45 The controller stores the fingerprint remapping into the target storage space, where the fingerprint remapping of the target storage space is used for access by at least one fingerprint server.
  • the controller After the controller generates the fingerprint remapping according to the container mapping and the fingerprint mapping, the controller needs to store the fingerprint remapping into the target storage space, so that the fingerprint remapping of the target storage space can be accessed by at least one fingerprint server. Fingerprint remapping can be stored in the target storage space in the form of files, documents, or logs.
  • the fingerprint server After the fingerprint server obtains the fingerprint remapping of the target storage space, the fingerprint server needs to delete the pre-stored first fingerprint mapping and add the second fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • the fingerprint server needs to delete the pre-stored first fingerprint mapping (FP1->PLUN1, LBA1, 4KB), and add the second fingerprint mapping (FP1->PLUN2, LBA1, 4KB).
  • Step S46 The controller receives the second fingerprint update information sent by the at least one fingerprint server, where the second fingerprint update information is used to indicate whether the fingerprint mapping is successfully updated by the at least one fingerprint server.
  • the fingerprint server After the fingerprint server updates the fingerprint mapping according to the fingerprint remapping, the fingerprint server needs to generate second fingerprint update information to indicate whether the fingerprint mapping is successfully updated by the fingerprint server. If the fingerprint mapping is successfully updated by the fingerprint server, the first fingerprint update information is used to indicate that the fingerprint mapping is successfully updated by the fingerprint server; if the fingerprint mapping is failed to be updated by the fingerprint server, the first fingerprint update information is used to indicate that the fingerprint mapping is updated by the fingerprint server. failure.
  • the fingerprint server After the fingerprint server generates the second fingerprint update information, the fingerprint server sends the second fingerprint update information to the controller. At this point, the controller receives the second fingerprint update information sent by the fingerprint server.
  • Step S47 The controller stores the second fingerprint update information into the target storage space.
  • the controller may store the second fingerprint update information in the target storage space, so that the controller can update the information according to the second fingerprint update information. It is determined whether the storage space corresponding to the first container unit number can be released.
  • the controller may release the storage space corresponding to the first container unit number.
  • Step S48 The controller releases the storage space corresponding to the first container unit number.
  • the controller since the controller pre-stores the container mapping and fingerprint mapping corresponding to the first container unit number, the controller can generate fingerprint remapping according to the container mapping and the fingerprint mapping. After the controller generates fingerprint remapping, the fingerprint remapping can be stored in the target storage space. After the fingerprint server obtains the fingerprint remapping of the target storage space, the fingerprint server needs to delete the pre-stored first fingerprint mapping and add the second fingerprint mapping. After the fingerprint server updates the fingerprint mapping according to the fingerprint remapping, the fingerprint server sends to the controller second fingerprint update information indicating whether the fingerprint mapping is successfully updated by the fingerprint server. Then, the controller stores the second fingerprint update information into the target storage space.
  • At least one fingerprint server can process the fingerprint remapping in the target storage space in parallel to implement parallel storage space corresponding to the storage address of the first container unit number. Recycling, which greatly improves the recycling efficiency of waste recycling technology.
  • FIG. 6 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application.
  • the embodiment shown in Fig. 6 is an improved embodiment based on Fig. 2, so the same content as Fig. 2 can be seen in the embodiment shown in Fig. 2.
  • the fingerprint server and controller belong to two separate devices.
  • the method shown in Figure 6 includes the following steps.
  • Step S51 The controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number.
  • Step S52 The controller generates a virtual remapping according to the container mapping.
  • Step S53 The controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space is accessible by at least two hosts.
  • Step S54 The controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
  • the controller After the controller copies the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number, the controller further needs to map according to the container and the fingerprint.
  • a fingerprint remapping is generated so that the controller can update the virtual map based on the fingerprint remapping.
  • the fingerprint mapping is used to indicate that the fingerprint of the data block points to the storage address of the first container unit number
  • the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping
  • the first fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the first container unit
  • the second fingerprint mapping is used to indicate that the fingerprint of the valid data block points to the storage address of the second container unit number.
  • the first fingerprint mapping is used to indicate the fingerprint mapping that the controller needs to delete
  • the second fingerprint mapping is used to indicate that the controller needs to increase the fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • Step S55 The controller stores the fingerprint remapping into the target storage space, and the fingerprint remapping of the target storage space is used to be accessed by the at least one fingerprint server.
  • the controller After the controller generates the fingerprint remapping according to the container mapping and the fingerprint mapping, the controller needs to store the fingerprint remapping into the target storage space, so that the fingerprint remapping is accessed by the at least one fingerprint server. Fingerprint remapping can be stored in the target storage space in the form of files, documents, or logs.
  • the fingerprint server may update the fingerprint mapping stored by the fingerprint server according to the fingerprint remapping, that is, the fingerprint server needs to delete the pre-stored first fingerprint mapping and add the second fingerprint mapping.
  • the fingerprint remapping includes the first fingerprint mapping and the second fingerprint mapping, and the first fingerprint mapping is (FP1->PLUN1, LBA1, 4KB)
  • the second fingerprint is mapped to (FP1->PLUN2, LBA1, 4KB).
  • the fingerprint server needs to delete the pre-stored first fingerprint mapping (FP1->PLUN1, LBA1, 4KB), and add the second fingerprint mapping (FP1->PLUN2, LBA1, 4KB).
  • the fingerprint server may fail to update, that is, the fingerprint server cannot successfully delete the first fingerprint mapping, and the second fingerprint mapping cannot be successfully added. Even if the fingerprint server fails to update, it will not affect the controller to release the storage space corresponding to the first container unit number.
  • Step S56 The controller releases the storage space corresponding to the first container unit number.
  • the controller When the controller receives the notification of successfully updating the virtual remapping sent by the host, it indicates that the host has deleted the first virtual mapping and adds the second virtual mapping, and then the controller can release the first container unit number. The storage space does not need to consider whether the fingerprint remapping is updated successfully.
  • Step S57 The controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number, and the target version number is greater than the first initial version number.
  • the container mapping further includes a first initial version number corresponding to the storage address of the first container unit number
  • the fingerprint mapping further includes a second initial version number corresponding to the storage address of the first container unit number, the first initial The version number is the same as the second initial version number.
  • the controller After the controller releases the storage space corresponding to the first container unit number, the controller needs to modify the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number, and the target version number is further Will be greater than the first initial version number.
  • the purpose of this is that if the fingerprint server fails to update the fingerprint mapping, that is, the fingerprint server method successfully deletes the first fingerprint mapping, and the second fingerprint mapping cannot be successfully added, at least the version number in the container mapping can be guaranteed.
  • the version number of the first fingerprint map pre-stored by the controller is different, and is used to indicate that the fingerprint mapping update fails.
  • Step S58 when the controller receives a reference request sent by the host and adds a valid data block in the storage address of the first container unit number, the controller determines a target corresponding to the storage address of the first container unit number in the container mapping. a version number, and a second initial version number corresponding to a storage address of the first container unit number in the fingerprint mapping.
  • the controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container map to the target version number, if a host sends the storage to the controller to increase the storage of the first container unit number The reference request of the valid data block in the address, then the controller needs to determine the target version number corresponding to the storage address of the first container unit number in the container map, and determine the storage address corresponding to the first container unit number in the fingerprint map. Second initial version number.
  • Step S59 When the second initial version number is different from the target version number, the controller rejects the reference request sent by the host to increase the valid data block in the storage address of the first container unit number, so that the host sends the deletion to the fingerprint server.
  • the fingerprint mapping deletion instruction corresponding to the first container unit number, and the fingerprint server deletes the fingerprint mapping corresponding to the first container unit number according to the deletion instruction.
  • the controller modifies the first initial version number corresponding to the storage address of the first container unit number in the container mapping to the target version number. If the fingerprint server fails to update the fingerprint mapping, the first fingerprint mapping is not deleted, and the version number in the container mapping is different from the version number of the first fingerprint mapping stored in advance by the fingerprint server, so the second initial The version number is different from the target version number.
  • the controller rejects the reference request sent by the host to increase the valid data block in the storage address of the first container unit number; the host detects that the controller refuses to increase once to the first
  • the host sends a deletion instruction for deleting the fingerprint mapping corresponding to the first container unit number to the fingerprint server; when the fingerprint server receives the deletion instruction sent by the host, the fingerprint server will Delete the fingerprint mapping corresponding to the first container unit number.
  • the controller after the controller remaps the fingerprint mapping stored by the controller according to the fingerprint in the target storage space, the controller does not need to generate fingerprint update information indicating whether the fingerprint mapping is successfully updated. It is also unnecessary to store the fingerprint update information in the target storage space, even if the controller fails to update the fingerprint mapping successfully, the recovery effect of the storage space corresponding to the first container unit number is not affected, thereby simplifying the garbage collection process and improving The recycling efficiency of garbage collection technology.
  • FIG. 7 is a flowchart of still another method for garbage collection in a storage system according to an embodiment of the present application.
  • each host does not need to process the virtual remapping in turn, but independently processes the virtual remapping in the target storage space to implement Parallel recovery of the storage space corresponding to the storage address of the first container unit number, thereby greatly improving the garbage collection efficiency.
  • the method includes the following steps.
  • Step S61 The host mounts the first virtual logical unit number, and the host stores a first virtual mapping, where the first virtual mapping is used to indicate that the storage address of the first virtual logical unit points to a storage address of the first container unit number.
  • the first virtual mapping is (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB)
  • the first virtual logical unit number is VLUN1
  • the storage address of the first virtual logical unit number is (VLUN1, LBA1, 4KB).
  • the storage address of the first container unit number is (PLUN1, LBA1, 4KB).
  • Step S62 The host acquires a virtual remapping in a target storage space in the storage system, where the virtual remapping of the target storage space is accessed by at least two hosts, and the virtual remapping includes a first virtual mapping and a second virtual mapping, and the second virtual The mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the second container unit number; the second container unit number stores the valid data in the first container unit number.
  • the controller After the controller generates the virtual remapping according to the container mapping, the controller needs to store the virtual remapping into the target storage space, so that at least two hosts can actively obtain the virtual remapping in the target storage space.
  • Virtual remapping can be stored in the target storage space in the form of files, documents, or logs.
  • the host that references the storage address of the first container unit number can actively obtain the virtual remapping in the target storage space to update the first virtual mapping of the host itself.
  • the first virtual mapping previously stored by the host 11 is (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB), and the PLUN1 belongs to the controller 21.
  • the controller 21 stores the virtual remapping to the target storage space, both the host 11 and the host that references the storage address of the PLUN 1 actively acquire the virtual remapping in the target storage space.
  • the virtual remapping includes a first virtual mapping and a second virtual mapping.
  • the first virtual mapping is (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB)
  • the second virtual mapping is (VLUN1, LBA1, 4KB->PLUN2, LBA1 4KB)
  • the first virtual mapping is a virtual mapping that the host 11 needs to delete
  • the second virtual mapping is a virtual mapping that the host 11 needs to add.
  • the host 11 After the host 11 obtains the virtual remapping, the host 11 deletes the first virtual map (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB) stored in advance, and stores the second virtual map (VLUN1, LBA1, 4KB-> PLUN2, LBA1, 4KB), indicating that the storage address (VLUN1, LBA1, 4KB) of the first virtual logical unit number of the host 11 no longer points to the storage address (PLUN1, LBA1, 4KB) of the first container unit number, but points to The storage address of the second container unit number (PLUN2, LBA1, 4KB).
  • the storage address of the first container unit number and the storage address of the second container unit number may each include multiple pieces of information, and is not limited to one piece of information.
  • the storage address of the first container unit number includes (PLUN1, LBA1, 4KB), (PLUN1, LBA2, 4KB), (PLUN1, LBA3, 4KB), and (PLUN1, LBA4, 4KB), etc.; Storage addresses include (PLUN2, LBA1, 4KB), (PLUN2, LBA2, 4KB), (PLUN2, LBA3, 4KB), and (PLUN2, LBA4, 4KB).
  • the container mapping, the first virtual mapping, and the second virtual mapping may include multiple mappings, and is not limited to one mapping.
  • the container mapping includes (PLUN1, LBA1, 4KB->VLUN1, LBA1, 4KB), (PLUN1, LBA2, 4KB->VLUN1, LBA2, 4KB), (PLUN1, LBA3, 4KB->VLUN1, LBA3, 4KB) and (PLUN1, LBA4, 4KB->VLUN1, LBA4, 4KB);
  • the first virtual mapping includes (VLUN1, LBA1, 4KB->PLUN1, LBA1, 4KB), (VLUN1, LBA2, 4KB->PLUN1, LBA2, 4KB) (VLUN1, LBA3, 4KB->PLUN1, LBA3, 4KB) and (VLUN1, LBA4, 4KB->PLUN1, LBA4, 4KB);
  • the second virtual mapping includes (VLUN1, LBA1, 4KB->PLUN2, LBA1, 4KB ), (VLUN1, LBA2, 4KB->PLUN2, LBA2, 4KB), (VLUN1, LBA3, 4KB->PLUN2, LBA3, 4KB) and (VLUN1, LBA4, 4KB->PL
  • Step S63 The host deletes the first virtual mapping, and stores the second virtual mapping.
  • the controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space can be accessed by at least two hosts. Remapping, at least two hosts can concurrently obtain related virtual remapping from the target storage space of the controller. At least two hosts can update their respective virtual mappings independently according to the virtual remapping, thereby implementing updates of at least two hosts. Then, the controller can release the storage space corresponding to the first container unit number.
  • the controller stores the virtual remapping into the target storage space, at least two hosts do not need to process the virtual remapping sequentially, but independently process the virtual remapping in the target storage space to implement the first container unit number.
  • the parallel storage of the storage space corresponding to the storage address greatly improves the recycling efficiency of the garbage collection technology.
  • FIG. 8 is a schematic diagram of an apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 8 is an embodiment of the device corresponding to FIG. 2 , and FIG. 8 is the same as FIG. 2 .
  • the garbage collection apparatus shown in Fig. 8 is applied to a storage system, which also includes a first container unit number.
  • the garbage collection device includes the following modules:
  • the copying module 41 is configured to copy the valid data block in the storage space corresponding to the storage address of the first container unit number into the storage space corresponding to the storage address of the second container unit number.
  • the virtual remapping generating module 42 is configured to generate a virtual remapping according to the container mapping, where the container mapping is used to indicate that the storage address of the first container unit number points to a storage address of the first virtual logical unit number, and the virtual remapping includes the first virtual mapping and a second virtual mapping, where the first virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the first container unit number, and the second virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the second The storage address of the container unit number.
  • the storage module 43 is configured to store the virtual remapping into the target storage space, and the virtual remapping of the target storage space can be accessed by at least two hosts.
  • the release module 44 is configured to release the storage space corresponding to the first container unit number.
  • the controller after the controller generates the virtual remapping according to the container mapping, the controller stores the virtual remapping into the target storage space, and the virtual remapping of the target storage space can be accessed by at least two hosts. Remapping, at least two hosts can concurrently obtain related virtual remapping from the target storage space of the controller. At least two hosts can update their respective virtual maps independently according to the virtual remapping, thereby implementing updates of at least two hosts. Then, the controller can release the storage space corresponding to the first container unit number.
  • the controller stores the virtual remapping into the target storage space, at least two hosts do not need to process the virtual remapping sequentially, but independently process the virtual remapping in the target storage space to implement the first container unit number.
  • the parallel storage of the storage space corresponding to the storage address greatly improves the garbage collection efficiency.
  • the apparatus for garbage collection may further include the following module: a fingerprint remapping generating module, configured to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, where the fingerprint mapping is used to indicate that the fingerprint of the data block points to a storage address of a container unit number, the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping, the first fingerprint mapping is used to indicate that the fingerprint of the valid data block points to a storage address of the first container unit number, and the second fingerprint mapping is used for The fingerprint indicating the valid data block points to the storage address of the second container unit number; the fingerprint remapping is stored in the target storage space.
  • a fingerprint remapping generating module configured to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, where the fingerprint mapping is used to indicate that the fingerprint of the data block points to a storage address of a container unit number, the fingerprint remapping includes a first fingerprint mapping and a second fingerprint mapping, the first fingerprint mapping is used to
  • the device for garbage collection may further include the following module: an update module, configured to update the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
  • an update module configured to update the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
  • the apparatus for garbage collection may further include the following module: a fingerprint update information generating module, configured to generate first fingerprint update information, where the first fingerprint update information is used to indicate whether the fingerprint mapping is updated by the controller. Successful; store the first fingerprint update information in the target storage space.
  • a fingerprint update information generating module configured to generate first fingerprint update information, where the first fingerprint update information is used to indicate whether the fingerprint mapping is updated by the controller. Successful; store the first fingerprint update information in the target storage space.
  • the fingerprint remapping of the target storage space is used for access by at least one fingerprint server.
  • the device for garbage collection may further include: a receiving module, configured to receive second fingerprint update information sent by at least one fingerprint server, where the second fingerprint update information is used to indicate whether the fingerprint mapping is At least one fingerprint server is successfully updated; the second fingerprint update information is stored in the target storage space.
  • a receiving module configured to receive second fingerprint update information sent by at least one fingerprint server, where the second fingerprint update information is used to indicate whether the fingerprint mapping is At least one fingerprint server is successfully updated; the second fingerprint update information is stored in the target storage space.
  • the container mapping further includes a first initial version number corresponding to the storage address of the first container unit number
  • the fingerprint mapping further includes a second initial version number corresponding to the storage address of the first container unit number
  • the first initial version number and The second initial version number is the same.
  • the apparatus for garbage collection provided by the embodiment of the present application may further include the following module: a modification module, configured to modify a first initial version number corresponding to a storage address of the first container unit number in the container mapping to a target version number, and a target version number.
  • a determining module configured to determine, when the controller receives a reference request for adding a valid data block of the storage address of the first container unit number sent by the host, determining the first container unit number in the container mapping a target version number corresponding to the storage address, and a second initial version number corresponding to the storage address of the first container unit number in the fingerprint mapping; and a deletion module, configured to delete when the second initial version number is different from the target version number The fingerprint mapping corresponding to the first container unit number.
  • the deletion module can be implemented by a fingerprint server.
  • FIG. 9 is a schematic diagram of another apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 9 is an embodiment of the device corresponding to FIG. 7.
  • the garbage collection device includes the following modules:
  • a mounting module 51 configured to mount the first virtual logical unit number; store the first virtual mapping; the first virtual mapping is used to indicate that the storage address of the first virtual logical unit points to a storage address of the first container unit number;
  • the obtaining module 52 is configured to obtain a virtual remapping in a target storage space in the storage system, where the virtual remapping of the target storage space is accessible by at least two hosts, and the virtual remapping includes a first virtual mapping and a second virtual mapping, The second virtual mapping is used to indicate that the storage address of the first virtual logical unit number points to the storage address of the second container unit number; the second container unit number stores the valid data in the first container unit number;
  • the deleting module 53 is configured to delete the first virtual mapping and store the second virtual mapping.
  • FIG. 10 is a schematic diagram of another apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 10 is an embodiment of the device corresponding to FIG. 2.
  • the apparatus includes a processor 61 and an internal memory 62 in which an operation instruction executable by the processor 61 is stored, and the processor 61 reads an operation instruction in the memory 62 for implementing the above-described FIG. method.
  • FIG. 11 is a schematic diagram of another apparatus for garbage collection in a storage system according to an embodiment of the present application.
  • FIG. 11 is an embodiment of the apparatus corresponding to FIG. 7.
  • the apparatus includes a processor 71 and a memory 72, wherein the memory 72 stores therein an operation instruction executable by the processor 71, and the processor 71 reads an operation instruction in the memory 72 for implementing the above-described FIG. method.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of cells is only a logical function division.
  • multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种存储系统中垃圾回收的方法及装置,该方法包括:控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中(S11);控制器根据容器映射生成虚拟重映射(S12);控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问(S13);控制器释放第一容器单元号对应的存储空间(S14),控制器将虚拟重映射存储到目标存储空间中以后,至少两台主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收效率。

Description

一种存储系统中垃圾回收的方法及装置 技术领域
本申请实施例涉及通信技术领域,具体的,涉及存储系统中垃圾回收的方法及装置。
背景技术
垃圾回收(Garbage Collection,GC)技术是一种存储系统回收存储空间的技术,下面结合一个应用场景简要的介绍一下垃圾回收技术的原理。
首先,存储系统的控制器扫描容器映射找出哪些容器对应的存储空间可以被释放,生成虚拟逻辑单元号(Virtual LUN,VLUN)重映射;其次,控制器需要在虚拟逻辑单元号重映射中挑选出与主机A1相关的重映射B1,并将该重映射B1发送给主机A1,以使主机A1基于重映射B1更新预先存储的虚拟逻辑单元号映射;再次,在主机A1更新完成以后,主机A1会向控制器发送更新完成的通知。此后,控制器会依次向多台主机(A2,A3,…)发送重映射(B2,B3,…)。需要注意的是,控制器在一台主机更新完成后,才会向下一台主机发送重映射。
在上述垃圾回收中,控制器依次与多台主机交互以更新虚拟逻辑单元号映射,从而导致回收效率低下。
发明内容
本申请实施例提供一种存储系统中垃圾回收的方法及装置,以提高垃圾回收技术的回收效率。
本申请实施例是这样实现的:
第一方面,本申请实施例提供了一种存储系统中垃圾回收的方法,存储系统包括控制器和第一容器单元号,该方法包括:
控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中;
控制器根据容器映射生成虚拟重映射,容器映射用于指示第一容器单元号的存储地址指向第一虚拟逻辑单元号的存储地址,虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第一容器单元号的存储地址,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;
控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问;
控制器释放第一容器单元号对应的存储空间。
在第一方面中,控制器根据容器映射生成虚拟重映射以后,控制器将虚拟重映射存储到目标存储空间中,该目标存储空间的虚拟重映射可以被至少两个主机访问虚拟 重映射,至少两台主机可以并发的从控制器的目标存储空间获取相关的虚拟重映射。至少两台主机可独立地根据虚拟重映射更新各自的虚拟映射,从而实现至少两台主机的更新。然后,控制器便可释放第一容器单元号对应的存储空间。因此,控制器将虚拟重映射存储到目标存储空间中以后,至少两台主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收效率。
在一种可能的实现方式中,在控制器释放第一容器单元号对应的存储空间之前,方法还包括:
控制器根据容器映射和指纹映射生成指纹重映射,指纹映射用于指示数据块的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址;
控制器将指纹重映射存储到目标存储空间中。
在一种可能的实现方式中,方法还包括:
控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。
在一种可能的实现方式中,方法还包括:
控制器生成第一指纹更新信息,第一指纹更新信息用于指示指纹映射是否被控制器更新成功;
控制器将第一指纹更新信息存储至目标存储空间内。
其中,由于控制器预先存储有第一容器单元号对应的容器映射和指纹映射,所以控制器可以根据容器映射和指纹映射生成指纹重映射。在控制器生成指纹重映射以后,便可将指纹重映射存储到目标存储空间中。在控制器检测到目标存储空间中具有指纹重映射时,控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。然后,控制器会将用于指示指纹映射是否被控制器更新成功的第一指纹更新信息存储至目标存储空间内。因此,控制器将指纹重映射存储到目标存储空间中以后,控制器可以并行的处理目标存储空间中的指纹重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收技术的回收效率。
在一种可能的实现方式中,目标存储空间的指纹重映射用于被至少一个指纹服务器访问。
在一种可能的实现方式中,方法还包括:
控制器接收至少一个指纹服务器发送的第二指纹更新信息,第二指纹更新信息用于指示指纹映射是否被至少一个指纹服务器更新成功;
控制器将第二指纹更新信息存储至目标存储空间内。
其中,由于控制器预先存储有第一容器单元号对应的容器映射和指纹映射,所以控制器可以根据容器映射和指纹映射生成指纹重映射。在控制器生成指纹重映射以后,便可将指纹重映射存储到目标存储空间中。指纹服务器在获取到目标存储空间的指纹重映射以后,指纹服务器便需要删除预先存储的第一指纹映射,并增加第二指纹映射。在指纹服务器根据指纹重映射更新指纹映射以后,指纹服务器会向控制器发送用于指 示指纹映射是否被指纹服务器更新成功的第二指纹更新信息。然后,控制器会将第二指纹更新信息存储至目标存储空间内。因此,控制器将指纹重映射存储到目标存储空间中以后,至少一个指纹服务器可以并行的处理目标存储空间中的指纹重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收技术的回收效率。
在一种可能的实现方式中,容器映射还包括第一容器单元号的存储地址对应的第一初始版本号,指纹映射还包括第一容器单元号的存储地址对应的第二初始版本号,第一初始版本号与第二初始版本号相同;
方法还包括:
控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,目标版本号大于第一初始版本号;
在控制器接收到主机发送的增加一次对第一容器单元号的存储地址的有效数据块的引用请求时,控制器确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号;
在第二初始版本号与目标版本号不同时,所述控制器内的指纹服务器删除所述第一容器单元号对应的所述指纹映射,或者所述控制器拒绝主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求。
其中,在控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射以后,控制器不需要生成用于指示指纹映射是否被成功更新的指纹更新信息,也不需要在目标存储空间内存储该指纹更新信息,即使控制器未能成功的更新指纹映射也不会影响第一容器单元号对应的存储空间的回收效果,从而简化了垃圾回收的流程,提高了垃圾回收技术的回收效率。
第二方面,本申请实施例提供了一种存储系统中垃圾回收的方法,该方法包括:主机挂载第一虚拟逻辑单元号;主机存储第一虚拟映射;第一虚拟映射用于指示第一虚拟逻辑单元的存储地址指向第一容器单元号的存储地址;
主机获取存储系统中的目标存储空间内的虚拟重映射,目标存储空间的虚拟重映射可以被至少两个主机访问,虚拟重映射包括第一虚拟映射和第二虚拟映射,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;第二容器单元号存储第一容器单元号中的有效数据;
主机删除第一虚拟映射,并存储第二虚拟映射。
在第二方面中,控制器根据容器映射生成虚拟重映射以后,控制器将虚拟重映射存储到目标存储空间中,该目标存储空间的虚拟重映射可以被至少两个主机访问虚拟重映射,至少两台主机可以并发的从控制器的目标存储空间获取相关的虚拟重映射。至少两台主机可独立地根据虚拟重映射更新各自的虚拟映射,从而实现至少两台主机的更新。然后,控制器便可释放第一容器单元号对应的存储空间。因此,控制器将虚拟重映射存储到目标存储空间中以后,至少两台主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收效率。
第三方面,本申请实施例提供了一种存储系统中垃圾回收的装置,该装置应用于存储系统,存储系统还包括第一容器单元号,装置包括:
复制模块,用于将第一容器单元号的存储地址对应的存储空间中的数据块复制到第二容器单元号的存储地址对应的存储空间中;
虚拟重映射生成模块,用于根据容器映射生成虚拟重映射,容器映射用于指示第一容器单元号的存储地址指向第一虚拟逻辑单元号的存储地址,虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第一容器单元号的存储地址,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;
存储模块,用于将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问;
释放模块,用于释放第一容器单元号对应的存储空间。
在一种可能的实现方式中,装置还包括:
指纹重映射生成模块,用于根据容器映射和指纹映射生成指纹重映射,指纹映射用于指示数据块的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址;将指纹重映射存储到目标存储空间中。
在一种可能的实现方式中,装置还包括:
更新模块,用于根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。
在一种可能的实现方式中,装置还包括:
指纹更新信息生成模块,用于生成第一指纹更新信息,第一指纹更新信息用于指示指纹映射是否被控制器更新成功;将第一指纹更新信息存储至目标存储空间内。
在一种可能的实现方式中,目标存储空间的指纹重映射用于被至少一个指纹服务器访问。
在一种可能的实现方式中,装置还包括:
接收模块,用于接收至少一个指纹服务器发送的第二指纹更新信息,第二指纹更新信息用于指示指纹映射是否被至少一个指纹服务器更新成功;将第二指纹更新信息存储至目标存储空间内。
在一种可能的实现方式中,容器映射还包括第一容器单元号的存储地址对应的第一初始版本号,指纹映射还包括第一容器单元号的存储地址对应的第二初始版本号,第一初始版本号与第二初始版本号相同;装置还包括:
修改模块,用于将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,目标版本号大于第一初始版本号;
确定模块,用于在控制器接收到主机发送的增加一次对第一容器单元号的存储地址的有效数据块的引用请求时,确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号;
删除模块,用于在第二初始版本号与目标版本号不同时,删除所述第一容器单元号对应的所述指纹映射,或者拒绝主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求。
第四方面,本申请实施例提供了一种存储系统中垃圾回收的装置,该装置包括:
挂载模块,用于挂载第一虚拟逻辑单元号;存储第一虚拟映射;第一虚拟映射用于指示第一虚拟逻辑单元的存储地址指向第一容器单元号的存储地址;
获取模块,用于获取存储系统中的目标存储空间内的虚拟重映射,目标存储空间的虚拟重映射可以被至少两个主机访问,虚拟重映射包括第一虚拟映射和第二虚拟映射,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;第二容器单元号存储第一容器单元号中的有效数据;
删除模块,用于删除第一虚拟映射,并存储第二虚拟映射。
第五方面,本申请实施例提供了一种控制器,该控制器包括:处理器和存储器,其中,存储器内存储有处理器能够执行的操作指令,处理器读取存储器内的操作指令用于实现第一方面或第一方面的任一可能的实现方式中描述的方法。
第六方面,本申请实施例提供了一种主机,该主机包括:处理器和存储器,其中,存储器内存储有处理器能够执行的操作指令,处理器读取存储器内的操作指令用于实现第二方面或第二方面的任一可能的实现方式中描述的方法。
附图说明
图1所示的为本申请实施例提供的一种存储系统与主机的场景示意图;
图2所示的为本申请实施例提供的一种存储系统中垃圾回收的方法的流程图;
图3所示的为本申请实施例提供的另一种存储系统中垃圾回收的方法的流程图;
图4所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图;
图5所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图;
图6所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图;
图7所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图;
图8所示的为本申请实施例提供的一种存储系统中垃圾回收的装置的示意图;
图9所示的为本申请实施例提供的另一种存储系统中垃圾回收的装置的示意图;
图10所示的为本申请实施例提供的又一种存储系统中垃圾回收的装置的示意图;
图11所示的为本申请实施例提供的又一种存储系统中垃圾回收的装置的示意图。
具体实施方式
请参见图1所示,图1所示的为本申请实施例提供的一种存储系统与主机的场景示意图。在图1所示的场景示意图中包括计算机集群10和存储系统20,计算机集群10中包括主机11、主机12和主机13等多个主机,存储系统20包括控制器21、控制器22和控制器23等多个控制器,存储系统还包括存储器31、存储器32和存储器33等。其中,控制器21管理存储器31的容器单元号,控制器22管理存储器32的容器单元号,控制器23管理存储器33的容器单元号。指纹服务器可以设置在控制器内部,也可以设置在控制器的外部,所以在图1中未示出指纹服务器。存储器可以为固态硬 盘、机械硬盘等,本发明对存储器类型不作具体限定。
结合图1所示的场景示意图,每个主机均会挂载虚拟逻辑单元号(后面将虚拟逻辑单元号简称为VLUN),每个VLUN对应的存储空间的大小可以由每个主机的用户自行设定。每个VLUN对应的存储空间会被划分为多个存储单元,每个存储单元均用于存储数据块,每个存储单元均可以使用逻辑块地址(后面将逻辑块地址简称为LBA)来指示。例如,主机11的用户设定VLUN1的存储空间为1GB,并将这1GB的存储空间划分成多个存储单元,每个存储单元均为512字节或者4K字节。
结合图1所示的场景示意图,每个控制器均会预先生成多个容器单元号(后面将容器单元号简称为PLUN),并为每个PLUN分配一定的存储空间,每个PLUN对应的存储空间会被划分为多个存储单元,每个存储单元均用于存储数据块,每个存储单元均可以使用LBA来指示。例如,控制器21为PLUN1分配1GB的存储空间,并将这1GB的存储空间分配给存储器31,再将存储器31划分成多个存储单元,每个存储单元均为512字节或者4K字节。
结合图1所示的场景示意图,下面简要介绍一下主机写数据和建立映射的过程。
首先,假设主机11上的应用软件生成在(VLUN1,LBA1)对应的存储空间上写入4KB大小的数据A的请求。
然后,主机11接收到该请求后,主机11会计算出数据A的指纹为FP1,并将指纹FP1发送给指纹服务器。其中,指纹服务器可以集成在控制器内部,也可以单独设置在控制器的外部。
其次,指纹服务器会判断指纹FP1是否预先存储过。
如果指纹服务器判断出指纹FP1预先存储过,那么指纹服务器会将指纹FP1对应的容器单元号的存储地址(PLUN1,LBA1,4KB)发送给主机11;由于PLUN1归属于控制器21,所以主机11会向控制器21发送增加一次(PLUN1,LBA1,4KB)对应的存储空间内的数据块的引用请求,其中,(PLUN1,LBA1,4KB)对应的存储空间为存储器31的一个存储单元;控制器21会同意该引用请求,并建立容器映射(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB);主机11会建立虚拟映射(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB)。
如果指纹服务器判断出指纹FP1未存储过,那么指纹服务器向主机11发送未存储过FP1的指令;主机11接收到该指令以后,会向控制器21请求一个与(VLUN1,LBA1)对应的PLUN;控制器21向主机11发送一个新的存储地址(PLUN1,LBA2,4KB),(PLUN1,LBA2,4KB)对应的存储空间内未存储有数据,其中,(PLUN1,LBA2,4KB)对应的存储空间为存储器31的一个存储单元;控制器21建立容器映射(PLUN1,LBA2,4KB->VLUN1,LBA1,4KB);主机11会建立虚拟映射(VLUN1,LBA1,4KB->PLUN1,LBA2,4KB);指纹服务器建立指纹映射(FP1->PLUN1,LBA2,4KB)。
在图1所示的实施例中,不仅主机11可以使用归属于控制器21的PLUN1对应的存储空间,计算机集群10中的主机12和主机13等主机也可以使用归属于控制器21的PLUN1对应的存储空间。当然,计算机集群10中的主机11、主机12和主机13等也可以使用存储系统20中归属于控制器22和控制器23等控制器的PLUN对应的存储空 间。
上述实施例介绍了主机写数据和建立映射的过程,下面将结合本申请实施例中的附图,对本申请实施例提供的存储系统中垃圾回收的过程进行描述。
图2所示的为本申请实施例提供的一种存储系统中垃圾回收的方法的流程图。在图2所示的方法中,在控制器将虚拟重映射存储到目标存储空间中以后,各个主机不需要依次处理虚拟重映射,而自独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收效率。该方法包括以下步骤。
步骤S11、控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
其中,本申请实施例提供的垃圾回收的方法可以应用于存储系统中。存储系统可以包括控制器和第一容器单元号。
在步骤S11之前,主机已经建立第一虚拟映射,第一虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第一容器单元号的存储地址,控制器也已经建立容器映射,容器映射用于指示第一容器单元号的存储地址指向第一虚拟逻辑单元号的存储地址。
在步骤S11中,控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中,说明控制器需要释放掉第一容器单元号对应的存储空间,所以需要将第一容器单元号内的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
例如,假设第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),第一虚拟逻辑单元号为VLUN1,第一虚拟逻辑单元号的存储地址为(VLUN1,LBA1,4KB),第一容器单元号为PLUN1,第一容器单元号的存储地址为(PLUN1,LBA1,4KB),第二容器单元号为PLUN2,第二容器单元号的存储地址为(PLUN2,LBA1,4KB)。
结合上述步骤S11可知,(PLUN1,LBA1,4KB)对应的存储空间中存储有效数据块,在控制器需要释放PLUN1对应的存储空间时,控制器需要先将(PLUN1,LBA1,4KB)对应的存储空间中的有效数据块复制到(PLUN2,LBA1,4KB)对应的存储空间中,进而为释放PLUN1做好准备工作。
步骤S12、控制器根据容器映射生成虚拟重映射。
其中,在控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中以后,控制器还需要根据容器映射生成虚拟重映射,以使至少两个主机可以根据虚拟重映射更新虚拟映射。
虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第一容器单元号的存储地址,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址。第一虚拟映射用于指示至少两个主机需要删除的虚拟映射,第二虚拟映射用于指示至少两个主机需要增加的虚拟映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),第二虚拟映射为(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB)。主机在获取到虚拟重映射以后,主机需要删除预先存储的第一虚拟映射,并增加第二虚拟映射。
步骤S13、控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问。
其中,在控制器根据容器映射生成虚拟重映射以后,控制器需要将虚拟重映射存储到目标存储空间中,以使至少两台主机可以主动的在目标存储空间中获取到虚拟重映射。虚拟重映射可以通过文件、文档或日志等形式存储于目标存储空间内。
控制器中的目标存储空间并不局限于1个,也可以为多个。目标存储空间的数量和每个目标存储空间的大小可以由控制器自动进行配置,也可以预先由工作人员配置好。
由于第一容器单元号归属于控制器,所以只要引用了第一容器单元号的存储地址的主机都可以主动的在目标存储空间中获取到虚拟重映射,以更新主机自身的第一虚拟映射。
例如,结合图1,假设主机11预先存储的第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),PLUN1归属于控制器21。在控制器21将虚拟重映射存储到目标存储空间以后,主机11和引用了PLUN1的存储地址的主机均会主动的在目标存储空间中获取虚拟重映射。虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),第二虚拟映射为(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB),第一虚拟映射为主机11需要删除的虚拟映射,第二虚拟映射为主机11需要增加的虚拟映射。在主机11获取到虚拟重映射以后,主机11会删除预先存储的第一虚拟映射(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),并存储第二虚拟映射(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB),说明主机11的第一虚拟逻辑单元号的存储地址(VLUN1,LBA1,4KB)已经不再指向第一容器单元号的存储地址(PLUN1,LBA1,4KB),而是指向第二容器单元号的存储地址(PLUN2,LBA1,4KB)。
当然,在实际场景中,第一容器单元号的存储地址和第二容器单元号的存储地址均可以包括多条信息,并不局限于1条信息。
例如,第一容器单元号的存储地址包括(PLUN1,LBA1,4KB)、(PLUN1,LBA2,4KB)、(PLUN1,LBA3,4KB)和(PLUN1,LBA4,4KB)等;第二容器单元号的存储地址包括(PLUN2,LBA1,4KB)、(PLUN2,LBA2,4KB)、(PLUN2,LBA3,4KB)和(PLUN2,LBA4,4KB)等。
当然,在实际场景中,容器映射、第一虚拟映射和第二虚拟映射中均可以包括多条映射,并不局限于1条映射。
例如,容器映射包括(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB)、(PLUN1,LBA2,4KB->VLUN1,LBA2,4KB)、(PLUN1,LBA3,4KB->VLUN1,LBA3,4KB)和(PLUN1,LBA4,4KB->VLUN1,LBA4,4KB)等;第一虚拟映射包括(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB)、(VLUN1,LBA2,4KB->PLUN1,LBA2,4KB)、(VLUN1,LBA3,4KB->PLUN1, LBA3,4KB)和(VLUN1,LBA4,4KB->PLUN1,LBA4,4KB)等;第二虚拟映射包括(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB)、(VLUN1,LBA2,4KB->PLUN2,LBA2,4KB)、(VLUN1,LBA3,4KB->PLUN2,LBA3,4KB)和(VLUN1,LBA4,4KB->PLUN2,LBA4,4KB)等。
步骤S14、控制器释放第一容器单元号对应的存储空间。
其中,在引用了第一容器单元号的存储地址的有效数据块的主机根据虚拟重映射更新成功以后,控制器还需要对第一容器单元号的存储地址相关联的容器映射进行更新,指纹服务器还需要对第一容器单元号的存储地址相关联的指纹映射进行更新。在与第一容器单元号相关联的虚拟映射、指纹映射和容器映射等相关信息完全更新完成以后,控制器便可以释放第一容器单元号对应的存储空间。
在图2所示的实施例中,控制器根据容器映射生成虚拟重映射以后,控制器将虚拟重映射存储到目标存储空间中,该目标存储空间的虚拟重映射可以被至少两个主机访问虚拟重映射,至少两台主机可以并发的从控制器的目标存储空间获取相关的虚拟重映射。至少两台主机可独立的根据虚拟重映射更新各自的虚拟映射,从而实现至少两台主机的更新。然后,控制器便可释放第一容器单元号对应的存储空间。因此,控制器将虚拟重映射存储到目标存储空间中以后,至少两台主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收效率。
请参见图3所示,图3所示的为本申请实施例提供的另一种存储系统中垃圾回收的方法的流程图。图3所示的实施例为基于图2改进的实施例,所以与图2相同的内容可参见图2所示的实施例。图3所示方法包括以下步骤。
步骤S21、控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
步骤S22、控制器根据容器映射生成虚拟重映射。
步骤S23、控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问。
步骤S24、控制器根据容器映射和指纹映射生成指纹重映射。
其中,在控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中以后,控制器还需要根据容器映射和指纹映射生成指纹重映射,以使控制器可以根据指纹重映射更新虚拟映射。
指纹映射用于指示数据块的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址。第一指纹映射用于指示控制器需要删除的指纹映射,第二指纹映射用于指示控制器需要增加的指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。
步骤S25、控制器将指纹重映射存储到目标存储空间中。
其中,在控制器根据容器映射和指纹映射生成指纹重映射以后,控制器需要将指纹重映射存储到目标存储空间中。指纹重映射可以通过文件、文档或日志等形式存储于目标存储空间内。
步骤S26、控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。
其中,在控制器检测到目标存储空间内存在指纹重映射时,控制器需要删除预先存储的第一指纹映射,并增加第二指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。在控制器检测到目标存储空间内存在指纹重映射时,控制器需要删除预先存储的第一指纹映射(FP1->PLUN1,LBA1,4KB),并增加第二指纹映射(FP1->PLUN2,LBA1,4KB)。
步骤S27、控制器生成第一指纹更新信息,第一指纹更新信息用于指示指纹映射是否被控制器更新成功。
其中,在控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射以后,控制器需要生成第一指纹更新信息,以指示指纹映射是否被控制器更新成功。如果指纹映射被控制器更新成功,那么第一指纹更新信息用于指示指纹映射被控制器更新成功;如果指纹映射被控制器更新失败,那么第一指纹更新信息用于指示指纹映射被控制器更新失败。
步骤S28、控制器将第一指纹更新信息存储至目标存储空间内。
其中,在控制器生成第一指纹更新信息以后,控制器便可以将第一指纹更新信息存储至目标存储空间内,以便于控制器根据第一指纹更新信息等相关更新信息来判断是否可以释放第一容器单元号对应的存储空间。
如果控制器根据第一指纹更新信息等相关更新信息判断出第一容器单元号对应的指纹映射、容器映射和虚拟映射等均更新完毕,那么控制器便可以释放第一容器单元号对应的存储空间。
步骤S29、控制器释放第一容器单元号对应的存储空间。
在图3所示的实施例中,由于控制器预先存储有第一容器单元号对应的容器映射和指纹映射,所以控制器可以根据容器映射和指纹映射生成指纹重映射。在控制器生成指纹重映射以后,便可将指纹重映射存储到目标存储空间中。在控制器检测到目标存储空间中具有指纹重映射时,控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。然后,控制器会将用于指示指纹映射是否被控制器更新成功的第一指纹更新信息存储至目标存储空间内。因此,控制器将指纹重映射存储到目标存储空间中以后,控制器可以利用多线程并行的处理目标存储空间中的指纹重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收技术的回收效率。
请参见图4所示,图4所示的为本申请实施例提供的又一种存储系统中垃圾回收 的方法的流程图。图4所示的实施例为基于图2改进的实施例,所以与图2相同的内容可参见图2所示的实施例。在图4所示的实施例中,指纹服务器设置在控制器的内部。图4所示方法包括以下步骤。
步骤S31、控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
步骤S32、控制器根据容器映射生成虚拟重映射。
步骤S33、控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问。
步骤S34、控制器根据容器映射和指纹映射生成指纹重映射。
其中,在控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中以后,控制器还需要根据容器映射和指纹映射生成指纹重映射,以使控制器可以根据指纹重映射更新虚拟映射。
指纹映射用于指示数据块的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址。第一指纹映射用于指示控制器需要删除的指纹映射,第二指纹映射用于指示控制器需要增加的指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。
步骤S35、控制器将指纹重映射存储到目标存储空间中。
其中,在控制器根据容器映射和指纹映射生成指纹重映射以后,控制器需要将指纹重映射存储到目标存储空间中。指纹重映射可以通过文件、文档或日志等形式存储于目标存储空间内。
步骤S36、控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。
其中,在控制器检测到目标存储空间内存在指纹重映射时,控制器需要根据指纹重映射更新控制器存储的指纹映射,即控制器需要删除预先存储的第一指纹映射,并增加第二指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。在控制器检测到目标存储空间内存在指纹重映射时,控制器需要删除预先存储的第一指纹映射(FP1->PLUN1,LBA1,4KB),并增加第二指纹映射(FP1->PLUN2,LBA1,4KB)。
当然,控制器有可能会出现更新失败的情况,即控制器无法成功的删除第一指纹映射,也无法成功的增加第二指纹映射。即使控制器出现更新失败的情况,也不会影响控制器释放第一容器单元号对应的存储空间。
步骤S37、控制器释放第一容器单元号对应的存储空间。
其中,在控制器接收到主机发送的成功更新虚拟重映射的通知时,说明主机已经 删除了第一虚拟映射,并增加第二虚拟映射,那么此时控制器便可以释放第一容器单元号对应的存储空间,不需要考虑指纹重映射是否更新成功。
步骤S38、控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,目标版本号大于第一初始版本号。
在本申请实施例中,容器映射还包括第一容器单元号的存储地址对应的第一初始版本号,指纹映射还包括第一容器单元号的存储地址对应的第二初始版本号,第一初始版本号与第二初始版本号相同。
例如,假设容器映射为(PLUN1,LBA1,4KB,第一初始版本号->VLUN1,LBA1,4KB),指纹映射为(FP1->PLUN1,LBA1,4KB,第二初始版本号),而且,第一初始版本号等于第二初始版本号。
在控制器释放第一容器单元号对应的存储空间以后,控制器需要将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,而且,目标版本号还会大于第一初始版本号。这样做的目的在于,如果控制器出现指纹映射更新失败的情况,即控制器无法成功的删除第一指纹映射,也无法成功的增加第二指纹映射,那么至少可以保证容器映射内的版本号与控制器预先存储的第一指纹映射的版本号是不同的,用于指示指纹映射更新失败。
步骤S39、在控制器接收到主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求时,控制器确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号。
其中,在控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号以后,如果某个主机向控制器发送增加一次对第一容器单元号的存储地址中的有效数据块的引用请求,那么控制器便需要确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号。
步骤S40、在第二初始版本号与目标版本号不同时,控制器内的指纹服务器删除第一容器单元号对应的指纹映射。
其中,在控制器释放了第一容器单元号对应的存储空间以后,控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号。如果控制器出现指纹映射更新失败的情况,那么第一指纹映射不会被删除,而且容器映射内的版本号与控制器预先存储的第一指纹映射的版本号便是不同的,所以第二初始版本号与目标版本号不同,此时,控制器将拒绝主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求;在主机检测到控制器拒绝增加一次对第一容器单元号的存储地址中的有效数据块的引用请求时,主机向控制器内的指纹服务器发送删除第一容器单元号对应的指纹映射的删除指令;控制器内的指纹服务器在接收到主机发送的删除指令时,指纹服务器会删除第一容器单元号对应的指纹映射。
在图4所示的实施例中,在控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射以后,控制器不需要生成用于指示指纹映射是否被成功更新的指纹更 新信息,也不需要在目标存储空间内存储该指纹更新信息,即使控制器未能成功的更新指纹映射也不会影响第一容器单元号对应的存储空间的回收效果,从而简化了垃圾回收的流程,提高了垃圾回收技术的回收效率。
请参见图5所示,图5所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图。图5所示的实施例为基于图2改进的实施例,所以与图2相同的内容可参见图2所示的实施例。图5所示方法包括以下步骤。
步骤S41、控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
步骤S42、控制器根据容器映射生成虚拟重映射。
步骤S43、控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问。
步骤S44、控制器根据容器映射和指纹映射生成指纹重映射。
其中,在控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中以后,控制器还需要根据容器映射和指纹映射生成指纹重映射,以使控制器可以根据指纹重映射更新虚拟映射。
指纹映射用于指示数据块的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址。第一指纹映射用于指示控制器需要删除的指纹映射,第二指纹映射用于指示控制器需要增加的指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。
步骤S45、控制器将指纹重映射存储到目标存储空间中,目标存储空间的指纹重映射用于被至少一个指纹服务器访问。
其中,在控制器根据容器映射和指纹映射生成指纹重映射以后,控制器需要将指纹重映射存储到目标存储空间中,以便于目标存储空间的指纹重映射可以被至少一个指纹服务器访问。指纹重映射可以通过文件、文档或日志等形式存储于目标存储空间内。
指纹服务器在获取到目标存储空间的指纹重映射以后,指纹服务器便需要删除预先存储的第一指纹映射,并增加第二指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。指纹服务器在获取到目标存储空间的指纹重映射以后,指纹服务器需要删除预先存储的第一指纹映射(FP1->PLUN1,LBA1,4KB),并增加第二指纹映射(FP1->PLUN2,LBA1,4KB)。
步骤S46、控制器接收至少一个指纹服务器发送的第二指纹更新信息,第二指纹更 新信息用于指示指纹映射是否被至少一个指纹服务器更新成功。
其中,在指纹服务器根据指纹重映射更新指纹映射以后,指纹服务器需要生成第二指纹更新信息,以指示指纹映射是否被指纹服务器更新成功。如果指纹映射被指纹服务器更新成功,那么第一指纹更新信息用于指示指纹映射被指纹服务器更新成功;如果指纹映射被指纹服务器更新失败,那么第一指纹更新信息用于指示指纹映射被指纹服务器更新失败。
在指纹服务器生成第二指纹更新信息以后,指纹服务器会向控制器发送第二指纹更新信息。此时,控制器便会接收指纹服务器发送的第二指纹更新信息。
步骤S47、控制器将第二指纹更新信息存储至目标存储空间内。
其中,在控制器接收到指纹服务器发送的第二指纹更新信息以后,控制器便可以将第二指纹更新信息存储至目标存储空间内,以便于控制器根据第二指纹更新信息等相关更新信息来判断是否可以释放第一容器单元号对应的存储空间。
如果控制器根据第二指纹更新信息等相关更新信息判断出第一容器单元号对应的指纹映射、容器映射和虚拟映射等均更新完毕,那么控制器便可以释放第一容器单元号对应的存储空间。
步骤S48、控制器释放第一容器单元号对应的存储空间。
在图5所示的实施例中,由于控制器预先存储有第一容器单元号对应的容器映射和指纹映射,所以控制器可以根据容器映射和指纹映射生成指纹重映射。在控制器生成指纹重映射以后,便可将指纹重映射存储到目标存储空间中。指纹服务器在获取到目标存储空间的指纹重映射以后,指纹服务器便需要删除预先存储的第一指纹映射,并增加第二指纹映射。在指纹服务器根据指纹重映射更新指纹映射以后,指纹服务器会向控制器发送用于指示指纹映射是否被指纹服务器更新成功的第二指纹更新信息。然后,控制器会将第二指纹更新信息存储至目标存储空间内。因此,控制器将指纹重映射存储到目标存储空间中以后,至少一个指纹服务器可以并行的处理目标存储空间中的指纹重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收技术的回收效率。
请参见图6所示,图6所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图。图6所示的实施例为基于图2改进的实施例,所以与图2相同的内容可参见图2所示的实施例。在图6所示的实施例中,指纹服务器与控制器属于两台独立的设备。图6所示方法包括以下步骤。
步骤S51、控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
步骤S52、控制器根据容器映射生成虚拟重映射。
步骤S53、控制器将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问。
步骤S54、控制器根据容器映射和指纹映射生成指纹重映射。
其中,在控制器将第一容器单元号的存储地址对应的存储空间中的有效数据块复 制到第二容器单元号的存储地址对应的存储空间中以后,控制器还需要根据容器映射和指纹映射生成指纹重映射,以使控制器可以根据指纹重映射更新虚拟映射。
指纹映射用于指示数据块的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址。第一指纹映射用于指示控制器需要删除的指纹映射,第二指纹映射用于指示控制器需要增加的指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。
步骤S55、控制器将指纹重映射存储到目标存储空间中,目标存储空间的指纹重映射用于被至少一个指纹服务器访问。
其中,在控制器根据容器映射和指纹映射生成指纹重映射以后,控制器需要将指纹重映射存储到目标存储空间中,以便于指纹重映射被至少一个指纹服务器访问。指纹重映射可以通过文件、文档或日志等形式存储于目标存储空间内。
在指纹服务器获取到目标存储空间的指纹重映射以后,指纹服务器便可以根据指纹重映射更新指纹服务器存储的指纹映射,即指纹服务器需要删除预先存储的第一指纹映射,并增加第二指纹映射。
例如,假设容器映射为(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB),指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射为(FP1->PLUN1,LBA1,4KB),第二指纹映射为(FP1->PLUN2,LBA1,4KB)。在指纹服务器获取到目标存储空间的指纹重映射以后,指纹服务器需要删除预先存储的第一指纹映射(FP1->PLUN1,LBA1,4KB),并增加第二指纹映射(FP1->PLUN2,LBA1,4KB)。
当然,指纹服务器有可能会出现更新失败的情况,即指纹服务器无法成功的删除第一指纹映射,也无法成功的增加第二指纹映射。即使指纹服务器出现更新失败的情况,也不会影响控制器释放第一容器单元号对应的存储空间。
步骤S56、控制器释放第一容器单元号对应的存储空间。
其中,在控制器接收到主机发送的成功更新虚拟重映射的通知时,说明主机已经删除了第一虚拟映射,并增加第二虚拟映射,那么此时控制器便可以释放第一容器单元号对应的存储空间,不需要考虑指纹重映射是否更新成功。
步骤S57、控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,目标版本号大于第一初始版本号。
在本申请实施例中,容器映射还包括第一容器单元号的存储地址对应的第一初始版本号,指纹映射还包括第一容器单元号的存储地址对应的第二初始版本号,第一初始版本号与第二初始版本号相同。
例如,假设容器映射为(PLUN1,LBA1,4KB,第一初始版本号->VLUN1,LBA1,4KB),指纹映射为(FP1->PLUN1,LBA1,4KB,第二初始版本号),而且,第一初始版本号等于第二初始版本号。
在控制器释放第一容器单元号对应的存储空间以后,控制器需要将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,而且,目标版本号还会大于第一初始版本号。这样做的目的在于,如果指纹服务器出现指纹映射更新失败的情况,即指纹服务器法成功的删除第一指纹映射,也无法成功的增加第二指纹映射,那么至少可以保证容器映射内的版本号与控制器预先存储的第一指纹映射的版本号是不同的,用于指示指纹映射更新失败。
步骤S58、在控制器接收到主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求时,控制器确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号。
其中,在控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号以后,如果某个主机向控制器发送增加一次对第一容器单元号的存储地址中的有效数据块的引用请求,那么控制器便需要确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号。
步骤S59、在第二初始版本号与目标版本号不同时,控制器拒绝主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求,以使主机向指纹服务器发送删除第一容器单元号对应的指纹映射的删除指令,并使指纹服务器根据该删除指令删除第一容器单元号对应的指纹映射。
其中,在控制器释放了第一容器单元号对应的存储空间以后,控制器将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号。如果指纹服务器出现指纹映射更新失败的情况,那么第一指纹映射不会被删除,而且容器映射内的版本号与指纹服务器预先存储的第一指纹映射的版本号便是不同的,所以第二初始版本号与目标版本号不同,此时,控制器将拒绝主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求;在主机检测到控制器拒绝增加一次对第一容器单元号的存储地址中的有效数据块的引用请求时,主机向指纹服务器发送删除第一容器单元号对应的指纹映射的删除指令;指纹服务器在接收到主机发送的删除指令时,指纹服务器会删除第一容器单元号对应的指纹映射。
在图6所示的实施例中,在控制器根据目标存储空间中的指纹重映射更新控制器存储的指纹映射以后,控制器不需要生成用于指示指纹映射是否被成功更新的指纹更新信息,也不需要在目标存储空间内存储该指纹更新信息,即使控制器未能成功的更新指纹映射也不会影响第一容器单元号对应的存储空间的回收效果,从而简化了垃圾回收的流程,提高了垃圾回收技术的回收效率。
图7所示的为本申请实施例提供的又一种存储系统中垃圾回收的方法的流程图。在图7所示的方法中,在控制器将虚拟重映射存储到目标存储空间中以后,各个主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回 收效率。该方法包括以下步骤。
步骤S61、主机挂载第一虚拟逻辑单元号,主机存储第一虚拟映射,第一虚拟映射用于指示第一虚拟逻辑单元的存储地址指向第一容器单元号的存储地址。
其中,例如假设第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),第一虚拟逻辑单元号为VLUN1,第一虚拟逻辑单元号的存储地址为(VLUN1,LBA1,4KB),第一容器单元号的存储地址为(PLUN1,LBA1,4KB)。
步骤S62、主机获取存储系统中的目标存储空间内的虚拟重映射,目标存储空间的虚拟重映射可以被至少两个主机访问,虚拟重映射包括第一虚拟映射和第二虚拟映射,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;第二容器单元号存储第一容器单元号中的有效数据。
其中,在控制器根据容器映射生成虚拟重映射以后,控制器需要将虚拟重映射存储到目标存储空间中,以使至少两台主机可以主动的在目标存储空间中获取到虚拟重映射。虚拟重映射可以通过文件、文档或日志等形式存储于目标存储空间内。
由于第一容器单元号归属于控制器,所以只要引用了第一容器单元号的存储地址的主机都可以主动的在目标存储空间中获取到虚拟重映射,以更新主机自身的第一虚拟映射。
例如,结合图1,假设主机11预先存储的第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),PLUN1归属于控制器21。在控制器21将虚拟重映射存储到目标存储空间以后,主机11和引用了PLUN1的存储地址的主机均会主动的在目标存储空间中获取虚拟重映射。虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射为(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),第二虚拟映射为(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB),第一虚拟映射为主机11需要删除的虚拟映射,第二虚拟映射为主机11需要增加的虚拟映射。在主机11获取到虚拟重映射以后,主机11会删除预先存储的第一虚拟映射(VLUN1,LBA1,4KB->PLUN1,LBA1,4KB),并存储第二虚拟映射(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB),说明主机11的第一虚拟逻辑单元号的存储地址(VLUN1,LBA1,4KB)已经不再指向第一容器单元号的存储地址(PLUN1,LBA1,4KB),而是指向第二容器单元号的存储地址(PLUN2,LBA1,4KB)。
当然,在实际场景中,第一容器单元号的存储地址和第二容器单元号的存储地址均可以包括多条信息,并不局限于1条信息。
例如,第一容器单元号的存储地址包括(PLUN1,LBA1,4KB)、(PLUN1,LBA2,4KB)、(PLUN1,LBA3,4KB)和(PLUN1,LBA4,4KB)等;第二容器单元号的存储地址包括(PLUN2,LBA1,4KB)、(PLUN2,LBA2,4KB)、(PLUN2,LBA3,4KB)和(PLUN2,LBA4,4KB)等。
当然,在实际场景中,容器映射、第一虚拟映射和第二虚拟映射中均可以包括多条映射,并不局限于1条映射。
例如,容器映射包括(PLUN1,LBA1,4KB->VLUN1,LBA1,4KB)、(PLUN1,LBA2,4KB->VLUN1,LBA2,4KB)、(PLUN1,LBA3,4KB->VLUN1,LBA3,4KB)和(PLUN1,LBA4,4KB->VLUN1,LBA4,4KB)等;第一虚拟映射包括(VLUN1,LBA1,4KB->PLUN1, LBA1,4KB)、(VLUN1,LBA2,4KB->PLUN1,LBA2,4KB)、(VLUN1,LBA3,4KB->PLUN1,LBA3,4KB)和(VLUN1,LBA4,4KB->PLUN1,LBA4,4KB)等;第二虚拟映射包括(VLUN1,LBA1,4KB->PLUN2,LBA1,4KB)、(VLUN1,LBA2,4KB->PLUN2,LBA2,4KB)、(VLUN1,LBA3,4KB->PLUN2,LBA3,4KB)和(VLUN1,LBA4,4KB->PLUN2,LBA4,4KB)等。
步骤S63、主机删除第一虚拟映射,并存储第二虚拟映射。
在图7所示的实施例中,控制器根据容器映射生成虚拟重映射以后,控制器将虚拟重映射存储到目标存储空间中,该目标存储空间的虚拟重映射可以被至少两个主机访问虚拟重映射,至少两台主机可以并发的从控制器的目标存储空间获取相关的虚拟重映射。至少两台主机可独立的根据虚拟重映射更新各自的虚拟映射,从而实现至少两台主机的更新。然后,控制器便可释放第一容器单元号对应的存储空间。因此,控制器将虚拟重映射存储到目标存储空间中以后,至少两台主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收技术的回收效率。
图8所示的为本申请实施例提供的一种存储系统中垃圾回收的装置的示意图。图8为图2对应的装置实施例,图8中与图2相同的内容请参见图2对应的实施例即可。参照图8,图8所示的垃圾回收的装置应用于存储系统中,该存储系统还包括第一容器单元号。该垃圾回收的装置包括以下模块:
复制模块41,用于将第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中。
虚拟重映射生成模块42,用于根据容器映射生成虚拟重映射,容器映射用于指示第一容器单元号的存储地址指向第一虚拟逻辑单元号的存储地址,虚拟重映射包括第一虚拟映射和第二虚拟映射,第一虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第一容器单元号的存储地址,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址。
存储模块43,用于将虚拟重映射存储到目标存储空间中,目标存储空间的虚拟重映射可以被至少两个主机访问。
释放模块44,用于释放第一容器单元号对应的存储空间。
在图8所示的实施例中,控制器根据容器映射生成虚拟重映射以后,控制器将虚拟重映射存储到目标存储空间中,该目标存储空间的虚拟重映射可以被至少两个主机访问虚拟重映射,至少两台主机可以并发的从控制器的目标存储空间获取相关的虚拟重映射。至少两台主机可独立地根据虚拟重映射更新各自的虚拟映射,从而实现至少两台主机的更新。然后,控制器便可释放第一容器单元号对应的存储空间。因此,控制器将虚拟重映射存储到目标存储空间中以后,至少两台主机不需要依次处理虚拟重映射,而是独立地处理目标存储空间中的虚拟重映射,以实现对第一容器单元号的存储地址对应的存储空间的并行回收,进而大大的提高了垃圾回收效率。
可选的,本申请实施例提供的垃圾回收的装置还可以包括以下模块:指纹重映射生成模块,用于根据容器映射和指纹映射生成指纹重映射,指纹映射用于指示数据块 的指纹指向第一容器单元号的存储地址,指纹重映射包括第一指纹映射和第二指纹映射,第一指纹映射用于指示有效数据块的指纹指向第一容器单元号的存储地址,第二指纹映射用于指示有效数据块的指纹指向第二容器单元号的存储地址;将指纹重映射存储到目标存储空间中。
可选的,本申请实施例提供的垃圾回收的装置还可以包括以下模块:更新模块,用于根据目标存储空间中的指纹重映射更新控制器存储的指纹映射。
可选的,本申请实施例提供的垃圾回收的装置还可以包括以下模块:指纹更新信息生成模块,用于生成第一指纹更新信息,第一指纹更新信息用于指示指纹映射是否被控制器更新成功;将第一指纹更新信息存储至目标存储空间内。
其中,目标存储空间的指纹重映射用于被至少一个指纹服务器访问。
可选的,本申请实施例提供的垃圾回收的装置还可以包括以下模块:接收模块,用于接收至少一个指纹服务器发送的第二指纹更新信息,第二指纹更新信息用于指示指纹映射是否被至少一个指纹服务器更新成功;将第二指纹更新信息存储至目标存储空间内。
可选的,容器映射还包括第一容器单元号的存储地址对应的第一初始版本号,指纹映射还包括第一容器单元号的存储地址对应的第二初始版本号,第一初始版本号与第二初始版本号相同。本申请实施例提供的垃圾回收的装置还可以包括以下模块:修改模块,用于将容器映射中的第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,目标版本号大于第一初始版本号;确定模块,用于在控制器接收到主机发送的增加一次对第一容器单元号的存储地址的有效数据块的引用请求时,确定容器映射中的第一容器单元号的存储地址对应的目标版本号,以及确定指纹映射中的第一容器单元号的存储地址对应的第二初始版本号;删除模块,用于在第二初始版本号与目标版本号不同时,删除第一容器单元号对应的指纹映射。具体实现中,删除模块可以由指纹服务器实现。
图9所示的为本申请实施例提供的另一种存储系统中垃圾回收的装置的示意图。图9为图7对应的装置实施例,图9中与图7相同的内容请参见图7对应的实施例即可。参照图9,该垃圾回收的装置包括以下模块:
挂载模块51,用于挂载第一虚拟逻辑单元号;存储第一虚拟映射;第一虚拟映射用于指示第一虚拟逻辑单元的存储地址指向第一容器单元号的存储地址;
获取模块52,用于获取存储系统中的目标存储空间内的虚拟重映射,目标存储空间的虚拟重映射可以被至少两个主机访问,虚拟重映射包括第一虚拟映射和第二虚拟映射,第二虚拟映射用于指示第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;第二容器单元号存储第一容器单元号中的有效数据;
删除模块53,用于删除第一虚拟映射,并存储第二虚拟映射。
图10所示的为本申请实施例提供的又一种存储系统中垃圾回收的装置的示意图。图10为图2对应的装置实施例,图10中与图2相同的内容请参见图2对应的实施例 即可。参照图10,该装置包括处理器61和存储器62,其中,存储器62内存储有处理器61能够执行的操作指令,处理器61读取存储器62内的操作指令用于实现上述图2所示的方法。
图11所示的为本申请实施例提供的又一种存储系统中垃圾回收的装置的示意图。图11为图7对应的装置实施例,图11中与图7相同的内容请参见图7对应的实施例即可。参照图11,该装置包括处理器71和存储器72,其中,存储器72内存储有处理器71能够执行的操作指令,处理器71读取存储器72内的操作指令用于实现上述图7所示的方法。
需要说明的是,本申请提供实施例只是本申请所介绍的可选实施例,本领域技术人员在此基础上,完全可以设计出更多的实施例,因此不在此处赘述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟 或者光盘等各种可以存储程序代码的介质。
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (18)

  1. 一种存储系统中垃圾回收的方法,其特征在于,所述存储系统包括控制器和第一容器单元号,所述方法包括:
    控制器将所述第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中;
    所述控制器根据容器映射生成虚拟重映射,所述容器映射用于指示所述第一容器单元号的存储地址指向第一虚拟逻辑单元号的存储地址,所述虚拟重映射包括第一虚拟映射和第二虚拟映射,所述第一虚拟映射用于指示所述第一虚拟逻辑单元号的存储地址指向所述第一容器单元号的存储地址,所述第二虚拟映射用于指示所述第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;
    所述控制器将所述虚拟重映射存储到目标存储空间中,所述目标存储空间的所述虚拟重映射可以被至少两个主机访问;
    所述控制器释放所述第一容器单元号对应的存储空间。
  2. 根据权利要求1所述的方法,其特征在于,在所述控制器释放所述第一容器单元号对应的存储空间之前,所述方法还包括:
    所述控制器根据所述容器映射和指纹映射生成指纹重映射,所述指纹映射用于指示数据块的指纹指向所述第一容器单元号的存储地址,所述指纹重映射包括第一指纹映射和第二指纹映射,所述第一指纹映射用于指示所述有效数据块的指纹指向所述第一容器单元号的存储地址,所述第二指纹映射用于指示所述有效数据块的指纹指向所述第二容器单元号的存储地址;
    所述控制器将所述指纹重映射存储到所述目标存储空间中。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    所述控制器根据所述目标存储空间中的所述指纹重映射更新所述控制器存储的指纹映射。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    所述控制器生成第一指纹更新信息,所述第一指纹更新信息用于指示所述指纹映射是否被所述控制器更新成功;
    所述控制器将所述第一指纹更新信息存储至所述目标存储空间内。
  5. 根据权利要求2所述的方法,其特征在于,所述目标存储空间的所述指纹重映射用于被至少一个指纹服务器访问。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    所述控制器接收所述至少一个指纹服务器发送的第二指纹更新信息,所述第二指纹更新信息用于指示所述指纹映射是否被所述至少一个指纹服务器更新成功;
    所述控制器将所述第二指纹更新信息存储至所述目标存储空间内。
  7. 根据权利要求3或5所述的方法,其特征在于,所述容器映射还包括所述第一容器单元号的存储地址对应的第一初始版本号,所述指纹映射还包括所述第一容器单元号的存储地址对应的第二初始版本号,所述第一初始版本号与所述第二初始版本号相同;
    所述方法还包括:
    所述控制器将所述容器映射中的所述第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,所述目标版本号大于所述第一初始版本号;
    在所述控制器接收到主机发送的增加一次对所述第一容器单元号的存储地址的有效数据块的引用请求时,所述控制器确定所述容器映射中的所述第一容器单元号的存储地址对应的目标版本号,以及确定所述指纹映射中的所述第一容器单元号的存储地址对应的第二初始版本号;
    在所述第二初始版本号与所述目标版本号不同时,所述控制器内的指纹服务器删除所述第一容器单元号对应的所述指纹映射,或者所述控制器拒绝主机发送的增加一次对第一容器单元号的存储地址中的有效数据块的引用请求。
  8. 一种存储系统中垃圾回收的方法,其特征在于,所述方法包括:主机挂载第一虚拟逻辑单元号;所述主机存储第一虚拟映射;所述第一虚拟映射用于指示所述第一虚拟逻辑单元的存储地址指向第一容器单元号的存储地址;
    所述主机获取所述存储系统中的目标存储空间内的虚拟重映射,所述目标存储空间的所述虚拟重映射可以被至少两个主机访问,所述虚拟重映射包括所述第一虚拟映射和第二虚拟映射,所述第二虚拟映射用于指示所述第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;所述第二容器单元号存储所述第一容器单元号中的有效数据;
    所述主机删除所述第一虚拟映射,并存储所述第二虚拟映射。
  9. 一种存储系统中垃圾回收的装置,其特征在于,所述装置应用于存储系统,所述存储系统还包括第一容器单元号,所述装置包括:
    复制模块,用于将所述第一容器单元号的存储地址对应的存储空间中的有效数据块复制到第二容器单元号的存储地址对应的存储空间中;
    虚拟重映射生成模块,用于根据容器映射生成虚拟重映射,所述容器映射用于指示所述第一容器单元号的存储地址指向第一虚拟逻辑单元号的存储地址,所述虚拟重映射包括第一虚拟映射和第二虚拟映射,所述第一虚拟映射用于指示所述第一虚拟逻辑单元号的存储地址指向所述第一容器单元号的存储地址,所述第二虚拟映射用于指示所述第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;
    存储模块,用于将所述虚拟重映射存储到目标存储空间中,所述目标存储空间的所述虚拟重映射可以被至少两个主机访问;
    释放模块,用于释放所述第一容器单元号对应的存储空间。
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:
    指纹重映射生成模块,用于根据所述容器映射和指纹映射生成指纹重映射,所述指纹映射用于指示数据块的指纹指向所述第一容器单元号的存储地址,所述指纹重映射包括第一指纹映射和第二指纹映射,所述第一指纹映射用于指示所述有效数据块的指纹指向所述第一容器单元号的存储地址,所述第二指纹映射用于指示所述有效数据块的指纹指向所述第二容器单元号的存储地址;将所述指纹重映射存储到所述目标存储空间中。
  11. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    更新模块,用于根据所述目标存储空间中的所述指纹重映射更新所述控制器存储的指纹映射。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:
    指纹更新信息生成模块,用于生成第一指纹更新信息,所述第一指纹更新信息用于指示所述指纹映射是否被所述控制器更新成功;将所述第一指纹更新信息存储至所述目标存储空间内。
  13. 根据权利要求10所述的装置,其特征在于,所述目标存储空间的所述指纹重映射用于被至少一个指纹服务器访问。
  14. 根据权利要求13所述的装置,其特征在于,所述装置还包括:
    接收模块,用于接收所述至少一个指纹服务器发送的第二指纹更新信息,所述第二指纹更新信息用于指示所述指纹映射是否被所述至少一个指纹服务器更新成功;将所述第二指纹更新信息存储至所述目标存储空间内。
  15. 根据权利要求11或13所述的装置,其特征在于,所述容器映射还包括所述第一容器单元号的存储地址对应的第一初始版本号,所述指纹映射还包括所述第一容器单元号的存储地址对应的第二初始版本号,所述第一初始版本号与所述第二初始版本号相同;所述装置还包括:
    修改模块,用于将所述容器映射中的所述第一容器单元号的存储地址对应的第一初始版本号修改为目标版本号,所述目标版本号大于所述第一初始版本号;
    确定模块,用于在所述控制器接收到主机发送的增加一次对所述第一容器单元号的存储地址的有效数据块的引用请求时,确定所述容器映射中的所述第一容器单元号的存储地址对应的目标版本号,以及确定所述指纹映射中的所述第一容器单元号的存储地址对应的第二初始版本号;
    删除模块,用于在所述第二初始版本号与所述目标版本号不同时,删除所述第一容器单元号对应的所述指纹映射,或者拒绝主机发送的增加一次对第一容器单元号的 存储地址中的有效数据块的引用请求。
  16. 一种存储系统中垃圾回收的装置,其特征在于,所述装置包括:
    挂载模块,用于挂载第一虚拟逻辑单元号;存储第一虚拟映射;所述第一虚拟映射用于指示所述第一虚拟逻辑单元的存储地址指向第一容器单元号的存储地址;
    获取模块,用于获取所述存储系统中的目标存储空间内的虚拟重映射,所述目标存储空间的所述虚拟重映射可以被至少两个主机访问,所述虚拟重映射包括所述第一虚拟映射和第二虚拟映射,所述第二虚拟映射用于指示所述第一虚拟逻辑单元号的存储地址指向第二容器单元号的存储地址;所述第二容器单元号存储所述第一容器单元号中的有效数据;
    删除模块,用于删除所述第一虚拟映射,并存储所述第二虚拟映射。
  17. 一种控制器,其特征在于,包括:处理器和存储器,其中,存储器内存储有处理器能够执行的操作指令,处理器读取存储器内的操作指令用于实现权利要求1至7任意一项所述的方法。
  18. 一种主机,其特征在于,包括:处理器和存储器,其中,存储器内存储有处理器能够执行的操作指令,处理器读取存储器内的操作指令用于实现权利要求8所述的方法。
PCT/CN2018/100738 2017-09-30 2018-08-16 一种存储系统中垃圾回收的方法及装置 WO2019062370A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710915762.8A CN107608907B (zh) 2017-09-30 2017-09-30 一种存储系统中垃圾回收的方法及装置
CN201710915762.8 2017-09-30

Publications (1)

Publication Number Publication Date
WO2019062370A1 true WO2019062370A1 (zh) 2019-04-04

Family

ID=61068272

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/100738 WO2019062370A1 (zh) 2017-09-30 2018-08-16 一种存储系统中垃圾回收的方法及装置

Country Status (2)

Country Link
CN (1) CN107608907B (zh)
WO (1) WO2019062370A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608907B (zh) * 2017-09-30 2020-10-23 华为技术有限公司 一种存储系统中垃圾回收的方法及装置
CN109901910B (zh) * 2019-01-17 2021-12-07 珠海金山网络游戏科技有限公司 基于分布式容器的文件拉取或推送方法及装置
CN111338570B (zh) * 2020-02-16 2022-07-22 苏州浪潮智能科技有限公司 一种并行文件系统io优化方法与系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103365788A (zh) * 2013-08-06 2013-10-23 山东大学 实时闪存转换层使用的自适应局部垃圾回收方法
CN103744798A (zh) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 固态硬盘的垃圾回收方法
CN105389266A (zh) * 2015-10-16 2016-03-09 联想(北京)有限公司 一种数据管理方法及装置
US20170031818A1 (en) * 2015-07-30 2017-02-02 Emc Corporation Memory Centric Database Architecture
CN106484323A (zh) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 一种固态存储的损耗均衡方法及系统
CN107608907A (zh) * 2017-09-30 2018-01-19 华为技术有限公司 一种存储系统中垃圾回收的方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8539008B2 (en) * 2011-04-29 2013-09-17 Netapp, Inc. Extent-based storage architecture

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103365788A (zh) * 2013-08-06 2013-10-23 山东大学 实时闪存转换层使用的自适应局部垃圾回收方法
CN103744798A (zh) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 固态硬盘的垃圾回收方法
US20170031818A1 (en) * 2015-07-30 2017-02-02 Emc Corporation Memory Centric Database Architecture
CN105389266A (zh) * 2015-10-16 2016-03-09 联想(北京)有限公司 一种数据管理方法及装置
CN106484323A (zh) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 一种固态存储的损耗均衡方法及系统
CN107608907A (zh) * 2017-09-30 2018-01-19 华为技术有限公司 一种存储系统中垃圾回收的方法及装置

Also Published As

Publication number Publication date
CN107608907A (zh) 2018-01-19
CN107608907B (zh) 2020-10-23

Similar Documents

Publication Publication Date Title
US11675746B2 (en) Virtualized server systems and methods including domain joining techniques
US11093159B2 (en) Storage system with storage volume pre-copy functionality for increased efficiency in asynchronous replication
CN106708425B (zh) 分布式多模存储管理
KR100874702B1 (ko) 플래시 메모리 파일 시스템을 효율적으로 관리하기 위한장치 드라이버 및 방법
US8892846B2 (en) Metadata management for virtual volumes
JP4681505B2 (ja) 計算機システム、管理計算機及びプログラム配布方法
US8533231B2 (en) Cloud storage system with distributed metadata
JP2020506462A (ja) ファイルシステムデータ階層のクラウド移行
US20130232215A1 (en) Virtualized data storage system architecture using prefetching agent
US20060174074A1 (en) Point-in-time copy operation
JP2017130103A (ja) ブロックストレージ
WO2019062370A1 (zh) 一种存储系统中垃圾回收的方法及装置
WO2021057956A1 (zh) 镜像文件管理方法、装置及系统、计算机设备、存储介质
CN101350030A (zh) 用于缓存数据的方法及装置
US8370943B1 (en) Load balancing of scan requests to all antivirus servers in a cluster
US20190087130A1 (en) Key-value storage device supporting snapshot function and operating method thereof
US11194682B2 (en) Connectivity-aware witness for active-active storage
JP6653370B2 (ja) ストレージシステム
JP2016212551A (ja) ストレージ制御装置、ストレージ制御プログラム、およびストレージシステム
US20210286734A1 (en) Persistent read cache in a scale out storage system
KR101713314B1 (ko) 가비지 파일의 삭제 방법 및 시스템
US20180373457A1 (en) Methods for copy-free data migration across filesystems and devices thereof
JP7490036B2 (ja) ストレージシステム及びデータ処理方法
CN111868704B (zh) 用于加速存储介质访问的方法及其设备
US20200333970A1 (en) Data de-duplication

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18860038

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18860038

Country of ref document: EP

Kind code of ref document: A1