A method, apparatus, device and medium for deleting a volume in a storage system
The method optimizes volume deletion in storage systems by prioritizing LP metadata deletion and garbage collection during new volume creation, addressing slow deletion speeds and improving system performance.
Patent Information
- Application Number
- CN202210852610.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-19
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-07-19
AI Technical Summary
The existing all-flash storage system is slow during the volume deletion process, which causes the system to fail to create new volumes.
By first deleting the LP metadata during the volume deletion operation, start the garbage collection task when creating a new volume, check whether the physical block address points to the logical block address, and delete the PL metadata and recycle the storage space when the logical block address does not point to the physical block address, avoid traversing all LP addresses.
The speed of deleting volumes has been accelerated, the speed of creating new volumes has been improved, and the overall performance of the system has been improved.
Smart Images

Figure CN115237346B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage systems, and in particular to a method, device, equipment and medium for deleting a volume in a storage system. Background Art
[0002] Currently, many all-flash storage systems introduce a metadata function to implement the global deduplication function, namely, there are L→P, P→L, H→P; where L→P realizes the function of pointing from a logical address to a physical address, P→L realizes the function of pointing from a physical address to a logical address, and H→P realizes the function of pointing from a Hash address to a physical address, that is, L represents a logical address, P represents a physical address, and H represents a Hash address / hash address.
[0003] After introducing the metadata function, when the host writes to a volume, a large amount of metadata will be generated. Metadata can not only play functions such as indexing data and deduplicating duplicate data, but also play a capacity statistics function. Among them, when deleting a volume, it is also necessary to clean up the metadata belonging to the volume.
[0004] The L address strictly belongs to a volume and can be quickly erased; however, the P address is global. In order to be able to delete all PLs belonging to the volume, it is necessary to first traverse all LP addresses to delete PLs in reverse, and this process takes a long time.
[0005] Since the volume configuration in the system is limited, if the above deletion process is too slow, it may cause the problem that the system cannot create a new volume. Summary of the Invention
[0006] In order to solve the above technical problems, the present invention provides a method, device, equipment and medium for deleting a volume in a storage system, which is used to solve the problem that the speed of deleting a volume in the current storage system is slow and causes the inability to create a new volume.
[0007] To achieve the above object, the present invention provides a method for deleting a volume in a storage system, including the steps of:
[0008] When performing a volume deletion operation, delete the LP metadata corresponding to the volume to be deleted;
[0009] When creating a new volume, start a garbage collection task for the data blocks to be cleared; wherein, the data blocks to be cleared correspond to the volume to be deleted;
[0010] Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, query in reverse whether the logical block address L points to the physical block address P;
[0011] When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared, and reclaim the storage space corresponding to the physical block address P.
[0012] Further, start the garbage collection task for the data block to be cleared, specifically including:
[0013] When the remaining capacity of the current pool is lower than the preset capacity threshold, start the garbage collection task for the data block to be cleared.
[0014] Further, start the garbage collection task for the data block to be cleared, specifically including:
[0015] When the write pressure of the host is less than the preset pressure threshold, start the garbage collection task for the data block to be cleared.
[0016] Further, the volume deletion method further includes:
[0017] When the newly inserted data block is a duplicate data block, implement the duplicate data deletion function through the block address information of the newly created data block.
[0018] Further, implementing the duplicate data deletion function through the block address information of the newly created data block specifically includes:
[0019] Obtain the hash block address H of the newly created data block, and query whether the hash block address H points to the physical block address P1 of at least one storage space;
[0020] If it points, allocate a logical block address L1 for the newly created data block, and point the logical block address L1 to the physical block address P1.
[0021] Further, the volume deletion method further includes:
[0022] If the hash block address H does not point to any of the physical block addresses P1, allocate the physical block address P2 of at least one free storage space for the newly created data block, and generate the HP metadata corresponding to the newly created data block.
[0023] Further, the volume deletion method further includes:
[0024] When performing garbage collection operations on the newly created data block, query whether the physical block address P1 is in the state pointed to by the hash block address H;
[0025] If so, migrate the data corresponding to the physical block address P1;
[0026] If not, reclaim the physical block address P1.
[0027] The present invention further provides a volume deletion device for a storage system, which is used to implement the volume deletion method of the aforementioned storage system. The volume deletion device includes:
[0028] A first deletion module, which is used to delete the LP metadata corresponding to the volume to be deleted when a volume deletion operation is performed;
[0029] A start module, which is used to start the garbage collection task of the data block to be cleared when a new volume is created; wherein, the data block to be cleared corresponds to the volume to be deleted;
[0030] A garbage collection task module, which is used to execute the garbage collection task;
[0031] A query module, which is used to query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared;
[0032] A reverse query module, which is used to reversely query whether the logical block address L points to the physical block address P when the physical block address P points to the logical block address L;
[0033] A second deletion module, which is used to delete the PL metadata corresponding to the data block to be cleared when the logical block address L does not point to the physical block address P;
[0034] A storage space recovery module, which is used to recover the storage space corresponding to the physical block address P.
[0035] The present invention also provides a computer device, which includes a memory, a processor and a computer program. The computer program is stored on the memory and can run on the processor. When the processor executes the computer program, the following steps are implemented:
[0036] When a volume deletion operation is performed, delete the LP metadata corresponding to the volume to be deleted;
[0037] When a new volume is created, start the garbage collection task of the data block to be cleared; wherein, the data block to be cleared corresponds to the volume to be deleted;
[0038] Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, reversely query whether the logical block address L points to the physical block address P;
[0039] When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared and recover the storage space corresponding to the physical block address P.
[0040] The present invention further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0041] When a volume deletion operation is performed, delete the LP metadata corresponding to the volume to be deleted;
[0042] When a new volume is created, start a garbage collection task for data blocks to be cleared; wherein, the data blocks to be cleared correspond to the volume to be deleted;
[0043] Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, inversely query whether the logical block address L points to the physical block address P;
[0044] When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared and reclaim the storage space corresponding to the physical block address P.
[0045] The above technical solution of the present invention has the following technical effects compared with the prior art:
[0046] In the present invention, when deleting a volume to be deleted, first delete the corresponding LP metadata; when creating a new volume, then delete the corresponding PL metadata and reclaim the corresponding physical storage space;
[0047] Among them, when creating a new volume, start a garbage collection task for data blocks to be cleared corresponding to the volume to be deleted; first query whether the physical block address P of the data block to be cleared points to the corresponding logical block address L. If it points, it means that the data block to be cleared is successfully verified;
[0048] Then, inversely query whether the logical block address L points to the above physical block address P. If it points, it means that the above data block to be cleared needs to perform space recycling; at this time, the PL metadata corresponding to the data block to be cleared can be deleted and the storage space corresponding to the physical block address P can be reclaimed;
[0049] In summary, for the volume deletion method of the above storage system, the garbage collection task is only performed when creating a new volume, so as to delete the PL metadata and perform space recycling, and it is not necessary to traverse all LP addresses to inversely delete the PL addresses; thus, when the system volume configuration resources are limited, the volume deletion speed can be accelerated, the speed of creating a new volume can be improved, and the overall performance of the system can be improved. Description of the Drawings
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0051] Figure 1 It is a schematic flowchart of the volume deletion method of the storage system in Embodiment 1 of the present invention;
[0052] Figure 2 It is a structural block diagram of the volume deletion device of the storage system in Embodiment 2 of the present invention;
[0053] Figure 3 It is the internal structure diagram of the computer device in Embodiment 2 of the present invention. Specific Embodiments
[0054] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, rather than all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0055] Embodiment 1:
[0056] As Figure 1 shown, the embodiments of the present invention provide a volume deletion method for a storage system, including the steps:
[0057] S1 When performing a volume deletion operation, delete the LP metadata corresponding to the volume to be deleted;
[0058] S21 When creating a new volume, start the garbage collection task for the data blocks to be cleared; wherein, the data blocks to be cleared correspond to the volume to be deleted;
[0059] S22 Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, inversely query whether the logical block address L points to the physical block address P;
[0060] S23 When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared and recycle the storage space corresponding to the physical block address P.
[0061] In a specific embodiment, when deleting the volume to be deleted, first delete the corresponding LP metadata; when creating a new volume, then delete the corresponding PL metadata and recycle the corresponding physical storage space;
[0062] Among them, when creating a new volume, start the garbage collection task for the data blocks to be cleared corresponding to the volume to be deleted; first query whether the physical block address P of the data block to be cleared points to the corresponding logical block address L. If it points, it means that the data block to be cleared is successfully verified;
[0063] Then, reverse query whether the logical block address L points to the above physical block address P. If it points, it means that the above data block to be cleared needs to perform space recycling; at this time, the PL metadata corresponding to the data block to be cleared can be deleted, and the storage space corresponding to the physical block address P can be recycled;
[0064] In summary, the method for deleting a volume in the above storage system performs the garbage collection task only when creating a new volume, thereby deleting the PL metadata and performing space recycling, and does not need to traverse all LP addresses to reverse delete the PL addresses; thus, when the system volume configuration resources are limited, the volume deletion speed can be accelerated, the speed of creating a new volume can be increased, and the overall performance of the system can be improved.
[0065] In an actual embodiment, the above method for deleting a volume can perform rapid volume deletion; when performing a volume deletion operation, directly erase the LP information belonging to the volume, that is, complete the foreground volume deletion task, and return the volume configuration to the storage system. At this time, a new volume can be created, and at this time, the invalid P addresses are slowly recycled in the background task of garbage collection; when recycling, first judge whether the P address still has a pointed L address; if so, forwardly search whether the L also has a pointed P address; if not, perform address recycling.
[0066] By introducing the above repair method, the efficiency of volume deletion can be effectively improved, the PL metadata can be erased through background space recycling, and the invalid space can be released.
[0067] In a preferred embodiment, in S21, starting the garbage collection task for the data blocks to be cleared specifically includes:
[0068] When the remaining capacity of the current pool is lower than the preset capacity threshold, start the garbage collection task for the data blocks to be cleared.
[0069] In a specific embodiment, when the remaining total capacity is relatively abundant and the current system is busy handling host IO, the recycling priority can be reduced; but when the remaining capacity of the current pool is lower than the threshold (for example, the usage has exceeded 80%), the rate of recycling space must be accelerated.
[0070] In a preferred embodiment, in S21, starting the garbage collection task for the data blocks to be cleared specifically includes:
[0071] When the write pressure of the host is less than the preset pressure threshold, start the garbage collection task for the data blocks to be cleared.
[0072] In a specific embodiment, the current host pressure can also be sensed; if the current host IO pressure is very small, even if the remaining pool capacity is relatively large, the recycling speed can be increased because the current CPU and disk are in the idle state.
[0073] In a preferred embodiment, the volume deletion method further includes:
[0074] S3 When the newly inserted data block is a duplicate data block, implement the duplicate data deletion function through the block address information of the newly created data block.
[0075] In a preferred embodiment, in S3, implementing the duplicate data deletion function through the block address information of the newly created data block specifically includes:
[0076] S31 Obtain the hash block address H of the newly created data block, and query whether the hash block address H points to the physical block address P1 of at least one storage space;
[0077] S321 If it points, allocate the logical block address L1 for the newly created data block, and point the logical block address L1 to the physical block address P1.
[0078] In a preferred embodiment, the volume deletion method further includes:
[0079] S322 If the hash block address H does not point to any physical block address P1, allocate the physical block address P2 of at least one free storage space for the newly created data block, and generate the HP metadata corresponding to the newly created data block.
[0080] In a specific embodiment, when a piece of data is inserted, first calculate the Hash address of the data according to the memory of the data block, and then retrieve whether the H address has a pointed P address.
[0081] If so, no new P address will be allocated, and no new data will be inserted either. Instead, the new L will point to the existing P address, thereby implementing the duplicate data deletion function.
[0082] If it is indexed that the H address does not point to any P address, then allocate a new P address to write the data and write HP.
[0083] In a preferred embodiment, the volume deletion method further includes:
[0084] When performing garbage collection operations on the newly created data block, query whether the physical block address P1 is in the state pointed to by the hash block address H;
[0085] If so, migrate the data corresponding to the physical block address P1;
[0086] If not, reclaim the physical block address P1.
[0087] In a specific embodiment, PL is provided to implement the garbage collection function and the capacity statistics of the pool. When P is referenced, a PL is inserted for capacity counting.
[0088] When performing garbage collection, it is queried whether P is still referenced; if it is referenced, the data corresponding to the P address is migrated; if the P address is no longer referenced, then the P address is reclaimed.
[0089] In an actual embodiment, when a storage system fails, the specific implementation process of the above volume deletion method is as follows:
[0090] First step, when initiating volume deletion, quickly erase the LP metadata and return it to the storage system volume configuration;
[0091] Second step, during the garbage collection process, retrieve the L information pointed to by P; if there is a pointer to L, then reverse query whether L also has a pointer to P information; if not, perform PL deletion and P address space reclaim;
[0092] Third step, when the remaining total capacity is relatively abundant and the current system is busy handling host I / O, the reclaim priority can be reduced; but when the remaining capacity of the current pool is lower than the threshold (for example, the usage has exceeded 80%), the rate of reclaiming space must be accelerated;
[0093] Fourth step, sense the current host pressure; if the current host I / O pressure is small, even if the remaining pool capacity is relatively large, the reclaim speed can be accelerated because the current CPU and disk are in the idle state.
[0094] Thus, the reclaim priority is controlled through two dimensions, thereby effectively improving the efficiency of system volume deletion; space is the first priority, and if the used space reaches the threshold, the reclaim priority is increased; the second dimension is the host write pressure, and if the host pressure is not high, the reclaim speed can also be increased.
[0095] In addition, in the process of deleting a volume in the prior art, the metadata is generally deleted in the way of traversing the LP and PL trees, and the deletion of LP and PL is paired. Different from the prior art, the above volume deletion method does not traverse the tree to delete the LP metadata, but deletes the node data of the LP tree during the traversal of the tree; in the above volume deletion method, a node contains 512 LP metadata, and then the PL metadata and Pba (Physical block address) data are slowly reclaimed in the background process.
[0096] It should be noted that although the steps in the flowchart are sequentially shown according to the indication of the arrows, these steps do not necessarily execute sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages do not necessarily execute and complete at the same moment, but can execute at different moments, and the execution order of these sub-steps or stages is not necessarily sequential, but can execute alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0097] Embodiment Two:
[0098] As Figure 2 shown, an embodiment of the present invention further provides a volume deletion device for a storage system, which is used to implement the foregoing volume deletion method for the storage system. The volume deletion device includes:
[0099] A first deletion module, which is used to delete the LP metadata corresponding to the volume to be deleted when a volume deletion operation is performed;
[0100] A start module, which is used to start the garbage collection task of the data blocks to be cleared when a new volume is created; wherein, the data blocks to be cleared correspond to the volume to be deleted;
[0101] A garbage collection task module, which is used to execute the garbage collection task;
[0102] A query module, which is used to query whether the physical block address P of the data blocks to be cleared points to the logical block address L of the data blocks to be cleared;
[0103] A reverse query module, which is used to reverse query whether the logical block address L points to the physical block address P when the physical block address P points to the logical block address L;
[0104] A second deletion module, which is used to delete the PL metadata corresponding to the data blocks to be cleared when the logical block address L does not point to the physical block address P;
[0105] A storage space recovery module, which is used to recover the storage space corresponding to the physical block address P.
[0106] In a preferred embodiment, the start module is further used to start the garbage collection task of the data blocks to be cleared when the remaining capacity of the current pool is lower than a preset capacity threshold.
[0107] In a preferred embodiment, the start module is further used to start the garbage collection task of the data blocks to be cleared when the write pressure of the host is less than a preset pressure threshold.
[0108] In a preferred embodiment, the de - volume device further includes:
[0109] The deduplication implementation module is used to implement the deduplication function through the block address information of the newly inserted data block when the newly inserted data block is a duplicate data block.
[0110] In a preferred embodiment, the deduplication implementation module includes:
[0111] The hash block address acquisition and query module is used to acquire the hash block address H of the newly created data block and query whether the hash block address H points to the physical block address P1 of at least one storage space;
[0112] The logical block address allocation and pointing module is used to allocate the logical block address L1 for the newly created data block and point the logical block address L1 to the physical block address P1 when the hash block address H points to the physical block address P1 of at least one storage space.
[0113] In a preferred embodiment, the de - volume device further includes:
[0114] The physical block address allocation module is used to allocate the physical block address P2 of at least one free storage space for the newly created data block when the hash block address H does not point to any physical block address P1;
[0115] The HP metadata generation module is used to generate the HP metadata corresponding to the newly created data block.
[0116] In a preferred embodiment, the de - volume device further includes:
[0117] The pointing status query module is used to query whether the physical block address P1 is in the state pointed to by the hash block address H when a garbage collection operation is performed on the newly created data block;
[0118] The data migration module is used to migrate the data corresponding to the physical block address P1 when the physical block address P1 is in the state pointed to by the hash block address H;
[0119] The physical block address recovery module is used to recover the physical block address P1 when the physical block address P1 is not in the state pointed to by the hash block address H.
[0120] For the specific limitations of the above - mentioned device, reference can be made to the limitations on the method in the foregoing text, which will not be elaborated here.
[0121] Each module in the above device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0122] Among them, as Figure 3 shown, the above computer device can be a terminal, which includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0123] It can be understood that the structure shown in the above figure is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0124] Embodiment 3:
[0125] Another embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program. The computer program is stored on the memory and can run on the processor. When the processor executes the computer program, the following steps are implemented:
[0126] S1 When a volume deletion operation is performed, delete the LP metadata corresponding to the volume to be deleted;
[0127] S21 When a new volume is created, start the garbage collection task for the data blocks to be cleared; among them, the data blocks to be cleared correspond to the volume to be deleted;
[0128] S22 Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, inversely query whether the logical block address L points to the physical block address P;
[0129] S23 When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared and reclaim the storage space corresponding to the physical block address P.
[0130] In a preferred embodiment, when the processor executes the computer program, the following steps are further implemented:
[0131] In S21, start the garbage collection task for the data block to be cleared, specifically including: when the remaining capacity of the current pool is lower than the preset capacity threshold, start the garbage collection task for the data block to be cleared.
[0132] In a preferred embodiment, when the processor executes the computer program, the following steps are further implemented:
[0133] In S21, start the garbage collection task for the data block to be cleared, specifically including: when the write pressure of the host is less than the preset pressure threshold, start the garbage collection task for the data block to be cleared.
[0134] In a preferred embodiment, when the processor executes the computer program, the following steps are further implemented:
[0135] The volume deletion method further includes: S3 When the inserted new data block is a duplicate data block, implement the duplicate data deletion function through the block address information of the new data block.
[0136] In a preferred embodiment, when the processor executes the computer program, the following steps are further implemented:
[0137] In S3, implement the duplicate data deletion function through the block address information of the new data block, specifically including: S31 Obtain the hash block address H of the new data block and query whether the hash block address H points to the physical block address P1 of at least one storage space; S321 If it points, allocate the logical block address L1 for the new data block and point the logical block address L1 to the physical block address P1.
[0138] In a preferred embodiment, when the processor executes the computer program, the following steps are further implemented:
[0139] The volume deletion method further includes: S322 If the hash block address H does not point to any physical block address P1, allocate the physical block address P2 of at least one free storage space for the new data block and generate the HP metadata corresponding to the new data block.
[0140] In a preferred embodiment, when the processor executes the computer program, the following steps are further implemented:
[0141] The volume deletion method further includes: when performing garbage collection on a newly created data block, querying whether the physical block address P1 is in the state pointed to by the hashed block address H; if so, migrating the data corresponding to the physical block address P1; if not, recycling the physical block address P1.
[0142] Embodiment 4:
[0143] Another embodiment of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0144] S1 When performing a volume deletion operation, delete the LP metadata corresponding to the volume to be deleted;
[0145] S21 When creating a new volume, start the garbage collection task for the data blocks to be cleared; where the data blocks to be cleared correspond to the volume to be deleted;
[0146] S22 Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, inversely query whether the logical block address L points to the physical block address P;
[0147] S23 When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared and recycle the storage space corresponding to the physical block address P.
[0148] In a preferred embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0149] In S21, starting the garbage collection task for the data blocks to be cleared specifically includes: when the remaining capacity of the current pool is lower than a preset capacity threshold, starting the garbage collection task for the data blocks to be cleared.
[0150] In a preferred embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0151] In S21, starting the garbage collection task for the data blocks to be cleared specifically includes: when the write pressure of the host is less than a preset pressure threshold, starting the garbage collection task for the data blocks to be cleared.
[0152] In a preferred embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0153] The volume deletion method further includes: S3 When the inserted newly created data block is a duplicate data block, implement the duplicate data deletion function through the block address information of the newly created data block.
[0154] In a preferred embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0155] In S3, the deduplication function is implemented by the block address information of the newly created data block, specifically including: S31 obtaining the hash block address H of the newly created data block, and querying whether the hash block address H points to the physical block address P1 of at least one storage space; S321 if it points, allocating the logical block address L1 for the newly created data block, and pointing the logical block address L1 to the physical block address P1.
[0156] In a preferred embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0157] The volume deletion method further includes: S322 if the hash block address H does not point to any physical block address P1, allocating the physical block address P2 of at least one free storage space for the newly created data block, and generating the HP metadata corresponding to the newly created data block.
[0158] In a preferred embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0159] The volume deletion method further includes: when performing garbage collection on the newly created data block, querying whether the physical block address P1 is in the state pointed to by the hash block address H; if so, migrating the data corresponding to the physical block address P1; if not, recycling the physical block address P1.
[0160] It can be understood that the implementation of all or part of the processes in the above method embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments.
[0161] Among them, any reference to a memory, storage, database or other medium used in the embodiments provided by the present invention can include non-volatile and / or volatile memories. The non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. The volatile memory can include random access memory (RAM) or an external cache. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0162] It should be noted that the above are only the preferred embodiments of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, it can also include more other equivalent embodiments, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for deleting a volume in a storage system, characterized in that, It includes the steps: When a volume deletion operation is performed, delete the LP metadata corresponding to the volume to be deleted; When a new volume is created, start the garbage collection task for the data blocks to be cleared; wherein, the data blocks to be cleared correspond to the volume to be deleted; Execute the garbage collection task, and query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; if it points, inversely query whether the logical block address L points to the physical block address P; When the logical block address L does not point to the physical block address P, delete the PL metadata corresponding to the data block to be cleared and reclaim the storage space corresponding to the physical block address P.
2. The method for deleting a volume of the storage system according to claim 1, wherein Starting the garbage collection task for the data blocks to be cleared specifically includes: When the remaining capacity of the current pool is lower than the preset capacity threshold, start the garbage collection task for the data blocks to be cleared.
3. The method for deleting a volume of the storage system according to claim 2, wherein Starting the garbage collection task for the data blocks to be cleared specifically includes: When the write pressure of the host is less than the preset pressure threshold, start the garbage collection task for the data blocks to be cleared.
4. The method for deleting a volume of the storage system according to claim 1, wherein The volume deletion method further includes: When the newly inserted data block is a duplicate data block, implement the duplicate data deletion function through the block address information of the newly created data block.
5. The method for deleting a volume of the storage system according to claim 4, wherein Implementing the duplicate data deletion function through the block address information of the newly created data block specifically includes: Obtain the hash block address H of the newly created data block, and query whether the hash block address H points to the physical block address P1 of at least one storage space; If it points, allocate the logical block address L1 for the newly created data block, and make the logical block address L1 point to the physical block address P1.
6. The method for deleting a volume of the storage system according to claim 5, wherein The volume deletion method further includes: If the hash block address H does not point to any of the physical block addresses P1, allocate the physical block address P2 of at least one idle storage space for the newly created data block, and generate the HP metadata corresponding to the newly created data block.
7. The method for deleting a volume of the storage system according to claim 5, wherein The volume deletion method further includes: When a garbage collection operation is performed on the newly created data block, query whether the physical block address P1 is in the state pointed to by the hash block address H; If so, migrate the data corresponding to the physical block address P1; If not, reclaim the physical block address P1.
8. A volume deletion device for a storage system, characterized in that, For implementing the volume deletion method of the storage system described in any one of the above claims 1-7, the volume deletion device includes: A first deletion module, used to delete the LP metadata corresponding to the volume to be deleted when a volume deletion operation is performed; A start module, used to start the garbage collection task for the data blocks to be cleared when a new volume is created; wherein, the data blocks to be cleared correspond to the volume to be deleted; A garbage collection task module, used to execute the garbage collection task; A query module, used to query whether the physical block address P of the data block to be cleared points to the logical block address L of the data block to be cleared; An inverse query module, used to inversely query whether the logical block address L points to the physical block address P when the physical block address P points to the logical block address L; A second deletion module, configured to delete the PL metadata corresponding to the data block to be cleared when the logical block address L does not point to the physical block address P; A storage space recovery module, configured to recover the storage space corresponding to the physical block address P.
9. A computer device, comprising a memory, a processor, and a computer program, the computer program being stored on the memory and being executable on the processor, characterized in that, When the processor executes the computer program, the steps of the volume deletion method of the storage system according to any one of claims 1-7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the steps of the volume deletion method of the storage system according to any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Full flash metadata caching method, system and related device
CN113468080A
Volume deletion optimization method and device in distributed storage system and storage medium
CN114153390A