CN107229535B - Multi-copy storage method, storage device and data reading method for data block - Google Patents

Multi-copy storage method, storage device and data reading method for data block Download PDF

Info

Publication number
CN107229535B
CN107229535B CN201710367522.9A CN201710367522A CN107229535B CN 107229535 B CN107229535 B CN 107229535B CN 201710367522 A CN201710367522 A CN 201710367522A CN 107229535 B CN107229535 B CN 107229535B
Authority
CN
China
Prior art keywords
data block
copy
data
raid
reading
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
CN201710367522.9A
Other languages
Chinese (zh)
Other versions
CN107229535A (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.)
Hangzhou Sequoia Polytron Technologies Inc
Original Assignee
Hangzhou Sequoia Polytron Technologies Inc
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 Hangzhou Sequoia Polytron Technologies Inc filed Critical Hangzhou Sequoia Polytron Technologies Inc
Priority to CN201710367522.9A priority Critical patent/CN107229535B/en
Publication of CN107229535A publication Critical patent/CN107229535A/en
Application granted granted Critical
Publication of CN107229535B publication Critical patent/CN107229535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

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

Abstract

The application provides a multi-copy storage method, a storage device and a data reading method of a data block. When the multiple copies are stored, the storage equipment acquires the designated field from the received SCSI write command and writes the copies of the data block according to the number of the copies indicated by the designated field. The method and the device realize the formation of multiple copies by taking the data blocks as units, ensure the high reliability of important data, simultaneously avoid the operations of backup, mirror image and the like on the whole LUN, and greatly save the storage space. When reading the data block, the storage device firstly reads the data block, if the reading fails, whether the data block has a copy is judged, and if the data block has a copy, the copy of the data block is read from the position of the copy. The method and the device realize that the copy is automatically detected and read by directly utilizing the storage device under the condition of failed reading of the data block, the longest time in the whole data reading process is in the millisecond order, and fundamentally solve the problem of damaged service continuity caused by operations of repairing files by utilizing repair software and the like in the prior art.

Description

Multi-copy storage method, storage device and data reading method for data block
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a method, a device, and a method for reading data blocks.
Background
Data security is one of important research subjects of subjects such as computers and networks, and is not only related to individuals and enterprises, but also directly affects national security, so for important data, operations such as backup are required, and data loss caused by abnormal underlying storage is avoided, for example, data loss due to RAID (Redundant array of independent Disks) failure is avoided.
In response to the above scenario demands, there are various solutions in the prior art, such as data backup, data mirroring, live-active, and remote copy. However, the important data and the non-important data are generally located on the same LUN (Logical Unit Number) and are difficult to separate, so that the operations such as backup can be performed only on the whole LUN, and many non-important data can be sequentially backed up, which results in a serious waste of storage space.
In order to solve the problem of wasted storage space in the backup operation and the like, a processing scheme for data at a file level is proposed in the prior art, that is, a specific software is used to perform a backup operation and the like on a part of important files. The method can save storage space to a great extent, but has the problems that if the file is damaged, the file needs to be repaired through corresponding software, the service can be recovered only after the file is repaired from the backup data, and the repair process needs a certain time and has a certain influence on the continuity of the service.
Disclosure of Invention
In view of this, the present application provides a multi-copy storage method, a storage device, and a data reading method for a data block, which solve the technical problems of storage resource waste caused by operations such as data backup and service continuity impairment caused by file repair in the prior art on the premise of ensuring high reliability of data.
Specifically, the method is realized through the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for storing multiple copies of a data block, where the method is applied to a storage device, and the method includes the following steps:
receiving a SCSI write command for performing a write operation on a data block;
obtaining a designated field from the SCSI write command, wherein the designated field is used for indicating the number of copies of the data block;
and writing the copy of the data block according to the quantity indicated by the specified field.
Optionally, the writing the copy of the data block according to the number indicated by the specified field includes:
determining the RAID to which the data block is written;
and selecting the same RAID from the RAIDs except the RAID, and writing the copies into the selected RAIDs respectively.
Optionally, the method further comprises the steps of:
and setting a copy identifier in metadata corresponding to the data block, and recording the position of the copy by using the metadata.
Optionally, the number of copies of the data block indicated by the specified field is set by an external server connected to the storage device according to a copy command sent by a user, where the copy command includes the number of copies of the data block.
Optionally, the number of copies of the data block indicated by the specified field is set by an external server connected to the storage device according to the number of copies obtained from the local data input port.
In a second aspect, an embodiment of the present application provides a storage device, where the storage device includes:
a command receiving unit for receiving a SCSI write command for performing a write operation on a data block;
a field obtaining unit, configured to obtain a specified field from the SCSI write command, where the specified field is used to indicate the number of copies of the data block;
and the data writing unit is used for writing the copy of the data block according to the quantity indicated by the specified field.
Optionally, the data writing unit includes:
a data block RAID determination subunit, configured to determine a RAID in which the data block is written;
and the writing subunit is used for selecting the RAID with the same number as the RAID from the RAIDs except the RAID and writing the copies into the selected RAID respectively.
Optionally, the storage device further includes a metadata record identification unit, where the metadata record identification unit is configured to set a copy identification in metadata corresponding to the data block, and record a location of the copy using the metadata.
In a third aspect, an embodiment of the present application provides a data reading method, including the following steps:
receiving a data block reading instruction;
determining the position of a data block to be read according to the data block reading instruction;
reading the data block starting from the position of the data block; if the reading fails, judging whether the data block has a copy identifier; wherein the copy identification is used to indicate that the data block has a copy;
if the data block has the copy identification, the position of the copy of the data block is searched, and the copy of the data block is read according to the position of the copy.
In a fourth aspect, an embodiment of the present application provides a storage device, where the storage device includes:
the instruction receiving unit is used for receiving a data block reading instruction;
the position determining unit is used for determining the position of the data block to be read according to the data block reading instruction;
a data reading unit for reading the data block from the position of the data block;
if the reading fails, the data reading unit is further used for judging whether the data block has a copy identifier; if the data block has the copy identification, searching the position of the copy of the data block, and reading the copy of the data block according to the position of the copy; wherein the copy identification is used to indicate that the data block has a copy.
According to the technical scheme, when the data is stored, the storage device acquires the designated field from the received SCSI write command and writes the copies of the data block according to the number of the copies indicated by the designated field. According to the method and the device, multiple copies can be formed by taking the data blocks as units, so that the high reliability of important data is ensured, the operations of backup, mirror image and the like on the whole LUN are avoided, and the storage space of the storage device is greatly saved.
When the data block is read, the storage device reads the data block from the position of the data block according to the data block reading instruction. If the reading fails, whether the data block has a copy is judged, and if the data block has a copy, the copy of the data block is read from the position of the copy. According to the method and the device, when the reading of the data block fails, the storage device can be directly utilized to automatically detect the copy and read the copy, the longest time of the whole data reading process is in the millisecond order, the defect that the service continuity is damaged due to the fact that files are repaired by repair software in the prior art is completely avoided, the smoothness of reading the copy is greatly improved, and the user experience is improved.
Drawings
FIG. 1 is a block flow diagram illustrating a method for storing multiple copies of a block of data according to an exemplary embodiment of the present application;
FIG. 2 is a block flow diagram illustrating another method for multiple copy storage of data blocks in accordance with an exemplary embodiment of the present application;
FIG. 3 is a block flow diagram of a data reading method according to an exemplary embodiment of the present application;
FIG. 4 is a block flow diagram of another data reading method shown in an exemplary embodiment of the present application;
FIG. 5 is a block diagram of a memory device shown in an exemplary embodiment of the present application;
FIG. 6 is a block diagram of another memory device shown in an exemplary embodiment of the present application;
FIGS. 7-11 are schematic diagrams illustrating the location of the specified field in the SCSI write command in the embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as may be used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
For ease of understanding, the present application first describes terms that may be used hereinafter.
RAID: redundant Array of Independent Disks (RAID) is a disk assembly with huge capacity composed of many cheaper Disks, and the performance of the whole disk system is improved by the additive effect generated by providing data by individual Disks.
Small Computer System Interface (SCSI) is a collection of specifications for communication operations between a host and a storage device, such as transferring commands, status, and block data.
SBC: SCSI Block Commands, SCSI Block device instruction set.
Metadata: metadata, a data that records management related information, may also be understood as a data that describes data, metadata stored on a storage device, e.g., metadata for a LUN stored on a RAID.
In order to solve the technical problem of storage resource waste caused by operations such as backup and mirroring in the prior art, an embodiment of the present application provides a method for storing multiple copies of a data block, which is applied to a storage device, and as shown in fig. 1, the method includes the following steps:
s11, receiving a SCSI writing command for executing writing operation on the data block;
in step S11, a data block may be formed by executing a SCSI write command once;
s12, acquiring a designated field from the SCSI write command, wherein the designated field is used for indicating the number of the copies of the data block;
specifically, the number of copies can be indicated by a predetermined bit of the byte to which the specified field corresponds, wherein binary data is set in the predetermined bit, and the number of copies is indicated by the set binary data. For example, the 5 th bit and the 6 th bit of the byte corresponding to the specified field are used to define the number of copies to be written, if the 5 th bit and the 6 th bit of the byte are set to 01, the number of copies to be written of the data block is 1, if the 5 th bit and the 6 th bit of the byte are set to 10, the number of copies to be written of the data block is 2, and if the 5 th bit and the 6 th bit of the byte are set to 11, the number of copies to be written of the data block is 3. Of course, the 5 th and 6 th bits of the byte corresponding to the specified field may also be set to 00, which indicates that the data block does not need to be written into a copy. The specific number of copies can be flexibly set according to the importance degree of the data blocks in different application scenes, so that the high reliability of important data is ensured, and the waste of storage resources is effectively reduced. In addition, the present application is not limited to using two bits as the predetermined bits to indicate the number of copies, and may use 3 bits or 4 bits as the predetermined bits to indicate the number of copies, and for example, may use the 4 th, 5 th, and 6 th bits of the byte corresponding to the designated field as the predetermined bits to define the number of copies that need to be written.
And S13, writing the copy of the data block according to the quantity indicated by the specified field.
Those skilled in the art will appreciate that the present application also writes the data block itself at the same time, before, or after writing 1 or more copies.
The method for storing the multiple copies of the data block only slightly improves the write command in the existing SCSI protocol, namely the number of copies is set in the reserved field of the SCSI write command, and a plurality of copies of the data block can be formed in the storage device when the SCSI write command is executed.
It should be noted that, in step S12, the specified field is any undefined field in the SCSI write command specified in advance, and in one embodiment, the specified field may be a Reserved field in the SCSI write command, that is, a Reserved field shown in fig. 7 to 11. Specifying the number of copies using the Reserved field Reserved does not have any impact on the original SCSI write command. Each write command in the SBC protocol, that is, each SCSI write command, has several unused reserved fields, as shown in fig. 7 to 11, the positions of the reserved fields in each SCSI write command are different, and when the storage device parses the SCSI protocol, the storage device searches the reserved fields at corresponding positions according to different write commands, then parses the reserved bits in the relevant reserved fields of each SCSI write command, and determines the number of copies.
One or more copies of the data block are formed by performing step S13. It should be noted that each copy is located in one RAID, that is, different copies are located in different RAIDs, so that when one RAID fails or is damaged, the security of the copies stored in the other RAIDs is not affected, that is, when one RAID storing a copy fails, the copies can be read from the other RAIDs storing copies. Similarly, the RAID used for storing the data block is different from the RAID used for storing each copy, so that when the RAID used for storing the data block fails or is damaged, the security of the copies stored in other RAIDs is not affected, that is, when the RAID used for storing the data block fails, the copies can be read from other RAIDs in which the copies are stored. The method for storing the data blocks and the copies in different RAID effectively improves the safety of the data blocks storing important data. The implementation of the above-described write operation specifically includes the steps of:
s131, determining the RAID written in the data block;
s132 selects a RAID that is the same as the number of copies from the RAIDs other than the RAID, and writes the copies to the selected RAIDs, respectively.
It should be noted that, in the present application, the respective copies may also be located in different disk cabinets or on different storage devices.
It is meaningless that 1 or more copies of the data block formed in the storage device after the above steps S11 to S13 are executed, but are stored only and cannot be read out, and in order to read out the stored copies, the above method further includes the following steps:
s14, setting copy identification in the metadata of the LUN, specifically in the metadata corresponding to the data block, and recording the location of the copy using the metadata.
In step S14, a copy flag is set to indicate which data blocks have copies, and when reading a data block fails, it is first determined whether the data block has a copy flag, that is, whether the data block has a copy. After determining that there is a copy, the location of the copy of each data block is found in the metadata recording the location of the copy, for example, uuid of RAID where the copy is located (for identifying RAID where the copy is located) and offset of the copy in RAID (for identifying location of the copy in RAID) are found, and the location of the copy can be determined according to these 2 pieces of information. The copy may then be read from the storage device based on the location of the copy.
After the copy identification and the position of the copy are recorded in the metadata corresponding to the data block, the storage device can automatically complete the process of reading the copy later, and the time for reading the copy is millisecond-order, so that the service interruption caused by operations such as file repair and the like in the prior art is completely avoided.
It should be noted that the SCSI write command for performing the data block write operation is generated and transmitted by an external server connected to the storage device. The number of copies in the designated field in the SCSI write command is set by the external server upon the copy command sent by the user. In one embodiment, the external server sets the number of copies in the specified field by:
s31, the external server receives the copy command;
where the copy command is a special copy command customized in the file system, the user or application layer may set the number of copies to be written, for example, the copy command is copy2, which means that the number of copies to be generated for all data blocks in the target file is 2.
And S32, analyzing the copy command to obtain the number of the copies, and setting a designated field according to the number of the copies. Specifically, when a module of the bottom-layer encapsulated SCSI protocol is called, that is, when an SCSI command encapsulation layer encapsulates an SCSI command, the number of copies obtained by analysis is filled in designated fields in all SCSI write commands that generate the target file.
It should be clear to those skilled in the art that, from the perspective of a file system, a file is the smallest unit of storage, and when any one data block contained in the file is abnormal, the file cannot be read normally. Therefore, even if only one important data block in the file is important, in order to ensure that the important data block can be read normally, other data blocks of the file must also be read normally, and then all data blocks of the file need to store copies. The first server fills the number of the copies carried in the predetermined copy command into the designated field of all the SCSI write commands for generating the target file, so that all the data blocks of the target file have the same number of copies, the security of the target file is fully ensured, and the security of the important data blocks in the target file is ensured.
It should be noted that, in another embodiment, the number of copies of the data block indicated by the specified field in the SCSI write command that performs the data block write operation may also be set by an external server connected to the storage device according to the number of copies obtained from the local data input port. The method comprises the following specific steps:
s41, the external server acquires the preset identification bit information;
the predetermined flag information may be self-defined when the target file is opened, and the predetermined flag may be transmitted to an SCSI command encapsulation layer, i.e., a module of the underlying encapsulated SCSI protocol, indicating that the number of copies to be filled in the designated fields of all SCSI write commands that need to be executed to generate the target file is required.
S42, acquiring the copy number from the data input port, and setting specified fields in all SCSI write commands required to be executed for generating the target file according to the copy number. In this step, the application layer sets the number of copies that need to be written at the data input port.
The specified fields of all SCSI write commands that generate the target file are also filled with the same number in the above embodiment, i.e., all data blocks of the generated target file have the same number of copies. The number of copies carried in the copy command in step S31 and the number of copies obtained through the data input port in step S41 are flexibly set by the application layer according to actual needs. As shown in FIG. 2, after obtaining the number of copies, the SCSI instruction encapsulation layer fills the corresponding number of copies in the designated field of each SCSI write instruction according to the number, thereby completing the improvement of the SCSI write instruction.
The above embodiment of setting the designated field by using the external server is only one scenario of encapsulating the SCSI command by using the file system, and certainly, the SCSI command may be encapsulated by using other means, for example, an application that directly performs reading and writing on the block device, and the application may directly encapsulate the SCSI command and issue the SCSI command to the storage device.
It should be noted that, as shown in fig. 2, in order to determine whether the data block and/or the copy thereof is successfully written, the identifier of successful writing needs to be returned after the data block and/or the copy thereof is written, which specifically includes two scenarios, where the first scenario is that, when the data block does not need to store the copy, a identifier of successful writing can be returned after the data block is written. The second scenario is that when the data block needs to store the copy, the identification of successful writing can be returned only after the data block and all the copies are successfully written.
As shown in fig. 2, the number of copies to be written set by the application layer may also be 0, so that no copy needs to be written, and the SCSI write command returns an identifier of successful writing after writing the data block normally.
As shown in fig. 2, when the number of copies written is not 0, the RAID writing the copy must be an available RAID, that is, the remaining space of the RAID can accommodate the copy.
In a specific operation of writing a copy on a storage device, a fixed-length data block is used as the minimum storage unit of the copy, for example, the fixed-length data block is 4 KB.
In summary, the embodiment of the multi-copy storage method can generate multiple copies of the important data by using the data block as a unit, so that the safety of the important data is ensured, and precious storage resources are saved. Meanwhile, the storage device corresponding to the method can automatically finish reading the copy because the copy identification and the position of the copy are stored in the storage device, so that the continuity of related reading services in the situation of data block reading faults is improved, and the user experience degree is improved.
Corresponding to the embodiment of the multi-copy storage method, the application also provides an embodiment of a storage device. As shown in fig. 5, the apparatus includes:
a command receiving unit for receiving a SCSI write command for performing a write operation on a data block;
a field acquiring unit, configured to acquire a specified field from the SCSI write command, where the specified field is used to indicate the number of copies of the data block;
and the data writing unit is used for writing the copies of the data blocks according to the quantity indicated by the specified field.
Note that the data writing unit includes:
the data block RAID determining subunit is used for determining the RAID written in the data block;
and the writing subunit is used for selecting the same RAID from the RAIDs except the RAID and writing the copies into the selected RAID respectively.
It should be noted that, the storage device further includes a metadata record identification unit, and the metadata record identification unit is configured to set a copy identification in the metadata corresponding to the data block, and record a location of the copy using the metadata.
The implementation process of the functions and actions of each unit or sub-unit in the storage device is specifically detailed in the implementation process of the corresponding steps in the multiple copy storage method, and is not described herein again.
The foregoing embodiment provides a multi-copy storage method, which implements storage of copies, and the following embodiment provides a data reading method corresponding to the above stored copies, as shown in fig. 3, where the method includes the following steps:
s21, receiving a data block reading instruction;
the data block reading instruction in the step is issued to the storage device by the front-end application and is used for reading the data block;
s22, determining the position of the data block to be read according to the data block reading instruction;
s23, reading the data block from the position of the data block; if the reading fails, judging whether the data block has a copy identifier; wherein the copy identification is used for indicating that the data block has a copy;
if the data block has the copy identification, searching the position of the copy of the data block according to the copy identification, and reading the copy of the data block according to the position of the copy;
in this step S23, the copy identification and the location of the copy are specifically looked up in the metadata.
In step S22, the determination of the position of the data block to be read according to the data block reading command specifically includes two scenarios, the first scenario is that the position of the data block is directly carried in the data block reading command, and the position of the data block can be directly determined by analyzing the data block reading command. The second scenario is that the location of the data block is not carried in the data block reading instruction, and the data block reading instruction only carries an identifier of the data block, and the location of the data block needs to be further determined according to the identifier.
It should be noted that, in step S23, the reading of the copy of the data block according to the position of the copy includes two scenarios, where the first scenario is that the reading of the copy is successful, and at this time, the read copy is returned; the second scenario is that all copies fail to be read, and at this time, the reading of the data block completely fails, and information of data reading failure needs to be returned.
It should be noted that, although the step of reading the copy when the data block is failed is described in detail in step S23, there is a situation where the data block is successfully read in the actual reading process, as shown in fig. 4, if the data block is successfully read, only the data read from the data block needs to be returned, and it is not necessary to further determine whether the data block has the copy identifier.
The processing step when the data block fails to be read and has a copy is described in detail in the above step S23, but there is a situation where the data block does not have a copy in the actual reading process, as shown in fig. 4, at this time, the data reading of the data block completely fails, and information of the data reading failure needs to be returned.
The multi-data reading method provided by the embodiment realizes the function that the storage device automatically jumps to the position of the copy to read the copy, the whole data reading time is in millisecond order, the continuity of data reading of a client is not affected, the user experience is improved, and meanwhile, the high reliability of the data is ensured.
Corresponding to the embodiment of the data reading method, the application also provides another embodiment of the storage device. As shown in fig. 6, the apparatus includes:
the instruction receiving unit is used for receiving a data block reading instruction;
the position determining unit is used for determining the position of the data block to be read according to the data block reading instruction;
a data reading unit for reading the data block starting from the position of the data block;
if the reading fails, the data reading unit is further used for judging whether the data block has a copy identifier; if the data block has the copy identification, searching the position of the copy of the data block, and reading the copy of the data block according to the position of the copy; wherein the copy identification is used to indicate that the data block has a copy.
The implementation process of the functions and actions of each unit in the storage device is specifically described in the implementation process of the corresponding step in the data reading method, and is not described herein again.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (6)

1. A method for storing multiple copies of a data block, the method applied to a storage device comprising the steps of:
receiving a SCSI write command for performing a write operation on a data block in a RAID;
acquiring a designated field from the SCSI write command; wherein the designated field is to indicate a number of copies of the data block;
determining the RAID to which the data block is written; selecting a same number of RAIDs as the RAID number from RAIDs other than the RAID;
writing the data blocks into the copies of the data blocks in the selected RAID respectively according to the quantity indicated by the specified fields;
and setting a copy identifier in metadata corresponding to the data block, and recording the RAID correspondingly stored in the copy by using the metadata.
2. The multi-copy storage method according to claim 1, wherein the number of copies of the data block indicated by the specified field is set by an external server connected to the storage device according to a copy command sent by a user, and the copy command includes the number of copies of the data block.
3. The multi-copy storage method according to claim 1, wherein the number of copies of the data block indicated by the specified field is set by an external server connected to the storage device in accordance with the number of copies acquired from a local data input port.
4. A storage device, the device comprising:
a command receiving unit for receiving a SCSI write command for performing a write operation on a data block in a RAID;
a field acquiring unit, configured to acquire a specified field from the SCSI write command; wherein the designated field is to indicate a number of copies of the data block;
a data block RAID determination unit for determining the RAID in which the data block is written; selecting a same number of RAIDs as the RAID number from RAIDs other than the RAID;
the data writing unit is used for writing the data blocks into the copies of the data blocks in the selected RAID respectively according to the quantity indicated by the specified field;
and the metadata record identification unit is used for setting a copy identification in the metadata corresponding to the data block and recording the RAID stored correspondingly to the copy by using the metadata.
5. A data reading method applied to a storage device, the method comprising the steps of:
receiving a reading instruction of a data block in the RAID;
determining the position of a data block to be read according to the data block reading instruction;
reading the data block starting from the position of the data block; if the reading fails, reading metadata corresponding to the data block, and judging whether the data block has a copy identifier; the copy identification is used for indicating that the data block has a copy, and the metadata is used for recording the RAID corresponding to the copy;
if the data block has the copy identification, searching a RAID (redundant array of independent disks) which is correspondingly stored in the copy of the data block based on the metadata, and reading the copy of the data block according to the RAID which is correspondingly stored in the copy.
6. A storage device, the storage device comprising:
the command receiving unit is used for receiving a reading command of the data blocks in the RAID;
the position determining unit is used for determining the position of the data block to be read according to the data block reading instruction;
a data reading unit for reading the data block from the position of the data block;
if the reading fails, reading metadata corresponding to the data block, and judging whether the data block has a copy identifier; the copy identification is used for indicating that the data block has a copy, and the metadata is used for recording the RAID corresponding to the copy;
if the data block has the copy identification, searching a RAID (redundant array of independent disks) which is correspondingly stored in the copy of the data block based on the metadata, and reading the copy of the data block according to the RAID which is correspondingly stored in the copy.
CN201710367522.9A 2017-05-23 2017-05-23 Multi-copy storage method, storage device and data reading method for data block Active CN107229535B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710367522.9A CN107229535B (en) 2017-05-23 2017-05-23 Multi-copy storage method, storage device and data reading method for data block

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710367522.9A CN107229535B (en) 2017-05-23 2017-05-23 Multi-copy storage method, storage device and data reading method for data block

Publications (2)

Publication Number Publication Date
CN107229535A CN107229535A (en) 2017-10-03
CN107229535B true CN107229535B (en) 2020-01-21

Family

ID=59933816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710367522.9A Active CN107229535B (en) 2017-05-23 2017-05-23 Multi-copy storage method, storage device and data reading method for data block

Country Status (1)

Country Link
CN (1) CN107229535B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101965559A (en) * 2007-12-27 2011-02-02 普莱恩特技术股份有限公司 Comprise the memory controller that is used for flash memory that intersects switch that processor is connected with internal storage
CN103699494A (en) * 2013-12-06 2014-04-02 北京奇虎科技有限公司 Data storage method, data storage equipment and distributed storage system
CN103970484A (en) * 2013-02-06 2014-08-06 华为技术有限公司 Method, device and system for controlling data storage
CN105577776A (en) * 2015-12-17 2016-05-11 上海爱数信息技术股份有限公司 Distributed storage system and method based on data arbiter copy
CN105872040A (en) * 2016-03-30 2016-08-17 华中科技大学 Method for optimizing write performance of distributed block storage system by utilizing cache of gateway nodes

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101965559A (en) * 2007-12-27 2011-02-02 普莱恩特技术股份有限公司 Comprise the memory controller that is used for flash memory that intersects switch that processor is connected with internal storage
CN103970484A (en) * 2013-02-06 2014-08-06 华为技术有限公司 Method, device and system for controlling data storage
CN103699494A (en) * 2013-12-06 2014-04-02 北京奇虎科技有限公司 Data storage method, data storage equipment and distributed storage system
CN105577776A (en) * 2015-12-17 2016-05-11 上海爱数信息技术股份有限公司 Distributed storage system and method based on data arbiter copy
CN105872040A (en) * 2016-03-30 2016-08-17 华中科技大学 Method for optimizing write performance of distributed block storage system by utilizing cache of gateway nodes

Also Published As

Publication number Publication date
CN107229535A (en) 2017-10-03

Similar Documents

Publication Publication Date Title
US8200924B2 (en) Emulated storage system
US7613946B2 (en) Apparatus, system, and method for recovering a multivolume data set
US10120769B2 (en) Raid rebuild algorithm with low I/O impact
US8675296B2 (en) Creating an identical copy of a tape cartridge
US20060155944A1 (en) System and method for data migration and shredding
US20150261619A1 (en) Cascade ordering
US9176853B2 (en) Managing copy-on-writes to snapshots
US8600937B1 (en) System and method for fast volume cloning
CN102024044A (en) Distributed file system
US6732294B2 (en) Method of disaster recovery testing and storage system
US7356622B2 (en) Method and apparatus for managing and formatting metadata in an autonomous operation conducted by a third party
US10572335B2 (en) Metadata recovery method and apparatus
CN106681865B (en) Service recovery method and device
CN109726036B (en) Data reconstruction method and device in storage system
US20110016082A1 (en) Apparatus and method to replicate remote virtual volumes to local physical volumes
CN113419684B (en) Data processing method, device and equipment and readable storage medium
CN108170375B (en) Overrun protection method and device in distributed storage system
US20100174880A1 (en) Method for fast format of a fully allocated volume when copied from a space efficient volume
US9645897B2 (en) Using duplicated data to enhance data security in RAID environments
JP2017531892A (en) Improved apparatus and method for performing a snapshot of a block level storage device
CN105279458A (en) Storage apparatus, communication apparatus, and storage control system
CN102495815B (en) Processing method for I/O (input/output) data access interrupt, system and equipment
CN107229535B (en) Multi-copy storage method, storage device and data reading method for data block
CN116501259A (en) Disk group dual-activity synchronization method and device, computer equipment and storage medium
CN105159790A (en) Data rescue method and file server

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