CN113867622B - Method, device and equipment for improving snapshot read-write speed and readable medium - Google Patents

Method, device and equipment for improving snapshot read-write speed and readable medium Download PDF

Info

Publication number
CN113867622B
CN113867622B CN202110962312.0A CN202110962312A CN113867622B CN 113867622 B CN113867622 B CN 113867622B CN 202110962312 A CN202110962312 A CN 202110962312A CN 113867622 B CN113867622 B CN 113867622B
Authority
CN
China
Prior art keywords
metadata
pba
data
lbas
written
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
CN202110962312.0A
Other languages
Chinese (zh)
Other versions
CN113867622A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202110962312.0A priority Critical patent/CN113867622B/en
Publication of CN113867622A publication Critical patent/CN113867622A/en
Application granted granted Critical
Publication of CN113867622B publication Critical patent/CN113867622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a method, a device, equipment and a readable medium for improving snapshot read-write speed in a multi-target volume snapshot scene, wherein the method comprises the following steps: responding to the received instruction of writing data into the source volume by the host, and inquiring the PBA on the corresponding data volume according to the LBA of the data to be written; judging whether the total number of LBAs corresponding to the PBA reaches a threshold value or not; and in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting corresponding PL metadata and LP metadata into the B+ tree. By using the scheme of the invention, the problem that the performance of inquiring and modifying PL metadata is greatly reduced when a single PBA corresponds to a large number of LBAs can be avoided, and the snapshot data reading and writing speed is improved.

Description

Method, device and equipment for improving snapshot read-write speed and readable medium
Technical Field
The present invention relates to the field of computers, and more particularly, to a method, apparatus, device, and readable medium for improving snapshot read-write speed in a multi-target volume snapshot scenario.
Background
When the write request issued by the host computer is supported, the online data deduplication function of the volume level is carried out in the full-flash thin pool storage function, namely, repeated data detection is carried out before the data is written into the disk, if the repeated data is detected, the write operation of the data is not carried out directly, only PL metadata (PBA-LBA mapping relation metadata is carried out, when deduplication is started, one PBA corresponds to a plurality of LBAs, namely, one-to-many PLAs, and LP metadata (LBA-to-PBA mapping relation metadata, one LBA corresponds to only one PBA, namely, LP is one-to-one) is carried out, so that the disk use space is saved.
Because of the existence of the deduplication, the situation that a plurality of LBAs (logical Block address, logical block addresses) correspond to the same PBA (Physical block address, physical block addresses where data is stored on a disk) can occur, but when the PBA corresponds to a large number of LBAs, the performance of inquiring and modifying PL metadata can be greatly reduced, and a typical scenario is that after a large number of repeated data are written, overwriting is performed again, when LP metadata changes, PL metadata of an original PBA can be deleted at the same time, and because a large number of LBAs correspond to the original PBA, the searching and deleting of PL metadata can be time-consuming.
Disclosure of Invention
In view of this, an objective of the embodiments of the present invention is to provide a method, apparatus, device and readable medium for improving snapshot read-write speed in a multi-target volume snapshot scene, which can avoid the problem that the performance of querying and modifying PL metadata is greatly reduced when a single PBA corresponds to a large number of LBAs, and improve snapshot data read-write speed.
Based on the above objects, an aspect of the embodiments of the present invention provides a method for improving snapshot read-write speed in a multi-target volume snapshot scenario, including the following steps:
responding to the received instruction of writing data into the source volume by the host, and inquiring the PBA on the corresponding data volume according to the LBA of the data to be written;
judging whether the total number of LBAs corresponding to the PBA reaches a threshold value or not;
and in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting corresponding PL metadata and LP metadata into a B+ tree (the B+ tree is a variant of the B tree, leaf nodes on the B+ tree store keywords and corresponding recorded addresses, and each layer above the leaf nodes is used as an index).
According to one embodiment of the present invention, in response to receiving an instruction from a host to write data into a source volume, querying a PBA on a corresponding data volume according to an LBA of the data to be written includes:
assembling a metadata reading request according to LBA corresponding to the data to be written;
and inquiring the PBA on the data volume corresponding to the LBA according to the metadata reading request.
According to one embodiment of the present invention, determining whether the total number of LBAs corresponding to the PBA reaches a threshold includes:
inquiring the number of PL metadata in the PBA;
comparing the number of the inquired PL metadata with a threshold value;
and in response to the fact that the number of the inquired PL metadata is equal to the threshold value, judging that the total number of LBAs corresponding to the PBA reaches the threshold value.
According to one embodiment of the present invention, further comprising:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
According to one embodiment of the present invention, in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting the corresponding PL metadata and LP metadata into the B+ tree includes:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree.
In another aspect of the embodiment of the present invention, there is also provided an apparatus for improving snapshot read-write speed in a multi-target volume snapshot scenario, where the apparatus includes:
the inquiry module is configured to respond to the received instruction of writing data into the source volume by the host, and inquire the PBA on the corresponding data volume according to the LBA of the data to be written;
the judging module is configured to judge whether the total number of LBAs corresponding to the PBA reaches a threshold value or not;
and the writing module is configured to respond to the total number of LBAs corresponding to the PBA reaching a threshold value, write the data to be written into the newly applied PBA and insert the corresponding PL metadata and the corresponding LP metadata into the B+ tree.
According to one embodiment of the invention, the query module is further configured to:
assembling a metadata reading request according to LBA corresponding to the data to be written;
and inquiring the PBA on the data volume corresponding to the LBA according to the metadata reading request.
According to one embodiment of the invention, the judgment module is further configured to:
inquiring the number of PL metadata in the PBA;
comparing the number of the inquired PL metadata with a threshold value;
and in response to the fact that the number of the inquired PL metadata is equal to the threshold value, judging that the total number of LBAs corresponding to the PBA reaches the threshold value.
According to one embodiment of the invention, further comprising an insertion module, the insertion module being further configured to:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
According to one embodiment of the invention, the writing module is further configured to:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree.
In another aspect of the embodiments of the present invention, there is also provided a computer apparatus including:
at least one processor; and
and a memory storing computer instructions executable on the processor, the instructions when executed by the processor performing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the methods described above.
The invention has the following beneficial technical effects: according to the snapshot read-write speed increasing method under the multi-target volume snapshot scene, the PBA on the corresponding data volume is inquired according to the LBA of the data to be written in by responding to the received instruction of writing the data into the source volume by the host; judging whether the total number of LBAs corresponding to the PBA reaches a threshold value or not; in response to the fact that the total number of LBAs corresponding to the PBA reaches a threshold value, the technical scheme that data to be written is written into the newly applied PBA and corresponding PL metadata and LP metadata are inserted into the B+ tree can avoid the problem that performance of inquiring and modifying the PL metadata is greatly reduced when a single PBA corresponds to a large number of LBAs, and the snapshot data reading and writing speed is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart diagram of a method for snapshot read-write speed promotion in a multi-target volume snapshot scenario according to one embodiment of the invention;
FIG. 2 is a schematic diagram of an apparatus for snapshot read-write speed promotion in a multi-target volume snapshot scenario according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the invention;
fig. 4 is a schematic diagram of a computer-readable storage medium according to one embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
Based on the above objects, a first aspect of the embodiments of the present invention proposes an embodiment of a method for improving snapshot read-write speed in a multi-target volume snapshot scenario. Fig. 1 shows a schematic flow chart of the method.
As shown in fig. 1, the method may include the steps of:
s1, responding to the received instruction of writing data into the source volume by the host, and inquiring the PBA on the corresponding data volume according to the LBA of the data to be written.
When the host writes data (IO) into the source volume, the snapshot module reads and redirects metadata of a data block in the source volume according to LBAs of the host IO, assembles a metadata reading request according to LBAs of the data to be written in the host IO, queries PBAs on the data volume corresponding to the LBAs according to the metadata reading request, namely performs LP query to find the corresponding PBAs.
S2, judging whether the total number of LBAs corresponding to the PBA reaches a threshold value or not.
After finding the corresponding PBA, a PL query is performed using the PBA, that is, the total number of PLs in the PBA is queried, and the purpose of the PL total number query is to check how many LBAs this PBA already have corresponding to it, and to check whether the number of LBAs corresponding to the PBA reaches a threshold.
And S3, in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting corresponding PL metadata and LP metadata into the B+ tree.
If the total number of LBAs corresponding to the PBA reaches the threshold value, in order to promote the reading and writing efficiency of snapshot and original metadata processing, PL metadata and LP metadata corresponding to the LBA of the target volume are not generated for the PBA, at the moment, data in the data volume are required to be read out, a new PBA is firstly applied when the data is written through the data writing flow, then the data to be written is written into the newly applied PBA, PL metadata and LP metadata corresponding to the LBA and the new PBA are generated, and the generated PL metadata and LP metadata are inserted into the B+ tree.
By the technical scheme, the problem that the performance of inquiring and modifying PL metadata is greatly reduced when a single PBA corresponds to a large number of LBAs can be avoided, and the snapshot data reading and writing speed is improved.
In a preferred embodiment of the present invention, in response to receiving an instruction from a host to write data into a source volume, querying a PBA on a corresponding data volume according to an LBA of the data to be written includes:
assembling a metadata reading request according to LBA corresponding to the data to be written;
and inquiring the PBA on the data volume corresponding to the LBA according to the metadata reading request. When the host writes data (IO) into the source volume, the snapshot module reads and redirects metadata of a data block in the source volume according to LBAs of the host IO, assembles a metadata reading request according to LBAs of the data to be written in the host IO, queries PBAs on the data volume corresponding to the LBAs according to the metadata reading request, namely performs LP query to find the corresponding PBAs.
In a preferred embodiment of the present invention, determining whether the total number of LBAs corresponding to the PBA reaches a threshold value includes:
inquiring the number of PL metadata in the PBA;
comparing the number of the inquired PL metadata with a threshold value;
and in response to the fact that the number of the inquired PL metadata is equal to the threshold value, judging that the total number of LBAs corresponding to the PBA reaches the threshold value. The purpose of the PL total number query is to see how many LBAs this PBA already has corresponding to it and to check if the number of LBAs corresponding to the PBA reaches a threshold.
In a preferred embodiment of the present invention, further comprising:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
In a preferred embodiment of the present invention, in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting the corresponding PL metadata and LP metadata into the b+ tree includes:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree. If the total number of LBAs corresponding to the PBA reaches the threshold value, in order to promote the reading and writing efficiency of snapshot and original metadata processing, PL metadata and LP metadata corresponding to the LBA of the target volume are not generated for the PBA, at the moment, data in the data volume are required to be read out, a new PBA is firstly applied when the data is written through the data writing flow, then the data to be written is written into the newly applied PBA, PL metadata and LP metadata corresponding to the LBA and the new PBA are generated, and the generated PL metadata and LP metadata are inserted into the B+ tree.
By the technical scheme, the problem that the performance of inquiring and modifying PL metadata is greatly reduced when a single PBA corresponds to a large number of LBAs can be avoided, and the snapshot data reading and writing speed is improved.
It should be noted that, it will be understood by those skilled in the art that all or part of the procedures in implementing the methods of the above embodiments may be implemented by a computer program to instruct related hardware, and the above program may be stored in a computer readable storage medium, and the program may include the procedures of the embodiments of the above methods when executed. Wherein the storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like. The computer program embodiments described above may achieve the same or similar effects as any of the method embodiments described above.
Furthermore, the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When executed by a CPU, performs the functions defined above in the methods disclosed in the embodiments of the present invention.
In view of the above objective, a second aspect of the embodiments of the present invention provides an apparatus for improving snapshot read-write speed in a multi-target volume snapshot scenario, as shown in fig. 2, an apparatus 200 includes:
the query module 201, the query module 201 is configured to query the PBA on the corresponding data volume according to the LBA of the data to be written, in response to receiving an instruction of the host to write the data into the source volume.
When the host writes data (IO) into the source volume, the snapshot module reads and redirects metadata of a data block in the source volume according to LBAs of the host IO, assembles a metadata reading request according to LBAs of the data to be written in the host IO, queries PBAs on the data volume corresponding to the LBAs according to the metadata reading request, namely performs LP query to find the corresponding PBAs.
The judging module 202, the judging module 202 is configured to judge whether the total number of LBAs corresponding to the PBA reaches a threshold value.
After finding the corresponding PBA, a PL query is performed using the PBA, that is, the total number of PLs in the PBA is queried, and the purpose of the PL total number query is to check how many LBAs this PBA already have corresponding to it, and to check whether the number of LBAs corresponding to the PBA reaches a threshold.
And the writing module 203, wherein the writing module 203 is configured to respond to the total number of LBAs corresponding to the PBA reaching a threshold value, write the data to be written into the newly applied PBA and insert the corresponding PL metadata and the corresponding LP metadata into the B+ tree.
If the total number of LBAs corresponding to the PBA reaches the threshold value, in order to promote the reading and writing efficiency of snapshot and original metadata processing, PL metadata and LP metadata corresponding to the LBA of the target volume are not generated for the PBA, at the moment, data in the data volume are required to be read out, a new PBA is firstly applied when the data is written through the data writing flow, then the data to be written is written into the newly applied PBA, PL metadata and LP metadata corresponding to the LBA and the new PBA are generated, and the generated PL metadata and LP metadata are inserted into the B+ tree.
In a preferred embodiment of the invention, the query module 201 is further configured to:
assembling a metadata reading request according to LBA corresponding to the data to be written;
and inquiring the PBA on the data volume corresponding to the LBA according to the metadata reading request.
In a preferred embodiment of the present invention, the judging module 202 is further configured to:
inquiring the number of PL metadata in the PBA;
comparing the number of the inquired PL metadata with a threshold value;
and in response to the fact that the number of the inquired PL metadata is equal to the threshold value, judging that the total number of LBAs corresponding to the PBA reaches the threshold value.
In a preferred embodiment of the invention, further comprising an insertion module, the insertion module being further configured to:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
In a preferred embodiment of the invention, the writing module 203 is further configured to:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree.
Based on the above object, a third aspect of the embodiments of the present invention proposes a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor performing the method of:
and responding to the received instruction of writing data into the source volume by the host, and inquiring the PBA on the corresponding data volume according to the LBA of the data to be written.
When the host writes data (IO) into the source volume, the snapshot module reads and redirects metadata of a data block in the source volume according to LBAs of the host IO, assembles a metadata reading request according to LBAs of the data to be written in the host IO, queries PBAs on the data volume corresponding to the LBAs according to the metadata reading request, namely performs LP query to find the corresponding PBAs.
And judging whether the total number of LBAs corresponding to the PBA reaches a threshold value or not.
After finding the corresponding PBA, a PL query is performed using the PBA, that is, the total number of PLs in the PBA is queried, and the purpose of the PL total number query is to check how many LBAs this PBA already have corresponding to it, and to check whether the number of LBAs corresponding to the PBA reaches a threshold.
And in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting corresponding PL metadata and LP metadata into the B+ tree.
If the total number of LBAs corresponding to the PBA reaches the threshold value, in order to promote the reading and writing efficiency of snapshot and original metadata processing, PL metadata and LP metadata corresponding to the LBA of the target volume are not generated for the PBA, at the moment, data in the data volume are required to be read out, a new PBA is firstly applied when the data is written through the data writing flow, then the data to be written is written into the newly applied PBA, PL metadata and LP metadata corresponding to the LBA and the new PBA are generated, and the generated PL metadata and LP metadata are inserted into the B+ tree.
In a preferred embodiment of the present invention, in response to receiving an instruction from a host to write data into a source volume, querying a PBA on a corresponding data volume according to an LBA of the data to be written includes:
assembling a metadata reading request according to LBA corresponding to the data to be written;
and inquiring the PBA on the data volume corresponding to the LBA according to the metadata reading request.
In a preferred embodiment of the present invention, determining whether the total number of LBAs corresponding to the PBA reaches a threshold value includes:
inquiring the number of PL metadata in the PBA;
comparing the number of the inquired PL metadata with a threshold value;
and in response to the fact that the number of the inquired PL metadata is equal to the threshold value, judging that the total number of LBAs corresponding to the PBA reaches the threshold value.
In a preferred embodiment of the present invention, further comprising:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
In a preferred embodiment of the present invention, in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting the corresponding PL metadata and LP metadata into the b+ tree includes:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree.
Based on the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. Fig. 4 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer-readable storage medium S31 stores a computer program S32 that, when executed by a processor, performs the following method:
and responding to the received instruction of writing data into the source volume by the host, and inquiring the PBA on the corresponding data volume according to the LBA of the data to be written.
When the host writes data (IO) into the source volume, the snapshot module reads and redirects metadata of a data block in the source volume according to LBAs of the host IO, assembles a metadata reading request according to LBAs of the data to be written in the host IO, queries PBAs on the data volume corresponding to the LBAs according to the metadata reading request, namely performs LP query to find the corresponding PBAs.
And judging whether the total number of LBAs corresponding to the PBA reaches a threshold value or not.
After finding the corresponding PBA, a PL query is performed using the PBA, that is, the total number of PLs in the PBA is queried, and the purpose of the PL total number query is to check how many LBAs this PBA already have corresponding to it, and to check whether the number of LBAs corresponding to the PBA reaches a threshold.
And in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting corresponding PL metadata and LP metadata into the B+ tree.
If the total number of LBAs corresponding to the PBA reaches the threshold value, in order to promote the reading and writing efficiency of snapshot and original metadata processing, PL metadata and LP metadata corresponding to the LBA of the target volume are not generated for the PBA, at the moment, data in the data volume are required to be read out, a new PBA is firstly applied when the data is written through the data writing flow, then the data to be written is written into the newly applied PBA, PL metadata and LP metadata corresponding to the LBA and the new PBA are generated, and the generated PL metadata and LP metadata are inserted into the B+ tree.
In a preferred embodiment of the present invention, in response to receiving an instruction from a host to write data into a source volume, querying a PBA on a corresponding data volume according to an LBA of the data to be written includes:
assembling a metadata reading request according to LBA corresponding to the data to be written;
and inquiring the PBA on the data volume corresponding to the LBA according to the metadata reading request.
In a preferred embodiment of the present invention, determining whether the total number of LBAs corresponding to the PBA reaches a threshold value includes:
inquiring the number of PL metadata in the PBA;
comparing the number of the inquired PL metadata with a threshold value;
and in response to the fact that the number of the inquired PL metadata is equal to the threshold value, judging that the total number of LBAs corresponding to the PBA reaches the threshold value.
In a preferred embodiment of the present invention, further comprising:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
In a preferred embodiment of the present invention, in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting the corresponding PL metadata and LP metadata into the b+ tree includes:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree.
Furthermore, the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. The above-described functions defined in the methods disclosed in the embodiments of the present invention are performed when the computer program is executed by a processor.
Furthermore, the above-described method steps and system units may also be implemented using a controller and a computer-readable storage medium storing a computer program for causing the controller to implement the above-described steps or unit functions.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. 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 disclosure.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general purpose or special purpose computer or general purpose or special purpose processor. Further, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The foregoing embodiment of the present invention has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the invention, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the invention, and many other variations of the different aspects of the embodiments of the invention as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present invention.

Claims (6)

1. A method for improving snapshot read-write speed in a multi-target volume snapshot scene is characterized by comprising the following steps:
responding to the received instruction of writing data into the source volume by the host, inquiring the PBA on the corresponding data volume according to the LBA of the data to be written, wherein responding to the received instruction of writing the data into the source volume by the host, inquiring the PBA on the corresponding data volume according to the LBA of the data to be written comprises assembling a metadata reading request according to the LBA corresponding to the data to be written, and inquiring the PBA on the LBA corresponding data volume according to the metadata reading request;
judging whether the total number of LBAs corresponding to the PBA reaches a threshold value, wherein judging whether the total number of LBAs corresponding to the PBA reaches the threshold value comprises inquiring the number of PL metadata in the PBA, comparing the inquired number of PL metadata with the threshold value, and judging that the total number of LBAs corresponding to the PBA reaches the threshold value in response to the fact that the inquired number of PL metadata is equal to the threshold value;
and in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting corresponding PL metadata and LP metadata into the B+ tree.
2. The method as recited in claim 1, further comprising:
and generating PL metadata and LP metadata corresponding to the LBAs and the PBAs and inserting the generated PL metadata and LP metadata into the B+ tree in response to the total number of LBAs corresponding to the PBAs not reaching a threshold.
3. The method of claim 1, wherein in response to the total number of LBAs corresponding to the PBA reaching a threshold, writing the data to be written into the newly applied PBA and inserting the corresponding PL metadata and LP metadata into the b+ tree comprises:
applying for a new PBA in response to the total number of LBAs corresponding to the PBA reaching a threshold;
writing the data to be written into the new PBA, and generating PL metadata and LP metadata of LBA corresponding to the new PBA;
the generated PL metadata and LP metadata are inserted into the b+ tree.
4. An apparatus for improving snapshot read-write speed in a multi-target volume snapshot scene, the apparatus comprising:
the inquiry module is configured to respond to the received instruction of writing data into the source volume by the host, inquire the PBA on the corresponding data volume according to the LBA of the data to be written, assemble a metadata reading request according to the LBA corresponding to the data to be written, and inquire the PBA on the corresponding data volume according to the metadata reading request;
the judging module is configured to judge whether the total number of LBAs corresponding to the PBA reaches a threshold value, the judging module is further configured to inquire the number of the PL metadata in the PBA, compare the inquired number of the PL metadata with the threshold value, and judge that the total number of the LBAs corresponding to the PBA reaches the threshold value in response to the fact that the inquired number of the PL metadata is equal to the threshold value;
and the writing module is configured to respond to the total number of LBAs corresponding to the PBA reaching a threshold value, write the data to be written into the newly applied PBA and insert the corresponding PL metadata and the corresponding LP metadata into the B+ tree.
5. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, which instructions when executed by the processor implement the steps of the method of any one of claims 1-3.
6. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of any of claims 1-3.
CN202110962312.0A 2021-08-20 2021-08-20 Method, device and equipment for improving snapshot read-write speed and readable medium Active CN113867622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110962312.0A CN113867622B (en) 2021-08-20 2021-08-20 Method, device and equipment for improving snapshot read-write speed and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110962312.0A CN113867622B (en) 2021-08-20 2021-08-20 Method, device and equipment for improving snapshot read-write speed and readable medium

Publications (2)

Publication Number Publication Date
CN113867622A CN113867622A (en) 2021-12-31
CN113867622B true CN113867622B (en) 2023-08-18

Family

ID=78988016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110962312.0A Active CN113867622B (en) 2021-08-20 2021-08-20 Method, device and equipment for improving snapshot read-write speed and readable medium

Country Status (1)

Country Link
CN (1) CN113867622B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125447A (en) * 2019-12-22 2020-05-08 北京浪潮数据技术有限公司 Metadata access method, device and equipment and readable storage medium
CN111381779A (en) * 2020-03-05 2020-07-07 深信服科技股份有限公司 Data processing method, device, equipment and storage medium
CN112631518A (en) * 2020-12-25 2021-04-09 苏州浪潮智能科技有限公司 Data storage method and equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150081967A1 (en) * 2013-09-18 2015-03-19 Hewlett-Packard Development Company, L.P. Management of storage read requests
US20190073270A1 (en) * 2017-09-05 2019-03-07 Robin Systems, Inc. Creating Snapshots Of A Storage Volume In A Distributed Storage System

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125447A (en) * 2019-12-22 2020-05-08 北京浪潮数据技术有限公司 Metadata access method, device and equipment and readable storage medium
CN111381779A (en) * 2020-03-05 2020-07-07 深信服科技股份有限公司 Data processing method, device, equipment and storage medium
CN112631518A (en) * 2020-12-25 2021-04-09 苏州浪潮智能科技有限公司 Data storage method and equipment

Also Published As

Publication number Publication date
CN113867622A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
US9767035B2 (en) Pass-through tape access in a disk storage environment
CN108459826B (en) Method and device for processing IO (input/output) request
US20180107402A1 (en) System and method for data storage using log-structured merge trees
US10572335B2 (en) Metadata recovery method and apparatus
IE20160037A1 (en) Logical block address mapping for hard disk drives
CN103425785A (en) Data storage system and user data storage and reading method thereof
CN103034592A (en) Data processing method and device
US10042570B2 (en) Tape backup and restore in a disk storage environment with intelligent data placement
CN106095332A (en) A kind of data heavily delete method and device
KR20210076828A (en) Key value device and block interface emulation method for the same
US9524236B1 (en) Systems and methods for performing memory management based on data access properties
CN110504002B (en) Hard disk data consistency test method and device
CN113867622B (en) Method, device and equipment for improving snapshot read-write speed and readable medium
CN117370222A (en) Storage mapping method, storage mapping device, computer readable storage medium and electronic equipment
US11016884B2 (en) Virtual block redirection clean-up
CN114661243A (en) Method, device, equipment and medium suitable for adjusting visible capacity of SSD
JP5824087B2 (en) Method and system for error correction code seeding and storage medium
CN113805799B (en) Method, device, equipment and readable medium for RAID array latest write record management
CN115576956B (en) Data processing method, system, equipment and storage medium
CN112997137B (en) Method for managing performance of logic disk and storage array
CN112597074B (en) Data processing method and device
CN113806125B (en) Method, device, equipment and readable medium for processing unloaded volume exception
CN113553005B (en) Data read-write method, device and equipment for simplifying LUN
CN115437579B (en) Metadata management method and device, computer equipment and readable storage medium
CN114138198A (en) Method, device and equipment for data deduplication and readable 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