CN107608907B - Method and device for recycling garbage in storage system - Google Patents

Method and device for recycling garbage in storage system Download PDF

Info

Publication number
CN107608907B
CN107608907B CN201710915762.8A CN201710915762A CN107608907B CN 107608907 B CN107608907 B CN 107608907B CN 201710915762 A CN201710915762 A CN 201710915762A CN 107608907 B CN107608907 B CN 107608907B
Authority
CN
China
Prior art keywords
fingerprint
virtual
unit number
mapping
controller
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710915762.8A
Other languages
Chinese (zh)
Other versions
CN107608907A (en
Inventor
格雷厄姆·布罗姆利
张巍
余小安
张志雄
詹姆斯·马特
蓝文海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710915762.8A priority Critical patent/CN107608907B/en
Publication of CN107608907A publication Critical patent/CN107608907A/en
Priority to PCT/CN2018/100738 priority patent/WO2019062370A1/en
Application granted granted Critical
Publication of CN107608907B publication Critical patent/CN107608907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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

The embodiment of the application discloses a method and a device for garbage recovery in a storage system, wherein the method comprises the following steps: the controller copies the effective data blocks 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 generates a virtual remapping according to the container mapping; the controller stores the virtual remapping in a target storage space, the virtual remapping of the target storage space being accessible by the at least two hosts; the controller releases the storage space corresponding to the first container unit number. After the controller stores the virtual remapping in the target storage space, at least two hosts do not need to sequentially process the virtual remapping, but independently process the virtual remapping in the target storage space, so that the parallel recovery of the storage space corresponding to the storage address of the first container unit number is realized, and the garbage recovery efficiency is greatly improved.

Description

Method and device for recycling garbage in storage system
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a method and a device for garbage collection in a storage system.
Background
The Garbage Collection (GC) technology is a technology for a storage system to collect storage space, and the principle of the Garbage Collection technology is briefly introduced in combination with an application scenario.
Firstly, a controller of a storage system scans container mapping to find out which storage spaces corresponding to containers can be released, and Virtual Logical Unit Number (VLUN) remapping is generated; secondly, the controller needs to sort out the remap B1 related to the host a1 from the remap of the virtual logical unit number, and send the remap B1 to the host a1, so that the host a1 updates the pre-stored mapping of the virtual logical unit number based on the remap B1; again, after host A1 completes the update, host A1 may send a notification to the controller that the update is complete. Thereafter, the controller may send remaps (B2, B3, …) to the multiple hosts (A2, A3, …) in sequence. It should be noted that the controller will not send a remap to the next host until the update of one host is completed.
In the garbage collection, the controller interacts with a plurality of hosts in sequence to update the virtual logical unit number mapping, thereby causing low collection efficiency.
Disclosure of Invention
The embodiment of the application provides a method and a device for garbage recovery in a storage system, so as to improve the recovery efficiency of a garbage recovery technology.
The embodiment of the application is realized as follows:
in a first aspect, an 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 effective data blocks 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 generates a virtual remapping according to the container mapping, the container mapping is used for indicating that the storage address of the first container unit number points to the storage address of the first virtual logic unit number, the virtual remapping comprises a first virtual mapping and a second virtual mapping, the first virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of the first container unit number, and the second virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of the second container unit number;
the controller stores the virtual remapping in a target storage space, the virtual remapping of the target storage space being accessible by the at least two hosts;
the controller releases the storage space corresponding to the first container unit number.
In the first aspect, after the controller generates the virtual remap according to the container map, the controller stores the virtual remap in the target storage space, the virtual remap of the target storage space can be accessed by the at least two hosts, and the at least two hosts can concurrently obtain the relevant virtual remap from the target storage space of the controller. The at least two hosts can independently update their respective virtual mappings according to the virtual remap, thereby enabling the updating of the at least two hosts. The controller may then free the storage space corresponding to the first container unit number. Therefore, after the controller stores the virtual remapping in the target storage space, at least two hosts do not need to sequentially process the virtual remapping, but independently process the virtual remapping in the target storage space, so as to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the garbage recovery efficiency.
In one possible implementation, before the controller releases the storage space corresponding to the first container unit number, the method further includes:
the controller generates fingerprint remapping according to the container mapping and the fingerprint mapping, the fingerprint mapping is used for indicating the fingerprint of the data block to point to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint mapping and a second fingerprint mapping, the first fingerprint mapping is used for indicating the fingerprint of the valid data block to point to the storage address of the first container unit number, and the second fingerprint mapping is used for indicating the fingerprint of the valid data block to point to the storage address of the second container unit number;
the controller stores the fingerprint remap in the target storage space.
In one possible implementation, the method further includes:
the controller updates the fingerprint map stored by the controller according to the fingerprint remapping in the target storage space.
In one possible implementation, the method further includes:
the controller generates first fingerprint updating information, wherein the first fingerprint updating information is used for indicating 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, since the controller stores the container mapping and the fingerprint mapping corresponding to the first container unit number in advance. After the controller generates the fingerprint remap, the fingerprint remap may be stored in the target storage space. When the controller detects that the target storage space has the fingerprint remapping, the controller updates the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space. Then, the controller stores first fingerprint update information indicating whether the fingerprint mapping is successfully updated by the controller in the target storage space. Therefore, after the controller re-maps and stores the fingerprints in the target storage space, the controller can process the fingerprints in the target storage space in parallel to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the recovery efficiency of the garbage recovery technology.
In one possible implementation, the fingerprint remapping of the target storage space is for access by at least one fingerprint server.
In one possible implementation, the method further includes:
the controller receives second fingerprint update information sent by the at least one fingerprint server, wherein the second fingerprint update information is used for indicating whether the fingerprint mapping is successfully updated by the at least one fingerprint server;
the controller stores the second fingerprint updating information into the target storage space.
The controller may generate the fingerprint remapping according to the container mapping and the fingerprint mapping, since the controller stores the container mapping and the fingerprint mapping corresponding to the first container unit number in advance. After the controller generates the fingerprint remap, the fingerprint remap may 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 first fingerprint mapping stored in advance and add the second fingerprint mapping. After the fingerprint server updates the fingerprint map according to the fingerprint remapping, the fingerprint server sends second fingerprint updating information to the controller for indicating whether the fingerprint map is successfully updated by the fingerprint server. Then, the controller stores the second fingerprint updating information into the target storage space. Therefore, after the controller re-maps and stores the fingerprints in the target storage space, at least one fingerprint server can process the fingerprints in the target storage space in parallel to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further the recovery efficiency of the garbage recovery technology is greatly improved.
In a possible implementation manner, the container map further includes a first initial version number corresponding to the storage address of the first container unit number, the fingerprint map further includes a second initial version number corresponding to the storage address of the first container unit number, and the first initial version number is the same as the second initial version number;
the method further comprises the following steps:
the controller modifies a first initial version number corresponding to a storage address of a first container unit number in the container mapping into a target version number, wherein the target version number is greater than the first initial version number;
when the controller receives a reference request which is sent by a host and is added once to a valid data block of a storage address of a 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 mapping and determines a second initial version number corresponding to the storage address of the first container unit number in the fingerprint mapping;
and 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, or the controller rejects a reference request which is sent by the host and added once to the effective data blocks in the storage address of the first container unit number.
After the controller remaps and updates the fingerprint mapping stored in 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 or not, and does not need to store the fingerprint update information in the target storage space, and even if the controller unsuccessfully updates the fingerprint mapping, the recovery effect of the storage space corresponding to the first container unit number cannot be influenced, so that the garbage recovery process is simplified, and the recovery efficiency of the garbage recovery technology is improved.
In a second aspect, an 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 logic unit number; the host stores a first virtual mapping; the first virtual map is used for indicating that the storage address of the first virtual logical unit points to the storage address of the first container unit number;
the method comprises the steps that a host computer obtains virtual remapping in a target storage space in a storage system, the virtual remapping of the target storage space can be accessed by at least two host computers, the virtual remapping comprises a first virtual mapping and a second virtual mapping, and the second virtual mapping is used for indicating that a storage address of a first virtual logic unit number points to a storage address of a second container unit number; the second container unit number stores valid data in the first container unit number;
the host deletes the first virtual mapping and stores the second virtual mapping.
In a second aspect, after the controller generates the virtual remap according to the container map, the controller stores the virtual remap in a target storage space, the virtual remap of the target storage space can be accessed by at least two hosts, and the at least two hosts can concurrently obtain the relevant virtual remap from the target storage space of the controller. The at least two hosts can independently update their respective virtual mappings according to the virtual remap, thereby enabling the updating of the at least two hosts. The controller may then free the storage space corresponding to the first container unit number. Therefore, after the controller stores the virtual remapping in the target storage space, at least two hosts do not need to sequentially process the virtual remapping, but independently process the virtual remapping in the target storage space, so as to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the garbage recovery efficiency.
In a third aspect, an embodiment of the present application provides an apparatus for garbage collection in a storage system, where the apparatus is applied to the storage system, the storage system further includes a first container unit number, and the apparatus includes:
the copying module is used for copying the data blocks 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 virtual remapping generation module is used for generating virtual remapping according to the container mapping, the container mapping is used for indicating that the storage address of the first container unit number points to the storage address of the first virtual logic unit number, the virtual remapping comprises a first virtual mapping and a second virtual mapping, the first virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of the first container unit number, and the second virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of the second container unit number;
a storage module for storing the virtual remapping in a target storage space, the virtual remapping of the target storage space being accessible by at least two hosts;
and the releasing module is used for releasing the storage space corresponding to the first container unit number.
In one possible implementation, the apparatus further includes:
the fingerprint remapping generation module is used for generating fingerprint remapping according to the container mapping and the fingerprint mapping, the fingerprint mapping is used for indicating the fingerprint of the data block to point to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint mapping and a second fingerprint mapping, the first fingerprint mapping is used for indicating the fingerprint of the effective data block to point to the storage address of the first container unit number, and the second fingerprint mapping is used for indicating the fingerprint of the effective data block to point to the storage address of the second container unit number; storing the fingerprint remapping in the target storage space.
In one possible implementation, the apparatus further includes:
and the updating module is used for updating the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
In one possible implementation, the apparatus further includes:
the fingerprint updating information generating module is used for generating first fingerprint updating information, and the first fingerprint updating information is used for indicating whether the fingerprint mapping is successfully updated by the controller; and storing the first fingerprint updating information into the target storage space.
In one possible implementation, the fingerprint remapping of the target storage space is for access by at least one fingerprint server.
In one possible implementation, the apparatus further includes:
the receiving module is used for receiving second fingerprint update information sent by the at least one fingerprint server, and the second fingerprint update information is used for indicating whether the fingerprint mapping is successfully updated by the at least one fingerprint server; and storing the second fingerprint updating information into the target storage space.
In a possible implementation manner, the container map further includes a first initial version number corresponding to the storage address of the first container unit number, the fingerprint map further includes a second initial version number corresponding to the storage address of the first container unit number, and the first initial version number is the same as the second initial version number; the device still includes:
the modification module is used for modifying a first initial version number corresponding to the storage address of the first container unit number in the container mapping into a target version number, and the target version number is greater than the first initial version number;
the device comprises a determining module, a judging module and a storing module, wherein the determining module is used for determining a target version number corresponding to a storage address of a first container unit number in a container mapping and determining a second initial version number corresponding to the storage address of the first container unit number in a fingerprint mapping when a controller receives a reference request which is sent by a host and is added once for a valid data block of the storage address of the first container unit number;
and the deleting module is used for deleting the fingerprint mapping corresponding to the first container unit number or rejecting a request for adding one reference to the effective data block in the storage address of the first container unit number, which is sent by the host, when the second initial version number is different from the target version number.
In a fourth aspect, an embodiment of the present application provides an apparatus for garbage collection in a storage system, where the apparatus includes:
the mounting module is used for mounting the first virtual logic unit number; storing the first virtual mapping; the first virtual map is used for indicating that the storage address of the first virtual logical unit points to the storage address of the first container unit number;
an obtaining module, configured to obtain a virtual remapping in a target storage space in a storage system, where the virtual remapping in the target storage space is accessible to at least two hosts, and the virtual remapping includes a first virtual mapping and a second virtual mapping, and the second virtual mapping is used to indicate that a storage address of a first virtual logical unit number points to a storage address of a second container unit number; the second container unit number stores valid data in the first container unit number;
and the deleting module is used for deleting the first virtual mapping and storing the second virtual mapping.
In a fifth aspect, an embodiment of the present application provides a controller, including: a processor and a memory, wherein the memory stores therein operating instructions executable by the processor, and the operating instructions in the memory are read by the processor for implementing the first aspect or the method described in any possible implementation manner of the first aspect.
In a sixth aspect, an embodiment of the present application provides a host, including: a processor and a memory, wherein the memory stores therein operating instructions executable by the processor, and the processor reads the operating instructions in the memory to implement the method described in the second aspect or any possible implementation manner of the second aspect.
Drawings
Fig. 1 is a schematic view illustrating a storage system and a host according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a method for garbage collection in a storage system according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating another method for garbage collection in a storage system according to an embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating a method for garbage collection in a storage system according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for garbage collection in a storage system according to an embodiment of the present application;
FIG. 6 is a flow chart illustrating a method for garbage collection in a storage system according to an embodiment of the present application;
FIG. 7 is a flow chart illustrating a method for garbage collection in a storage system according to an embodiment of the present application;
fig. 8 is a schematic diagram illustrating an apparatus for garbage collection in a storage system according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram illustrating an apparatus for garbage collection in another storage system according to an embodiment of the present disclosure;
fig. 10 is a schematic diagram illustrating an apparatus for garbage collection in another storage system according to an embodiment of the present application;
fig. 11 is a schematic diagram illustrating a garbage collection apparatus in another storage system according to an embodiment of the present disclosure.
Detailed Description
Referring to fig. 1, fig. 1 is a schematic view illustrating a scenario of a storage system and a host according to an embodiment of the present disclosure. In the scenario diagram shown in fig. 1, a computer cluster 10 and a storage system 20 are included, the computer cluster 10 includes a plurality of hosts such as a host 11, a host 12, and a host 13, the storage system 20 includes a plurality of controllers such as a controller 21, a controller 22, and a controller 23, and the storage system further includes a memory 31, a memory 32, a memory 33, and the like. Among them, the controller 21 manages the container unit number of the memory 31, the controller 22 manages the container unit number of the memory 32, and the controller 23 manages the container unit number of the memory 33. The fingerprint server may be located inside the controller or outside the controller, so the fingerprint server is not shown in fig. 1. The memory can be a solid state disk, a mechanical hard disk, etc., and the invention is not limited to the memory type.
With reference to the scenario diagram shown in fig. 1, each host mounts a virtual logical unit number (hereinafter, the virtual logical unit number is abbreviated as VLUN), and the size of the storage space corresponding to each VLUN can be set by a user of each host. The storage space corresponding to each VLUN is divided into a plurality of storage units, each storage unit is used for storing a data block, and each storage unit can be indicated by a logical block address (hereinafter, the logical block address is simply referred to as LBA). For example, the user of host 11 sets the storage space of VLUN1 to 1GB, and divides the storage space of 1GB into a plurality of storage units, each storage unit being 512 bytes or 4 kbytes.
With reference to the scene diagram shown in fig. 1, each controller generates a plurality of container unit numbers (hereinafter, the container unit numbers are referred to as PLUNs) in advance, and allocates a certain storage space to each PLUN, the storage space corresponding to each PLUN is divided into a plurality of storage units, each storage unit is used for storing a data block, and each storage unit can be indicated by using an LBA. For example, controller 21 allocates 1GB of storage space to PLUN1, allocates the 1GB of storage space to memory 31, and divides memory 31 into a plurality of memory locations, each memory location being 512 bytes or 4 kbytes.
The following briefly describes the process of writing data and establishing a mapping by the host, in conjunction with the scenario diagram shown in fig. 1.
First, assume that application software on host 11 generates a request to write data a of 4KB in size on the corresponding storage space (VLUN1, LBA 1).
Then, upon receiving the request from the host 11, the host 11 calculates the fingerprint of the data a as FP1 and sends the fingerprint FP1 to the fingerprint server. The fingerprint server can be integrated inside the controller or can be separately arranged outside the controller.
Second, the fingerprint server will determine whether the fingerprint FP1 is pre-stored.
If the fingerprint server determines that the fingerprint FP1 is pre-stored, the fingerprint server will send the storage address (PLUN1, LBA1, 4KB) of the container unit number corresponding to the fingerprint FP1 to the host 11; since PLUN1 belongs to controller 21, host 11 sends a reference request to controller 21 to add a data block in the storage space corresponding to (PLUN1, LBA1, 4KB) once, where the storage space corresponding to (PLUN1, LBA1, 4KB) is one storage unit of memory 31; controller 21 will grant the reference request and establish a container map (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4 KB); host 11 will establish a virtual mapping (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4 KB).
If the fingerprint server judges that the fingerprint FP1 is not stored, the fingerprint server sends an instruction of not storing the FP1 to the host 11; the host 11, upon receiving the command, requests a PLUN corresponding to (VLUN1, LBA1) from the controller 21; the controller 21 sends a new storage address (PLUN1, LBA2, 4KB) to the host 11, where the storage space corresponding to (PLUN1, LBA2, 4KB) is a storage unit of the memory 31, and the storage space corresponding to (PLUN1, LBA2, 4KB) does not store data; controller 21 establishes a container map (PLUN1, LBA2, 4KB- > VLUN1, LBA1, 4 KB); host 11 will establish a virtual mapping (VLUN1, LBA1, 4KB- > PLUN1, LBA2, 4 KB); the fingerprint server establishes a fingerprint map (FP1- > PLUN1, LBA2, 4 KB).
In the embodiment shown in fig. 1, not only the host 11 but also the hosts 12 and 13 in the computer cluster 10 can use the storage space corresponding to the PLUN1 belonging to the controller 21, but also the host 1 belonging to the controller 21. Of course, the hosts 11, 12, 13, and the like in the computer cluster 10 may use the storage space corresponding to the PLUN belonging to the controller such as the controller 22 and the controller 23 in the storage system 20.
The foregoing embodiment introduces a process of writing data and establishing mapping by a host, and a process of garbage collection in a storage system provided in the embodiment of the present application will be described below with reference to the drawings in the embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for garbage collection in a storage system according to an embodiment of the present application. In the method shown in fig. 2, after the controller stores the virtual remapping in the target storage space, each host independently processes the virtual remapping in the target storage space without sequentially processing the virtual remapping, so as to implement parallel recovery of the storage space corresponding to the storage address of the first container unit number, thereby greatly improving garbage recovery efficiency. The method comprises the following steps.
In step S11, the controller copies the valid data blocks 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 garbage recycling method provided by the embodiment of the application can be applied to a storage system. The storage system may include a controller and a first container unit number.
Prior to step S11, the host has established a first virtual mapping indicating 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 a container mapping indicating that the storage address of the first container unit number points to the storage address of the first virtual logical unit number.
In step S11, the controller copies the valid data blocks 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, which indicates that the controller needs to release the storage space corresponding to the first container unit number, and therefore needs to copy the valid data blocks in the first container unit number to the storage space corresponding to the storage address of the second container unit number.
For example, assume that the first virtual mapping is (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4KB), the container mapping is (PLUN1, LBA1, 4KB- > VLUN1, 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 first container unit number is PLUN1, the storage address of the first container unit number is (PLUN1, LBA1, 4KB), the second container unit number is PLUN2, and the storage address of the second container unit number is (PLUN2, LBA1, 4 KB).
As can be seen from the step S11, when the storage space corresponding to (PLUN1, LBA1, 4KB) stores the valid data block, and the controller needs to first copy the valid data block in the storage space corresponding to (PLUN1, LBA1, 4KB) to the storage space corresponding to (PLUN2, LBA1, 4KB) when the controller needs to release the storage space corresponding to PLUN1, the controller needs to prepare for releasing PLUN 1.
In step S12, the controller generates a virtual remapping from the container mapping.
After the controller copies the valid data blocks 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 remapping according to the container mapping, so that the at least two hosts can update the virtual mapping according to the virtual remapping.
The virtual remapping includes a first virtual mapping indicating that the storage address of the first virtual logical unit number points to the storage address of the first container unit number, and a second virtual mapping indicating that the storage address of the first virtual 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 a virtual map that at least two hosts need to add.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a virtual remap includes a first virtual map of (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4KB) and a second virtual map of (VLUN1, LBA1, 4KB- > PLUN2, LBA1, 4 KB). After the host acquires the virtual remapping, the host needs to delete the pre-stored first virtual mapping and add the second virtual mapping.
Step S13, the controller stores the virtual remapping in the target storage space, the virtual remapping of the target storage space being accessible to at least two hosts.
After the controller generates the virtual remapping according to the container mapping, the controller needs to store the virtual remapping in the target storage space, so that at least two hosts can actively acquire the virtual remapping in the target storage space. The virtual remapping may be stored in the target storage space in the form of a file, document, log, or the like.
The target storage space in the controller is not limited to 1, and may be plural. The number of target storage spaces and the size of each target storage space can be automatically configured by the controller or can be configured by staff in advance.
Since the first container unit number belongs to the controller, the host that refers to the storage address of the first container unit number can actively acquire the virtual remapping in the target storage space to update the first virtual mapping of the host itself.
For example, in connection with FIG. 1, assume that the first virtual mapping pre-stored by host 11 is (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4KB), and PLUN1 is attributed to controller 21. After controller 21 stores the virtual remap in the target storage space, both host 11 and the host referencing the storage address of PLUN1 will actively obtain the virtual remap in the target storage space. The virtual remap includes a first virtual map (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4KB), and a second virtual map (VLUN1, LBA1, 4KB- > PLUN2, LBA1, 4KB), the first virtual map being a virtual map that host 11 needs to delete, and the second virtual map being a virtual map that host 11 needs to add. After the host 11 obtains the virtual remap, 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 of the first virtual logical unit number of the host 11 (VLUN1, LBA1, 4KB) no longer points to the storage address of the first container unit number (PLUN1, LBA1, 4KB) but points to the storage address of the second container unit number (PLUN2, LBA1, 4 KB).
Of course, in an actual scenario, the storage address of the first container unit number and the storage address of the second container unit number may each include a plurality of pieces of information, and are not limited to 1 piece of information.
For example, the storage address of the first container unit number includes (PLUN1, LBA1, 4KB), (PLUN1, LBA2, 4KB), (PLUN1, LBA3, 4KB), and (PLUN1, LBA4, 4KB), and the like; the storage address of the second container unit number includes (PLUN2, LBA1, 4KB), (PLUN2, LBA2, 4KB), (PLUN2, LBA3, 4KB), and (PLUN2, LBA4, 4KB), and the like.
Of course, in an actual scenario, the container map, the first virtual map, and the second virtual map may include multiple maps, and are not limited to 1 map.
For example, the container map 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), etc.; 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), etc.; 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- > PLUN2, LBA4, 4KB), etc.
In step S14, the controller releases the storage space corresponding to the first container unit number.
After the host referencing the valid data block of the storage address of the first container unit number succeeds in updating according to the virtual remapping, the controller needs to update the container mapping associated with the storage address of the first container unit number, and the fingerprint server needs to update the fingerprint mapping associated with the storage address of the first container unit number. After the information related to 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.
In the embodiment shown in fig. 2, after the controller generates the virtual remap according to the container map, the controller stores the virtual remap in the target storage space, the virtual remap of the target storage space can be accessed by at least two hosts, and the at least two hosts can concurrently obtain the relevant virtual remap from the target storage space of the controller. The at least two hosts can independently update respective virtual mappings according to the virtual remapping, so that the updating of the at least two hosts is realized. The controller may then free the storage space corresponding to the first container unit number. Therefore, after the controller stores the virtual remapping in the target storage space, at least two hosts do not need to sequentially process the virtual remapping, but independently process the virtual remapping in the target storage space, so as to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the garbage recovery efficiency.
Referring to fig. 3, fig. 3 is a flowchart illustrating another method for garbage collection in a storage system according to an embodiment of the present application. The embodiment shown in fig. 3 is a modified embodiment based on fig. 2, so the same thing as fig. 2 can be seen in the embodiment shown in fig. 2. The method shown in fig. 3 comprises the following steps.
In step S21, the controller copies the valid data blocks 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.
In step S22, the controller generates a virtual remapping from the container mapping.
Step S23, the controller stores the virtual remapping in the target storage space, the virtual remapping of the target storage space being accessible to at least two hosts.
Step S24, the controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
After the controller copies the valid data blocks 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 needs to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, so that the controller can update the virtual mapping according to the fingerprint remapping.
The fingerprint map is used for indicating that the fingerprint of the data block points to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint map and a second fingerprint map, the first fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the first container unit number, and the second fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the second container unit number. The first fingerprint map is used to indicate a fingerprint map that the controller needs to delete, and the second fingerprint map is used to indicate a fingerprint map that the controller needs to add.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB).
Step S25, the controller remaps and stores the fingerprint in the target storage space.
Wherein after the controller generates the fingerprint remap based on the container map and the fingerprint map, the controller needs to store the fingerprint remap in the target storage space. The fingerprint remapping may be stored in the target storage space in the form of a file, document or log, etc.
And step S26, the controller updates the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
When the controller detects that the fingerprint remapping exists in the target storage space, the controller needs to delete the first fingerprint mapping stored in advance and add the second fingerprint mapping.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB). When the controller detects that the fingerprint remapping exists in the target storage space, the controller needs to delete the first fingerprint mapping (FP1- > PLUN1, LBA1, 4KB) stored in advance and add the second fingerprint mapping (FP1- > PLUN2, LBA1, 4 KB).
In step S27, the controller generates first fingerprint update information indicating whether the fingerprint mapping is successfully updated by the controller.
After the controller updates the fingerprint mapping stored in the controller according to the fingerprint remapping in the target storage space, the controller needs to generate first fingerprint updating information to indicate whether the fingerprint mapping is updated successfully 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 map fails to be updated by the controller, the first fingerprint update information is used to indicate that the fingerprint map fails to be updated by the controller.
And step S28, the controller stores the first fingerprint updating information in the target storage space.
After the controller generates the first fingerprint updating information, the controller can store the first fingerprint updating information into the target storage space, so that the controller can judge whether the storage space corresponding to the first container unit number can be released according to the first fingerprint updating information and other related updating information.
If the controller judges that the fingerprint mapping, the container mapping, the virtual mapping and the like corresponding to the first container unit number are updated according to the first fingerprint updating information and other related updating information, the controller can release the storage space corresponding to the first container unit number.
In step S29, the controller releases the storage space corresponding to the first container unit number.
In the embodiment shown in fig. 3, since the controller stores the container map and the fingerprint map corresponding to the first container unit number in advance, the controller may generate the fingerprint remapping from the container map and the fingerprint map. After the controller generates the fingerprint remap, the fingerprint remap may be stored in the target storage space. When the controller detects that the target storage space has the fingerprint remapping, the controller updates the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space. Then, the controller stores first fingerprint update information indicating whether the fingerprint mapping is successfully updated by the controller in the target storage space. Therefore, after the controller re-maps and stores the fingerprints in the target storage space, the controller can utilize the fingerprints in the multi-thread parallel processing target storage space to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the recovery efficiency of the garbage recovery technology.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for garbage collection in a storage system according to another embodiment of the present application. The embodiment shown in fig. 4 is a modified embodiment based on fig. 2, so the same contents as fig. 2 can be referred to the embodiment shown in fig. 2. In the embodiment shown in fig. 4, the fingerprint server is arranged inside the controller. The method shown in fig. 4 includes the following steps.
In step S31, the controller copies the valid data blocks 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.
In step S32, the controller generates a virtual remapping from the container mapping.
Step S33, the controller stores the virtual remapping in the target storage space, the virtual remapping of the target storage space being accessible to at least two hosts.
Step S34, the controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
After the controller copies the valid data blocks 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 needs to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, so that the controller can update the virtual mapping according to the fingerprint remapping.
The fingerprint map is used for indicating that the fingerprint of the data block points to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint map and a second fingerprint map, the first fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the first container unit number, and the second fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the second container unit number. The first fingerprint map is used to indicate a fingerprint map that the controller needs to delete, and the second fingerprint map is used to indicate a fingerprint map that the controller needs to add.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB).
Step S35, the controller remaps and stores the fingerprint in the target storage space.
Wherein after the controller generates the fingerprint remap based on the container map and the fingerprint map, the controller needs to store the fingerprint remap in the target storage space. The fingerprint remapping may be stored in the target storage space in the form of a file, document or log, etc.
And step S36, the controller updates the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
When the controller detects that the fingerprint remapping exists in the target storage space, the controller needs to update the fingerprint mapping stored in the controller according to the fingerprint remapping, namely the controller needs to delete the first fingerprint mapping stored in advance and add the second fingerprint mapping.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB). When the controller detects that the fingerprint remapping exists in the target storage space, the controller needs to delete the first fingerprint mapping (FP1- > PLUN1, LBA1, 4KB) stored in advance and add the second fingerprint mapping (FP1- > PLUN2, LBA1, 4 KB).
Of course, there is a possibility that the controller fails to update, i.e. the controller cannot successfully delete the first fingerprint map and cannot successfully add the second fingerprint map. Even if the controller fails to update, the controller will not be influenced to release the storage space corresponding to the first container unit number.
In step S37, the controller releases the storage space corresponding to the first container unit number.
When the controller receives the notification of successful update of the virtual remapping sent by the host, the controller indicates that the host deletes the first virtual mapping and adds the second virtual mapping, so that the controller can release the storage space corresponding to the first container unit number at this time without considering whether the fingerprint remapping is successfully updated.
Step S38, the controller modifies a first initial version number corresponding to the storage address of the first container unit number in the container map to a target version number, where the target version number is greater than the first initial version number.
In this embodiment of the present application, the container map further includes a first initial version number corresponding to the storage address of the first container unit number, and the fingerprint map further includes a second initial version number corresponding to the storage address of the first container unit number, where the first initial version number is the same as the second initial version number.
For example, assume a container map of (PLUN1, LBA1, 4KB, first initial version number- > VLUN1, LBA1, 4KB), a fingerprint map of (FP1- > PLUN1, LBA1, 4KB, second initial version number), and the first initial version number is equal to the second initial version number.
After the controller releases the storage space corresponding to the first container unit number, the controller needs to modify a first initial version number corresponding to the storage address of the first container unit number in the container map to a target version number, and the target version number is greater than the first initial version number. The purpose of this is that if the controller fails to update the fingerprint map, i.e. the controller cannot successfully delete the first fingerprint map and cannot successfully add the second fingerprint map, it can be ensured that at least the version number in the container map is different from the version number of the first fingerprint map stored in advance by the controller, and this is used to indicate that the fingerprint map update fails.
Step S39, when the controller receives a request sent by the host to add a reference to a valid data block in 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 determines a second initial version number corresponding to the storage address of the first container unit number in the fingerprint map.
After 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 a request for adding one reference to a valid data block in the storage address of the first container unit number to the controller, 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 second initial version number corresponding to the storage address of the first container unit number in the fingerprint map.
And 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.
After the controller releases the storage space corresponding to the first container unit number, the controller modifies a first initial version number corresponding to the storage address of the first container unit number in the container mapping into a target version number. If the controller fails to update the fingerprint mapping, the first fingerprint mapping cannot be deleted, and the version number in the container mapping is different from the version number of the first fingerprint mapping stored in the controller in advance, so that the second initial version number is different from the target version number, and at the moment, the controller rejects a request for adding one time of reference to an effective data block in the storage address of the first container unit number, which is sent by the host; when the host detects that the controller refuses to add a reference request for an effective data block in the storage address of the first container unit number, the host sends a deletion instruction for deleting the fingerprint mapping corresponding to the first container unit number to a fingerprint server in the controller; when the fingerprint server in the controller receives a deletion instruction sent by the host, the fingerprint server deletes the fingerprint mapping corresponding to the first container unit number.
In the embodiment shown in fig. 4, after the controller updates the fingerprint map stored by the controller according to the fingerprint remapping in the target storage space, the controller does not need to generate fingerprint update information for indicating whether the fingerprint map is successfully updated or not, and does not need to store the fingerprint update information in the target storage space, and even if the controller fails to successfully update the fingerprint map, the recovery effect of the storage space corresponding to the first container unit number is not affected, so that the garbage recovery process is simplified, and the recovery efficiency of the garbage recovery technology is improved.
Referring to fig. 5, fig. 5 is a flowchart illustrating a method for garbage collection in a storage system according to another embodiment of the present application. The embodiment shown in fig. 5 is a modified embodiment based on fig. 2, so the same contents as fig. 2 can be referred to the embodiment shown in fig. 2. The method shown in fig. 5 includes the following steps.
In step S41, the controller copies the valid data blocks 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.
In step S42, the controller generates a virtual remapping from the container mapping.
Step S43, the controller stores the virtual remapping in the target storage space, the virtual remapping of the target storage space being accessible to at least two hosts.
Step S44, the controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
After the controller copies the valid data blocks 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 needs to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, so that the controller can update the virtual mapping according to the fingerprint remapping.
The fingerprint map is used for indicating that the fingerprint of the data block points to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint map and a second fingerprint map, the first fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the first container unit number, and the second fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the second container unit number. The first fingerprint map is used to indicate a fingerprint map that the controller needs to delete, and the second fingerprint map is used to indicate a fingerprint map that the controller needs to add.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB).
Step S45, the controller stores the fingerprint remapping in a target storage space, the fingerprint remapping of the target storage space for access by at least one fingerprint server.
Wherein after the controller generates the fingerprint remap according to the container map and the fingerprint map, the controller needs to store the fingerprint remap in the target storage space so that the fingerprint remap of the target storage space can be accessed by the at least one fingerprint server. The fingerprint remapping may be stored in the target storage space in the form of a file, document or log, etc.
After the fingerprint server obtains the fingerprint remapping of the target storage space, the fingerprint server needs to delete the first fingerprint mapping stored in advance and add the second fingerprint mapping.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB). After the fingerprint server acquires the fingerprint remapping of the target storage space, the fingerprint server needs to delete the first fingerprint mapping (FP1- > PLUN1, LBA1, 4KB) stored in advance and add the second fingerprint mapping (FP1- > PLUN2, LBA1, 4 KB).
In step S46, the controller receives 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 map is successfully updated by the at least one fingerprint server.
After the fingerprint server updates the fingerprint mapping according to the fingerprint remapping, the fingerprint server needs to generate second fingerprint updating 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 for indicating that the fingerprint mapping is successfully updated by the fingerprint server; if the fingerprint mapping fails to be updated by the fingerprint server, the first fingerprint update information is used to indicate that the fingerprint mapping fails to be updated by 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 time, the controller receives the second fingerprint update information sent by the fingerprint server.
And step S47, the controller stores the second fingerprint updating information in the target storage space.
After the controller receives the second fingerprint updating information sent by the fingerprint server, the controller can store the second fingerprint updating information into the target storage space, so that the controller can judge whether the storage space corresponding to the first container unit number can be released or not according to the second fingerprint updating information and other related updating information.
If the controller judges that the fingerprint mapping, the container mapping, the virtual mapping and the like corresponding to the first container unit number are updated according to the second fingerprint updating information and other related updating information, the controller can release the storage space corresponding to the first container unit number.
In step S48, the controller releases the storage space corresponding to the first container unit number.
In the embodiment shown in fig. 5, since the controller stores the container map and the fingerprint map corresponding to the first container unit number in advance, the controller may generate the fingerprint remapping from the container map and the fingerprint map. After the controller generates the fingerprint remap, the fingerprint remap may 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 first fingerprint mapping stored in advance and add the second fingerprint mapping. After the fingerprint server updates the fingerprint map according to the fingerprint remapping, the fingerprint server sends second fingerprint updating information to the controller for indicating whether the fingerprint map is successfully updated by the fingerprint server. Then, the controller stores the second fingerprint updating information into the target storage space. Therefore, after the controller re-maps and stores the fingerprints in the target storage space, at least one fingerprint server can process the fingerprints in the target storage space in parallel to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further the recovery efficiency of the garbage recovery technology is greatly improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a method for garbage collection in a storage system according to another embodiment of the present application. The embodiment shown in fig. 6 is a modified embodiment based on fig. 2, so the same contents as fig. 2 can be referred to the embodiment shown in fig. 2. In the embodiment shown in fig. 6, the fingerprint server and the controller belong to two separate devices. The method shown in fig. 6 includes the following steps.
In step S51, the controller copies the valid data blocks 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.
In step S52, the controller generates a virtual remapping from the container mapping.
Step S53, the controller stores the virtual remapping in the target storage space, the virtual remapping of the target storage space being accessible to at least two hosts.
Step S54, the controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping.
After the controller copies the valid data blocks 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 needs to generate a fingerprint remapping according to the container mapping and the fingerprint mapping, so that the controller can update the virtual mapping according to the fingerprint remapping.
The fingerprint map is used for indicating that the fingerprint of the data block points to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint map and a second fingerprint map, the first fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the first container unit number, and the second fingerprint map is used for indicating that the fingerprint of the effective data block points to the storage address of the second container unit number. The first fingerprint map is used to indicate a fingerprint map that the controller needs to delete, and the second fingerprint map is used to indicate a fingerprint map that the controller needs to add.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB).
Step S55, the controller stores the fingerprint remapping in a target storage space, the fingerprint remapping of the target storage space for access by at least one fingerprint server.
Wherein after the controller generates the fingerprint remap based on the container map and the fingerprint map, the controller needs to store the fingerprint remap in the target storage space in order for the fingerprint remap to be accessed by the at least one fingerprint server. The fingerprint remapping may be stored in the target storage space in the form of a file, document or log, etc.
After the fingerprint server acquires the fingerprint remapping of the target storage space, the fingerprint server can update the fingerprint mapping stored by the fingerprint server according to the fingerprint remapping, namely the fingerprint server needs to delete the first fingerprint mapping stored in advance and add the second fingerprint mapping.
For example, assume a container map of (PLUN1, LBA1, 4KB- > VLUN1, LBA1, 4KB), a fingerprint remap includes a first fingerprint map of (FP1- > PLUN1, LBA1, 4KB), and a second fingerprint map of (FP1- > PLUN2, LBA1, 4 KB). After the fingerprint server acquires the fingerprint remapping of the target storage space, the fingerprint server needs to delete the first fingerprint mapping (FP1- > PLUN1, LBA1, 4KB) stored in advance and add the second fingerprint mapping (FP1- > PLUN2, LBA1, 4 KB).
Of course, the fingerprint server may fail to update, that is, the fingerprint server cannot successfully delete the first fingerprint map and cannot successfully add the second fingerprint map. Even if the fingerprint server fails to update, the controller is not influenced to release the storage space corresponding to the first container unit number.
In step S56, the controller releases the storage space corresponding to the first container unit number.
When the controller receives the notification of successful update of the virtual remapping sent by the host, the controller indicates that the host deletes the first virtual mapping and adds the second virtual mapping, so that the controller can release the storage space corresponding to the first container unit number at this time without considering whether the fingerprint remapping is successfully updated.
Step S57, the controller modifies a first initial version number corresponding to the storage address of the first container unit number in the container map to a target version number, where the target version number is greater than the first initial version number.
In this embodiment of the present application, the container map further includes a first initial version number corresponding to the storage address of the first container unit number, and the fingerprint map further includes a second initial version number corresponding to the storage address of the first container unit number, where the first initial version number is the same as the second initial version number.
For example, assume a container map of (PLUN1, LBA1, 4KB, first initial version number- > VLUN1, LBA1, 4KB), a fingerprint map of (FP1- > PLUN1, LBA1, 4KB, second initial version number), and the first initial version number is equal to the second initial version number.
After the controller releases the storage space corresponding to the first container unit number, the controller needs to modify a first initial version number corresponding to the storage address of the first container unit number in the container map to a target version number, and the target version number is greater than the first initial version number. The purpose of this is that if the fingerprint server fails to update the fingerprint map, that is, the fingerprint server deletes the first fingerprint map successfully, and cannot add the second fingerprint map successfully, it is at least ensured that the version number in the container map is different from the version number of the first fingerprint map stored in advance by the controller, so as to indicate that the fingerprint map update fails.
Step S58, when the controller receives a request sent by the host to add a reference to a valid data block in 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 determines a second initial version number corresponding to the storage address of the first container unit number in the fingerprint map.
After 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 a request for adding one reference to a valid data block in the storage address of the first container unit number to the controller, 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 second initial version number corresponding to the storage address of the first container unit number in the fingerprint map.
And step S59, when the second initial version number is different from the target version number, the controller refuses a request sent by the host computer for adding one reference to the valid data block in the storage address of the first container unit number, so that the host computer sends a deletion instruction for deleting the fingerprint mapping corresponding to the first container unit number to the fingerprint server, and the fingerprint server deletes the fingerprint mapping corresponding to the first container unit number according to the deletion instruction.
After the controller releases the storage space corresponding to the first container unit number, the controller modifies a first initial version number corresponding to the storage address of the first container unit number in the container mapping into a target version number. If the fingerprint server fails to update the fingerprint map, the first fingerprint map cannot be deleted, and the version number in the container map is different from the version number of the first fingerprint map stored in the fingerprint server in advance, so that the second initial version number is different from the target version number, and at the moment, the controller rejects a request for adding one time for quoting the valid data blocks in the storage address of the first container unit number, which is sent by the host; when the host detects that the controller refuses to add a reference request for an effective data block in the storage address of the first container unit number, 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 a deleting instruction sent by the host, the fingerprint server deletes the fingerprint mapping corresponding to the first container unit number.
In the embodiment shown in fig. 6, after the controller updates the fingerprint map stored by the controller according to the fingerprint remapping in the target storage space, the controller does not need to generate fingerprint update information for indicating whether the fingerprint map is successfully updated or not, and does not need to store the fingerprint update information in the target storage space, and even if the controller fails to successfully update the fingerprint map, the recovery effect of the storage space corresponding to the first container unit number is not affected, so that the garbage recovery process is simplified, and the recovery efficiency of the garbage recovery technology is improved.
Fig. 7 is a flowchart illustrating a method for garbage collection in a storage system according to an embodiment of the present application. In the method shown in fig. 7, after the controller stores the virtual remapping in the target storage space, each host does not need to sequentially process the virtual remapping, but independently processes the virtual remapping in the target storage space, so as to implement parallel recovery of the storage space corresponding to the storage address of the first container unit number, thereby greatly improving garbage recovery efficiency. The method comprises the following steps.
Step S61, the host mounts the first virtual logical unit number, and the host stores a first virtual map indicating that the storage address of the first virtual logical unit points to the storage address of the first container unit number.
For example, assume that 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), and the storage address of the first container unit number is (PLUN1, LBA1, 4 KB).
Step S62, the host computer obtains the virtual remapping in the target storage space in the storage system, the virtual remapping of the target storage space can be accessed by at least two host computers, the virtual remapping comprises a first virtual mapping and a second virtual mapping, and the second virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of the second container unit number; the second container unit number stores valid data in the first container unit number.
After the controller generates the virtual remapping according to the container mapping, the controller needs to store the virtual remapping in the target storage space, so that at least two hosts can actively acquire the virtual remapping in the target storage space. The virtual remapping may be stored in the target storage space in the form of a file, document, log, or the like.
Since the first container unit number belongs to the controller, the host that refers to the storage address of the first container unit number can actively acquire the virtual remapping in the target storage space to update the first virtual mapping of the host itself.
For example, in connection with FIG. 1, assume that the first virtual mapping pre-stored by host 11 is (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4KB), and PLUN1 is attributed to controller 21. After controller 21 stores the virtual remap in the target storage space, both host 11 and the host referencing the storage address of PLUN1 will actively obtain the virtual remap in the target storage space. The virtual remap includes a first virtual map (VLUN1, LBA1, 4KB- > PLUN1, LBA1, 4KB), and a second virtual map (VLUN1, LBA1, 4KB- > PLUN2, LBA1, 4KB), the first virtual map being a virtual map that host 11 needs to delete, and the second virtual map being a virtual map that host 11 needs to add. After the host 11 obtains the virtual remap, 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 of the first virtual logical unit number of the host 11 (VLUN1, LBA1, 4KB) no longer points to the storage address of the first container unit number (PLUN1, LBA1, 4KB) but points to the storage address of the second container unit number (PLUN2, LBA1, 4 KB).
Of course, in an actual scenario, the storage address of the first container unit number and the storage address of the second container unit number may each include a plurality of pieces of information, and are not limited to 1 piece of information.
For example, the storage address of the first container unit number includes (PLUN1, LBA1, 4KB), (PLUN1, LBA2, 4KB), (PLUN1, LBA3, 4KB), and (PLUN1, LBA4, 4KB), and the like; the storage address of the second container unit number includes (PLUN2, LBA1, 4KB), (PLUN2, LBA2, 4KB), (PLUN2, LBA3, 4KB), and (PLUN2, LBA4, 4KB), and the like.
Of course, in an actual scenario, the container map, the first virtual map, and the second virtual map may include multiple maps, and are not limited to 1 map.
For example, the container map 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), etc.; 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), etc.; 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- > PLUN2, LBA4, 4KB), etc.
Step S63, the host deletes the first virtual mapping and stores the second virtual mapping.
In the embodiment shown in fig. 7, after the controller generates the virtual remap according to the container map, the controller stores the virtual remap in the target storage space, the virtual remap of the target storage space can be accessed by at least two hosts, and the at least two hosts can concurrently obtain the relevant virtual remap from the target storage space of the controller. The at least two hosts can independently update respective virtual mappings according to the virtual remapping, so that the updating of the at least two hosts is realized. The controller may then free the storage space corresponding to the first container unit number. Therefore, after the controller stores the virtual remapping in the target storage space, at least two hosts do not need to sequentially process the virtual remapping, but independently process the virtual remapping in the target storage space, so as to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the recovery efficiency of the garbage recovery technology.
Fig. 8 is a schematic diagram illustrating an apparatus for garbage collection in a storage system according to an embodiment of the present disclosure. Fig. 8 is an embodiment of the apparatus corresponding to fig. 2, and the same contents in fig. 8 as those in fig. 2 may refer to the embodiment corresponding to fig. 2. Referring to fig. 8, the apparatus for garbage collection shown in fig. 8 is applied to a storage system further including a first container unit number. The garbage recycling device comprises the following modules:
and the copying module 41 is configured to copy the valid data blocks 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 virtual remapping generating module 42 is configured to generate a virtual remapping according to a 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 logic unit number, the virtual remapping includes a first virtual mapping and a second virtual mapping, the first virtual mapping is used to indicate that the storage address of the first virtual logic 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 logic unit number points to the storage address of the second container unit number.
A storage module 43 for storing the virtual remapping in a target storage space, the virtual remapping of the target storage space being accessible by at least two hosts.
And the releasing module 44 is used for releasing the storage space corresponding to the first container unit number.
In the embodiment shown in fig. 8, after the controller generates the virtual remap according to the container map, the controller stores the virtual remap in the target storage space, the virtual remap of the target storage space can be accessed by at least two hosts, and the at least two hosts can concurrently obtain the relevant virtual remap from the target storage space of the controller. The at least two hosts can independently update their respective virtual mappings according to the virtual remap, thereby enabling the updating of the at least two hosts. The controller may then free the storage space corresponding to the first container unit number. Therefore, after the controller stores the virtual remapping in the target storage space, at least two hosts do not need to sequentially process the virtual remapping, but independently process the virtual remapping in the target storage space, so as to realize parallel recovery of the storage space corresponding to the storage address of the first container unit number, and further greatly improve the garbage recovery efficiency.
Optionally, the device for recycling garbage provided in the embodiment of the present application may further include the following modules: the fingerprint remapping generation module is used for generating fingerprint remapping according to the container mapping and the fingerprint mapping, the fingerprint mapping is used for indicating the fingerprint of the data block to point to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint mapping and a second fingerprint mapping, the first fingerprint mapping is used for indicating the fingerprint of the effective data block to point to the storage address of the first container unit number, and the second fingerprint mapping is used for indicating the fingerprint of the effective data block to point to the storage address of the second container unit number; storing the fingerprint remapping in the target storage space.
Optionally, the device for recycling garbage provided in the embodiment of the present application may further include the following modules: and the updating module is used for updating the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
Optionally, the device for recycling garbage provided in the embodiment of the present application may further include the following modules: the fingerprint updating information generating module is used for generating first fingerprint updating information, and the first fingerprint updating information is used for indicating whether the fingerprint mapping is successfully updated by the controller; and storing the first fingerprint updating information into the target storage space.
Wherein the fingerprint remapping of the target storage space is for access by at least one fingerprint server.
Optionally, the device for recycling garbage provided in the embodiment of the present application may further include the following modules: the receiving module is used for receiving second fingerprint update information sent by the at least one fingerprint server, and the second fingerprint update information is used for indicating whether the fingerprint mapping is successfully updated by the at least one fingerprint server; and storing the second fingerprint updating information into the target storage space.
Optionally, the container map further includes a first initial version number corresponding to the storage address of the first container unit number, and the fingerprint map further includes a second initial version number corresponding to the storage address of the first container unit number, where the first initial version number is the same as the second initial version number. The device that rubbish was retrieved that this application embodiment provided can also include following module: the modification module is used for modifying a first initial version number corresponding to the storage address of the first container unit number in the container mapping into a target version number, and the target version number is greater than the first initial version number; the device comprises a determining module, a judging module and a storing module, wherein the determining module is used for determining a target version number corresponding to a storage address of a first container unit number in a container mapping and determining a second initial version number corresponding to the storage address of the first container unit number in a fingerprint mapping when a controller receives a reference request which is sent by a host and is added once for a valid data block of the storage address of the first container unit number; and the deleting module is used for deleting the fingerprint mapping corresponding to the first container unit number when the second initial version number is different from the target version number. In a specific implementation, the deleting module may be implemented by a fingerprint server.
Fig. 9 is a schematic diagram illustrating another apparatus for garbage collection in a storage system according to an embodiment of the present disclosure. Fig. 9 is an embodiment of the apparatus corresponding to fig. 7, and the same contents in fig. 9 as those in fig. 7 may refer to the embodiment corresponding to fig. 7. Referring to fig. 9, the garbage recycling apparatus includes the following modules:
a mounting module 51, configured to mount the first virtual logic unit number; storing the first virtual mapping; the first virtual map is used for indicating that the storage address of the first virtual logical unit points to the storage address of the first container unit number;
an obtaining module 52, configured to obtain a virtual remapping in a target storage space in the storage system, where the virtual remapping in 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, and the second virtual mapping is used to indicate that a storage address of the first virtual logical unit number points to a storage address of the second container unit number; the second container unit number stores valid data in the first container unit number;
a deleting module 53, configured to delete the first virtual mapping and store the second virtual mapping.
Fig. 10 is a schematic diagram illustrating an apparatus for garbage collection in another storage system according to an embodiment of the present application. Fig. 10 is an embodiment of the apparatus corresponding to fig. 2, and the same contents in fig. 10 as those in fig. 2 may refer to the embodiment corresponding to fig. 2. Referring to fig. 10, the apparatus includes a processor 61 and a memory 62, wherein the memory 62 stores operation instructions that can be executed by the processor 61, and the processor 61 reads the operation instructions in the memory 62 for implementing the method shown in fig. 2.
Fig. 11 is a schematic diagram illustrating a garbage collection apparatus in another storage system according to an embodiment of the present disclosure. Fig. 11 is an embodiment of the apparatus corresponding to fig. 7, and the same contents in fig. 11 as those in fig. 7 may refer to the embodiment corresponding to fig. 7. Referring to fig. 11, the apparatus includes a processor 71 and a memory 72, wherein the memory 72 stores therein operation instructions that can be executed by the processor 71, and the processor 71 reads the operation instructions in the memory 72 for implementing the method shown in fig. 7.
It should be noted that the embodiments provided in this application are only optional embodiments described in this application, and those skilled in the art can design many more embodiments based on this description, and therefore, the details are not described herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A method of garbage collection in a storage system, the storage system comprising a controller and a first container unit number, the method comprising:
the controller copies the effective data blocks 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 generates a virtual remapping according to a container mapping, wherein the container mapping is used for indicating that the storage address of the first container unit number points to the storage address of a first virtual logic unit number, the virtual remapping comprises a first virtual mapping and a second virtual mapping, the first virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of the first container unit number, and the second virtual mapping is used for indicating that the storage address of the first virtual logic unit number points to the storage address of a second container unit number;
the controller stores the virtual remapping to the target storage space in a target storage space, and the virtual remapping of the target storage space can be acquired by at least two hosts concurrently;
the controller releases the storage space corresponding to the first container unit number.
2. The method of claim 1, wherein prior to the controller releasing the storage space corresponding to the first container unit number, the method further comprises:
the controller generates a fingerprint remapping according to the container mapping and the fingerprint mapping, the fingerprint mapping is used for indicating that the fingerprint of the data block points to the storage address of the first container unit number, the fingerprint remapping comprises a first fingerprint mapping and a second fingerprint mapping, the first fingerprint mapping is used for indicating that the fingerprint of the effective data block points to the storage address of the first container unit number, and the second fingerprint mapping is used for indicating that the fingerprint of the effective data block points to the storage address of the second container unit number;
the controller stores the fingerprint remapping into the target storage space.
3. The method of claim 2, further comprising:
the controller updates the fingerprint map stored by the controller according to the fingerprint remapping in the target storage space.
4. The method of claim 3, further comprising:
the controller generates first fingerprint update information indicating whether the fingerprint mapping is successfully updated by the controller;
the controller stores the first fingerprint update information into the target storage space.
5. The method of claim 2, wherein the fingerprint remapping of the target storage space is for access by at least one fingerprint server.
6. The method of claim 5, further comprising:
the controller receives second fingerprint update information sent by the at least one fingerprint server, wherein the second fingerprint update information is used for indicating 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.
7. The method according to claim 3 or 5, wherein the container map further comprises a first initial version number corresponding to the storage address of the first container unit number, the fingerprint map further comprises a second initial version number corresponding to the storage address of the first container unit number, and the first initial version number is the same as the second initial version number;
the method further comprises the following steps:
the controller modifies a first initial version number corresponding to a storage address of the first container unit number in the container mapping into a target version number, wherein the target version number is larger than the first initial version number;
when the controller receives a reference request sent by a host and added once to a valid data block of a 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 determines a second initial version number corresponding to the storage address of the first container unit number in the fingerprint map;
and 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, or the controller rejects a reference request which is sent by the host and added once to the effective data blocks in the storage address of the first container unit number.
8. A method of garbage collection in a storage system, the method comprising: the host mounts a first virtual logic unit number; the host storing a first virtual mapping; the first virtual map is to indicate that the storage address of the first virtual logical unit points to a storage address of a first container unit number;
the host acquires virtual remapping in a target storage space in the storage system, wherein the virtual remapping of the target storage space can be acquired by at least two hosts concurrently, the virtual remapping comprises a first virtual mapping and a second virtual mapping, and the second virtual mapping is used for indicating that a storage address of the first virtual logic unit number points to a storage address of a second container unit number; the second container unit number stores valid data in the first container unit number;
the host deletes the first virtual mapping and stores the second virtual mapping.
9. An apparatus for garbage collection in a storage system, the apparatus being applied to the storage system, the storage system further including a first container unit number, the apparatus comprising:
the copying module is used for copying the effective data blocks 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;
a virtual remapping generation module, configured to generate a virtual remapping according to a container mapping, where the container mapping is used to indicate that a storage address of the first container unit number points to a storage address of a first virtual logic unit number, the virtual remapping includes a first virtual mapping and a second virtual mapping, the first virtual mapping is used to indicate that the storage address of the first virtual logic 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 logic unit number points to the storage address of a second container unit number;
a storage module, configured to store the virtual remapping in a target storage space, where the virtual remapping in the target storage space can be concurrently acquired by at least two hosts;
and the releasing module is used for releasing the storage space corresponding to the first container unit number.
10. The apparatus of claim 9, further comprising:
a fingerprint remapping generating module, configured to generate a fingerprint remapping according to the container mapping and a fingerprint mapping, where the fingerprint mapping is used to indicate that a fingerprint of a data chunk points to a 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 a fingerprint of the valid data chunk points to a storage address of the first container unit number, and the second fingerprint mapping is used to indicate that a fingerprint of the valid data chunk points to a storage address of the second container unit number; storing the fingerprint remapping into the target storage space.
11. The apparatus of claim 10, further comprising:
and the updating module is used for updating the fingerprint mapping stored by the controller according to the fingerprint remapping in the target storage space.
12. The apparatus of claim 11, further comprising:
a fingerprint update information generation module, 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 storing the first fingerprint updating information into the target storage space.
13. The apparatus of claim 10, wherein the fingerprint remapping of the target storage space is for access by at least one fingerprint server.
14. The apparatus of claim 13, further comprising:
a receiving module, 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 storing the second fingerprint update information into the target storage space.
15. The apparatus of claim 11, wherein the container map further comprises a first initial version number corresponding to the storage address of the first container unit number, wherein the fingerprint map further comprises a second initial version number corresponding to the storage address of the first container unit number, and wherein the first initial version number is the same as the second initial version number; the device further comprises:
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 map to a target version number, where the target version number is greater than the first initial version number;
a determining module, configured to determine, when the controller receives a request sent by a host to add a valid data block to a storage address of the first container unit number once, a target version number corresponding to the storage address of the first container unit number in the container map, and determine a second initial version number corresponding to the storage address of the first container unit number in the fingerprint map;
and the deleting module is used for deleting the fingerprint mapping corresponding to the first container unit number or rejecting a request for adding one time of reference to the effective data block in the storage address of the first container unit number, which is sent by the host, when the second initial version number is different from the target version number.
16. An apparatus for garbage collection in a storage system, the apparatus comprising:
the mounting module is used for mounting the first virtual logic unit number; storing the first virtual mapping; the first virtual map is to indicate that the storage address of the first virtual logical unit points to a storage address of a 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 in the target storage space may be concurrently obtained by at least two hosts, where the virtual remapping includes the first virtual mapping and a second virtual mapping, and the second virtual mapping is used to indicate that a storage address of the first virtual logic unit number points to a storage address of a second container unit number; the second container unit number stores valid data in the first container unit number;
and the deleting module is used for deleting the first virtual mapping and storing the second virtual mapping.
17. A controller, comprising: a processor and a memory, wherein the memory stores operating instructions executable by the processor, and the operating instructions in the memory are read by the processor to implement the method of any one of claims 1 to 7.
18. A host, comprising: a processor and a memory, wherein the memory stores operating instructions executable by the processor, and the operating instructions in the memory are read by the processor to implement the method of claim 8.
CN201710915762.8A 2017-09-30 2017-09-30 Method and device for recycling garbage in storage system Active CN107608907B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710915762.8A CN107608907B (en) 2017-09-30 2017-09-30 Method and device for recycling garbage in storage system
PCT/CN2018/100738 WO2019062370A1 (en) 2017-09-30 2018-08-16 Method and device for garbage collection in storage system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710915762.8A CN107608907B (en) 2017-09-30 2017-09-30 Method and device for recycling garbage in storage system

Publications (2)

Publication Number Publication Date
CN107608907A CN107608907A (en) 2018-01-19
CN107608907B true CN107608907B (en) 2020-10-23

Family

ID=61068272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710915762.8A Active CN107608907B (en) 2017-09-30 2017-09-30 Method and device for recycling garbage in storage system

Country Status (2)

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

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608907B (en) * 2017-09-30 2020-10-23 华为技术有限公司 Method and device for recycling garbage in storage system
CN109901910B (en) * 2019-01-17 2021-12-07 珠海金山网络游戏科技有限公司 File pulling or pushing method and device based on distributed container
CN111338570B (en) * 2020-02-16 2022-07-22 苏州浪潮智能科技有限公司 Parallel file system IO optimization method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103502926A (en) * 2011-04-29 2014-01-08 美国网域存储技术有限公司 Extent-based storage architecture
CN103744798A (en) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 Garbage recycling method of solid state discs
US20170031818A1 (en) * 2015-07-30 2017-02-02 Emc Corporation Memory Centric Database Architecture

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103365788B (en) * 2013-08-06 2016-01-13 山东大学 The adaptive local rubbish recovering method that real-time flash memory conversion layer uses
CN105389266B (en) * 2015-10-16 2019-03-01 北京联想核芯科技有限公司 A kind of data managing method and device
CN106484323A (en) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 A kind of loss equalizing method of solid-state storage and system
CN107608907B (en) * 2017-09-30 2020-10-23 华为技术有限公司 Method and device for recycling garbage in storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103502926A (en) * 2011-04-29 2014-01-08 美国网域存储技术有限公司 Extent-based storage architecture
CN103744798A (en) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 Garbage recycling method of solid state discs
US20170031818A1 (en) * 2015-07-30 2017-02-02 Emc Corporation Memory Centric Database Architecture

Also Published As

Publication number Publication date
CN107608907A (en) 2018-01-19
WO2019062370A1 (en) 2019-04-04

Similar Documents

Publication Publication Date Title
US10402339B2 (en) Metadata management in a scale out storage system
CN105474180B (en) Method, calculating equipment and computer readable storage medium for storage management
US8892846B2 (en) Metadata management for virtual volumes
CN107608907B (en) Method and device for recycling garbage in storage system
US9507720B2 (en) Block storage-based data processing methods, apparatus, and systems
EP1853992A2 (en) A new point-in-time copy operation
KR101760778B1 (en) Computer system and method for updating program therein
KR100891325B1 (en) Key cache management method on TSS
TWI771933B (en) Method for performing deduplication management with aid of command-related filter, host device, and storage server
CN105027070A (en) Safety for volume operations
JP2009026141A (en) Cache method and cache device
CN109522154B (en) Data recovery method and related equipment and system
JP5944502B2 (en) Computer system and control method
CN101221485A (en) Method for establishing redundant magnetic disk array and control device thereof
JP6558059B2 (en) Storage control device, storage control program, and storage system
US20210109827A1 (en) Connectivity-aware witness for active-active storage
US20200341672A1 (en) Methods to reduce storage capacity
CN103036948A (en) Network file processing method and execution node and software as a service (SaaS) platform
KR101713314B1 (en) Method and system for removing garbage files
JP2017156959A (en) Storage device and storage method
CN109558082B (en) Distributed file system
US11256628B2 (en) Volatile read cache in a content addressable storage system
CN105051731A (en) Grouping files for optimized file operations
CN104903871A (en) Virtual tape library system
CN115756838A (en) Memory release method, memory recovery method, memory release device, memory recovery device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant