WO2018090837A1 - 基于纠删码的部分写入方法及装置、存储介质、设备 - Google Patents

基于纠删码的部分写入方法及装置、存储介质、设备 Download PDF

Info

Publication number
WO2018090837A1
WO2018090837A1 PCT/CN2017/109154 CN2017109154W WO2018090837A1 WO 2018090837 A1 WO2018090837 A1 WO 2018090837A1 CN 2017109154 W CN2017109154 W CN 2017109154W WO 2018090837 A1 WO2018090837 A1 WO 2018090837A1
Authority
WO
WIPO (PCT)
Prior art keywords
update
data
check
version information
node
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.)
Ceased
Application number
PCT/CN2017/109154
Other languages
English (en)
French (fr)
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.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to US16/461,520 priority Critical patent/US11119849B2/en
Priority to CA3071925A priority patent/CA3071925C/en
Publication of WO2018090837A1 publication Critical patent/WO2018090837A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1048Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using arrangements adapted for a specific error detection or correction feature
    • G06F11/1056Updating check bits on partial write, i.e. read/modify/write
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1044Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices with specific ECC/EDC distribution
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10268Improvement or modification of read or write signals bit detection or demodulation methods

Definitions

  • the present disclosure relates to storage technologies, and in particular, to a partial writing method and apparatus based on erasure codes.
  • the erasure code redundancy protection technology solves the problem that the traditional redundancy protection technology is not suitable for a distributed production storage system.
  • the erasure code is an encoding technique used for data repair.
  • the original data is usually divided into L bytes of data blocks, L is a fixed value, and n pieces of original data are obtained; and each m block of raw data is encoded by coding.
  • k block L byte size check data that is, obtain k block check data based on m block original data redundancy calculation, check data is also called redundant data
  • m block original data m data blocks
  • k block check data k check blocks
  • m block original data and k block check data are called an EC group; if any of (m + k) data blocks has a maximum of k If the block data is wrong, damaged or lost, the distributed storage system can recover all the original data (m block raw data) by decoding calculation.
  • m is less than or equal to n.
  • Write operations or update operations are common operations of the storage system.
  • the encoding calculation process for write operations can usually be done on the client side, or it can be done on a node (data node).
  • the embodiment of the present disclosure provides a partial writing method and apparatus based on an erasure code to solve at least one problem existing in the prior art.
  • the writing process encounters an error and terminates, the fault can be confirmed. Retry the write operation correctly and perform the data repair operation correctly.
  • an embodiment of the present disclosure provides a partial writing method based on an erasure code, including:
  • the data node receives a first update request from the client, where the first update request carries update data and first version information, wherein the first version information is stored by the client to indicate that the update is to be utilized
  • the second version information is information that is used by the data node to indicate a version of the target data block
  • the data node processes the update data according to a matching result between the first version information and the second version information.
  • an embodiment of the present disclosure provides a partial writing method based on an erasure code, including:
  • the client Determining, by the client, update data and identification information of the target data block to be updated by using the update data, the data amount of the update data being smaller than the data amount of an erasure correction code group, wherein the erasure correction code group includes one or a plurality of data blocks and a check data block for recovering the data block;
  • the client carries the update data and the first version information in a first update request
  • the client updates the first version information.
  • an embodiment of the present disclosure provides a partial writing method based on an erasure code, including:
  • the check node receives a second update request sent by the data node, where the second update request carries a check increment;
  • the check node updates the check data block stored by itself according to the check increment in response to the second update request, to obtain an updated check data block;
  • the check node updates the version vector stored by itself according to the second update request, and the version vector includes version information of each of the m data blocks in the erasure code group corresponding to the target data block to be updated,
  • the erasure code group further includes k check data blocks for recovering the m data blocks, where m and k are natural numbers;
  • the check node sends a second update response to the data node, where the second update response carries a result indicating whether the check data block is updated with the check delta.
  • an embodiment of the present disclosure provides a partial writing device based on an erasure code, wherein the device includes a first determining unit, a first obtaining unit, and a processing unit, where:
  • the first determining unit is configured to receive a first update request from a client, where the first update request carries update data and first version information, where the first version information is used by the client for storage And indicating information of a version of the target data block to be updated by using the update data, the data amount of the update data is smaller than the data amount of an erasure correction code group, where the erasure correction code group includes m data blocks and k Check the data block, m, k are natural numbers;
  • the first obtaining unit is configured to obtain, according to the first update request, second version information, where the second version information is information used by the data node to indicate a version of the target data block;
  • the processing unit is configured to process the update data according to a matching result between the first version information and the second version information.
  • an embodiment of the present disclosure provides a partial writing device based on an erasure code, where the device includes a second determining unit, a third determining unit, a fourth determining unit, a carrying unit, a second receiving unit, and The first update unit, wherein:
  • the second determining unit is configured to determine update data and identification information of a target data block to be updated by using the update data, where the data amount of the update data is smaller than an amount of data of an erasure correction code group, where The erasure code group includes one or more data blocks and a check data block for recovering the data block;
  • the third determining unit is configured to determine, according to the identifier information of the target data block, identifier information of the corresponding data node;
  • the fourth determining unit is configured to determine first version information indicating a current version of the target data block according to the identification information of the target data block;
  • the carrying unit is configured to carry the update data and the first version information in a first update request, and send the first update request to the data node according to the identifier information of the data node;
  • the second receiving unit is configured to receive a first update response sent by the data node, where the first update response carries an update result
  • the first update unit is configured to update the first version information if the update result indicates that the update is successful.
  • an embodiment of the present disclosure provides a partial writing device based on an erasure code, where the device includes a third receiving unit, a fifth determining unit, a second updating unit, and a third sending unit, where:
  • the third receiving unit is configured to receive a second update request sent by the data node, where the second update request carries a check increment;
  • the fifth determining unit is configured to update the check data block stored by itself according to the check increment to obtain an updated check data block in response to the second update request;
  • the second update unit is configured to update a version vector stored by itself according to the second update request, where the version vector includes each of m data blocks in the erasure code group corresponding to the target data block to be updated. Version information, the erasure code group further includes k parity data blocks for recovering the m data blocks, where m and k are natural numbers;
  • the third sending unit is configured to send a second update response to the data node, where the second update response carries a result indicating whether the check data block is successfully updated by using the check increment.
  • an embodiment of the present disclosure provides a machine readable storage medium storing machine executable instructions, wherein the machine executable instructions are executed by a processor to perform the above A partial writing method based on erasure code.
  • an embodiment of the present disclosure provides a data update device, including: a storage medium, a processor, and machine executable instructions for being stored on the storage medium and executable on the processor, where The processor performs the machine executable instructions to implement the above-described erasure code based partial writing method.
  • a first update request may be received from a client, where the first update request carries update data and first version information, where the first version information is used to indicate that the client stores a version information indicating a target data block to be updated by using the update data, the data amount of the update data being less than an amount of data of an erasure code group; and acquiring the second version information in response to the first update request,
  • the second version information is information stored by the data node for indicating a version of the target data block; and the update data is processed according to a matching result between the first version information and the second version information;
  • FIG. 1A is a schematic diagram of a network architecture of an erasure code distributed storage system according to an embodiment of the present disclosure
  • FIG. 1B is a schematic flowchart showing an implementation process of a partial writing method based on an erasure code according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of an implementation process of a partial writing method based on an erasure code according to Embodiment 2 of the present disclosure
  • FIG. 3 is a schematic structural diagram of a structure of a third erasure code distributed storage system according to an embodiment of the present disclosure
  • FIG. 4 is a schematic structural diagram of a computing device according to an embodiment of the present disclosure.
  • the codec algorithm of the erasure code includes the following steps:
  • a coding coefficient matrix A [a ij ] k ⁇ m , wherein the number of rows of the coding coefficient matrix is k rows, columns The number is m columns; a ij represents an element of the i-th row and the j-th column, i is an integer greater than or equal to 1 and less than or equal to k, and j is an integer greater than or equal to 1 and less than or equal to m;
  • (m + k) data blocks in each EC group are stored in (m + k) different servers, each of which is called a node.
  • a server in which a data block (for example, a raw data block) is stored may be referred to as a data node, and a server for storing a check data block may be referred to as a check node.
  • ⁇ p xj is a check increment and indicates the update amount of the parity data block. Therefore, the update of the check block can depend only on the amount of change ⁇ d ij of the modified data.
  • the update operation or the write operation in the related art generally includes the following steps:
  • the data to be updated node receives the data blocks sent by the client data d 0 of the update request, the update request for updating the data in the data block 0 d 0 to d '; wherein, the update request carries There is update data d 0 '.
  • the data node to be updated writes the update data d 0 ' to a local disk
  • Block p' write the updated parity data block p' to the local disk, and send the updated signal to the data node to be updated;
  • the data node to be updated After receiving the updated signal sent by all redundant nodes (check nodes), the data node to be updated sends an updated signal to the erasure code cluster storage system or the client.
  • the system cannot confirm the fault, cannot correctly retry the write operation, and cannot perform the data repair operation correctly. For example, if an update operation successfully updates the original data block but fails to update all the check data blocks due to the fault, the system will not be able to confirm which of the original data block and the check data block are new during the subsequent repair process. Which ones are old and cannot be repaired.
  • an embodiment of the present disclosure provides a partial writing method based on an erasure code, which is applied to an erasure code distributed storage system, as shown in FIG. 1A, the erasure code distributed storage system.
  • an EC group at least one client 11, m data nodes 121 to 12m, and k check nodes 131 to 13k are included, and both m and k are natural numbers greater than one.
  • the client can be installed on the electronic device, and the data node and the check node can be implemented by using a server, and the server and the electronic device can be implemented by using various computing devices with information processing capabilities, such as electronic
  • the device can be a smart phone, a laptop computer, a desktop computer, a personal digital assistant, a smart TV, etc.
  • the server can also be implemented by using a server cluster.
  • FIG. 1B is a schematic flowchart of an implementation process of a partial writing method based on an erasure code according to an embodiment of the present disclosure, the method includes:
  • step S101 the data node receives a first update request from the client, where the first update request carries update data and first version information, where the first version information is stored by the client for indicating that the user wants to utilize And the information of the version of the target data block in which the update data is updated, the data amount of the update data is smaller than the data amount of an erasure code group, and the erasure code group includes m data blocks and k check data blocks. , m, k are natural numbers;
  • Step S102 The data node obtains second version information in response to the first update request, where the second version information is information used by the data node to indicate a version of the target data block.
  • the data node can maintain version information about the data block itself, and therefore, the data node acquires the second version information, which can be obtained from itself.
  • Step S103 The data node processes the update data according to a matching result between the first version information and the second version information.
  • the step S103 may include the following processing.
  • the data node may determine whether the first version information and the second version information match, and obtain a first determination result.
  • determining whether the first version information matches the second version information may include: determining whether the first version information is the same as the second version information, and if the same, the first version information matches the second version information, if not, then The first version information does not match the second version information.
  • the second version information is the latest version information. If the second version information is higher than the first version information, it indicates that the client has forgotten to update its version information, if the second version information is lower than the first version.
  • the version information indicates that the update of the data node is not completed and the client thinks that the update is completed, so the client updates its version information, whether the second version information is higher or lower than the first version information, as long as two If the data does not match, the data node will send an error message to the storage system or the client (the result of the update failure).
  • the data node may process the update data according to the first determination result.
  • processing the update data according to the first determination result may include: if the first determination result indicates that the first version information does not match the second version information, And sending a first update response, where the first update response carries an update failure result and a cause value, where the cause value is used to indicate that the update failure result is caused by the first version information error.
  • the cause value may be a numerical value or a code, and is only used to characterize an update failure due to a first version information error.
  • the data node can discard the update data.
  • the processing the update data according to the first determination result may further include: if the first determination result indicates that the first version information matches the second version information, according to the update data and the target data
  • the block determines a set of check increments ⁇ P 1 , ⁇ P 2 , . . . , ⁇ P g , . . . , ⁇ P k ⁇ , wherein the check increment represents an update amount of the check data block, ⁇ P g is the check increment of the gth check node, and g is greater than or equal to 1 and less than or equal to k.
  • the data node may carry the check increment ⁇ P g of the gth check node in the second update request, and send the second update request to the gth check node, where the The second update request is used to trigger the g th check node to update the check data block stored by itself according to the check increment ⁇ P g , and update the version vector stored by the g th check node itself.
  • the processing the update data according to the first determination result may include: if the first determination result indicates the first version information and the second version information Matching, using the update data to update the target data block stored by itself; after updating the target data block, updating the second version information.
  • the data node after updating the target data block, the data node sends a first update response to the client, where the first update response carries an update success result, and the update success result is used.
  • the first version information is updated by triggering the client.
  • the client since the client is the version information of the last updated data block, as long as the client fails to update the version information successfully, the previous update operation or the write operation is not completely successful, and therefore, the timer can be set. If the update is not successful within the specified time, the client can re-initiate the update request.
  • the data node maintains an auto-increment version information (version number) for each original data block.
  • version information first version information
  • the data node first determines the version information (first version information) of the received data. Whether it matches the version information (second version information) stored by itself, and the data node updates the data in the update request when it matches, otherwise it will return the update failure result to the client, thereby avoiding encountering when the writing process is encountered.
  • the error is terminated and the system cannot confirm the fault and cannot correctly retry the write operation and the data repair operation cannot be performed correctly.
  • FIG. 2 is a schematic flowchart of a partial writing method based on an erasure code according to Embodiment 2 of the present disclosure, as shown in FIG. , the method includes:
  • Step S201 the client determines update data and identification information of the target data block to be updated by using the update data
  • the data amount of the update data is smaller than the data amount of one erasure code group
  • Step S202 the client determines, according to the identification information of the target data block, identifier information of the corresponding data node;
  • Step S203 the client determines the current version information of the target data block according to the identification information of the target data block, and uses the current version information of the data block as the first version information.
  • Step S204 the client carries the update data and the first version information in the first update request, and sends the first update request to the corresponding data node according to the identifier information of the data node;
  • the first update request for the original data block sent from the client carries the version number of the target data block, to The standby data node is checked.
  • Step S205 the data node receives the first update request.
  • the first update request carries update data and first version information, where the first version information is information stored by the client for indicating a version of the target data block to be updated by using the update data.
  • the amount of data of the update data is less than the amount of data of an erasure code group;
  • Step S206 the data node obtains the second version information in response to the first update request.
  • the second version information is information stored by the data node for indicating a version of the target data block
  • Step S207 the data node determines whether the first version information and the second version information match, and obtains a first determination result
  • the data node sends a first update response and discards the update data, and the first update response carries an update.
  • Step S208 if the first determination result indicates that the first version information matches the second version information, the data node updates the data block by using the update data;
  • Step S209 after the data node updates the data block, update the second version information.
  • Step S210 if the first determination result indicates that the first version information matches the second version information, the data node determines a set of check increments according to the update data and the target data block ⁇ P 1 , ⁇ P 2 ,..., ⁇ P g ,..., ⁇ P k ⁇ ;
  • ⁇ P g is a check increment of the gth check node, g is greater than or equal to 1 and less than or equal to k, and k is a number of check data blocks matching one of the erasure codes;
  • Step S211 the data node carries the check increment ⁇ P g of the gth check node in the second update request, and the data node sends the second update request to the gth check node.
  • the second update request is used to trigger the g-th check node to update the check data stored by itself according to the check increment ⁇ P g and update the storage stored by the g-th check node itself. Version vector.
  • Step S212 the check node receives the second update request sent by the data node
  • the second update request carries a check increment ⁇ P g
  • the second update request is used to update the check data block stored by itself according to the check increment ⁇ P g and update the self Stored version vector;
  • the second update request may further carry the data block stored by the data node for indicating the target data block.
  • the second version information of the pre-updated version, the check node is similar to the data node, and the check node also needs to determine whether the version information carried in the second update request matches the version information maintained by itself, and if it matches, the following is performed.
  • Update process including update of the check data block by the check increment and update of the version information
  • the second update response carrying the update failure Result and reason values (here similar to data node update failures).
  • the method of the embodiment of the present disclosure further includes: Step S2121, the verification node responds to the second update request, and acquires fourth version information, where the fourth version information is used to indicate the version information stored by itself; and in step S2122, the method is determined. Whether the second version information matches the fourth version information, the second determination result is obtained; and in step S2123, the second update request is processed according to the second determination result.
  • the obtaining the fourth version information includes: querying a version vector stored by itself, and obtaining fourth version information, where the version vector is a vector composed of current version information of m data blocks, where m is an erasure correction code group. If the second judgment result indicates a match, the process proceeds to step S213. Otherwise, the second update response is returned to the data node, where the second update response carries the update failure result and the cause value.
  • Step S213 the check node determines the updated check data P g ' according to the check increment ⁇ P g and the check data P g stored by itself, and stores the updated check data P g ';
  • Step S214 the check node updates the version vector stored by itself according to the second update request.
  • the version vector is a vector composed of version information of m data blocks, where m is the number of data blocks in an erasure correction code group;
  • the second update request may further include the identifier information of the target data block and the third version information information indicating the updated version of the target data block, where the update itself stores the version vector, including: Updating the version information of the corresponding data block in the version vector stored by itself to the third version information according to the identification information of the target data block, or according to the identification information of the target data block and the third version information. Update the version vector of your own storage.
  • Step S215 the check node updates the version vector and stores the check data P g ', and sends a second update response to the data node;
  • the second update response carries a result of successfully updating the check increment ⁇ P g .
  • Step S216 the data node receives the second update response sent by the gth check node.
  • the second update response carries a result of updating whether the check increment ⁇ P g is successful
  • Step S217 the data node determines whether all the k check data blocks all update the corresponding check increment ⁇ P g successfully;
  • Step S2128 if all the k check data blocks all update the corresponding check increment ⁇ P g successfully, and the update of the target data block is completed, the data node sends a first update response to the client.
  • Step S219 The client receives a first update response sent by the data node, where the first update response carries an update result.
  • Step S220 If the update result indicates that the update is successful, the client updates the first version information.
  • the technical solution in the embodiment of the present disclosure adds version information, and the added version information has the following characteristics:
  • the data node maintains an auto-increment version information (version number) for each original data block.
  • version number may be represented by an integer, for example, the version number is initially 0, and each write is incremented by 1;
  • the version number can also be represented by an integer, for example, the previous version number is 1.1a version, and the next version number is 1.1b; in addition, the version information of the data block is persistently saved;
  • the check node maintains the version number of all m original data blocks for the check block stored by itself, that is, the check node actually maintains a version vector, and the version vector is composed of version information of m data blocks.
  • Vector the m is the number of data blocks in an erasure code group.
  • the version number can be represented by an integer.
  • the version number is initially 0, and each write is incremented by 1.
  • the version number can also be represented by an integer, for example, the previous version number is 1.1a.
  • the next version number is 1.1b; in addition, the version information of the data block is persisted and saved.
  • the client itself can maintain the version information of the data block.
  • the version number of all m original data blocks can also be obtained from the data node query.
  • the data node after checking the version number in the update request, calculates ⁇ p 1 , ⁇ p 2 , . . . , ⁇ p k according to the existing method, and sends them to the k check nodes respectively, and simultaneously informs the check node itself.
  • the check node updates its own check data p according to the existing method, and increases the version number of the related data block (i-th block) maintained by itself by one, and finally returns to the data node.
  • the update success signal is verified; then, after the data node updates the k check blocks respectively, the update success signal is returned to the client; finally, the client increases the version number of the data block maintained by itself by one.
  • each check data block corresponds to a vector consisting of m data block version information, and the version vectors corresponding to each check data block are the same.
  • the version vector Q [q1,q2,q3,q4,q5], where q1 represents an EC group
  • the version information of the first data block in the middle q2 represents the version information of the second data block in the same EC group as q1
  • q3 represents the version information of the third data block in the same EC group as q1
  • q4 represents and q1 Version information of the fourth data block in the same EC group
  • q5 represents the version information of the fifth data block in the same EC group as q1.
  • the client sends a first update request to the corresponding data node of the second data block, and the first update request carries the second data.
  • the version information of the block, and then the corresponding data node of the second data block performs step S205 to step S210.
  • k 3, that is, if there are 3 check nodes, when the second data block is updated in the corresponding data node, the corresponding data node of the second data block will send the first check node to the three check nodes.
  • the second update request carries the version information of the second data block, and then each of the three check nodes performs step S212, step S2121, and step S2122; if the three check nodes are Each check node determines that the version information of the second data block in the second update request matches the version information of the second data block stored by itself, and then the three check nodes update the second data block.
  • Check data, and the three check nodes send the update update second update response to the data node corresponding to the second data block; the data node corresponding to the second data block determines that all three check nodes are successfully updated. After that, the request for updating the version vector may also be sent to the three check nodes.
  • the three check nodes respond to the request for updating the version vector, and update the version information of the second data block, that is, update the three checksums.
  • Vector points. If q1, q2, q3, q4, and q5 are integers, the updated version vector Q [q1, (q2+1), q3, q4, q5] of each of the three check nodes.
  • the update manner of the version vector provided in this embodiment is actually a passive manner, that is, the corresponding data node of the second data block notifies all check nodes to update the version vector (ie, update the version of the second data block).
  • the method provided by the foregoing embodiment shown in FIG. 2 is a manner in which the check node is active (see step S214), and the step S214 can update the version vector by itself without the notification of the data node.
  • the update operation on different data blocks can be performed in parallel, wherein the update operation can be regarded as a write operation; the update operation on the same data block cannot be performed in parallel, but can be performed in a pipeline manner, that is, the subsequent update operation does not have to wait for the previous one.
  • the update operation is complete and can be sent to the server.
  • the system needs to suspend the update operation of the EC group, and then determines the repair action according to the version number of each original data block and the version number vector of the check block, and the block data with the largest version number is the latest.
  • an embodiment of the present disclosure provides an erasure code distributed storage system, where the system includes a client, a data node, and a check node, where the client includes a first partial write device based on the erasure code
  • the data node includes a second part-writing device based on the erasure code (referred to as a second device)
  • the check node includes a third part-writing device based on the erasure code (referred to as a third device).
  • Each unit included in the first device may be implemented by a processor in an electronic device, and each unit included in the second device and each module included in each unit may be implemented by a processor in a data node.
  • Each unit included in the third device can be implemented by a processor in the check node.
  • the functions implemented by the processor may of course be implemented by specific logic circuits; in the process of the specific embodiment, the processor may be a central processing unit (CPU), a microprocessor (MPU), and a digital signal. Processor (DSP) or field programmable gate array (FPGA).
  • CPU central processing unit
  • MPU microprocessor
  • DSP digital signal. Processor
  • FPGA field programmable gate array
  • the system 30 includes the system including a client, a data node, and a check node, where the client includes the first device. 41.
  • the data node includes a second device 51, and the check node includes a third device 61, wherein:
  • the first device 41 includes a second determining unit 42, a third determining unit 43, a fourth determining unit 44, a carrying unit 45, a second receiving unit 46 and a first updating unit 47, the second device 51 comprising a first determining unit 52, a first obtaining unit 53, a first determining unit 54, a processing unit 55, a first receiving unit 56, a second determining unit 57, and a first sending unit 58, wherein the processing unit 55 includes a determining module 551, a carrying module 552, a second sending module 553, a first updating module 554 and a second updating module 555, wherein: the third device 61 comprises a third receiving unit 62, a fifth determining unit 63, a second updating unit 64 and a third transmitting unit 65, wherein :
  • the second determining unit 42 is configured to determine update data and identification information of a target data block to be updated by using the update data, where the data amount of the update data is smaller than the data amount of an erasure code group, where
  • the erasure code group includes m data blocks and k parity data blocks for recovering the data blocks, where m and k are natural numbers;
  • the third determining unit 43 is configured to determine, according to the identifier information of the target data block, identifier information of the corresponding data node;
  • the fourth determining unit 44 is configured to determine first version information indicating a current version of the target data block according to the identification information of the target data block;
  • the carrying unit 45 is configured to carry the update data and the first version information in the first update request, and send the first update request to the data node according to the identifier information of the data node;
  • the first determining unit 52 is configured to receive a first update request from a client, where the first update request carries update data and first version information, where the first version information is stored by the client Information for indicating a version of the target data block to be updated by using the update data, the data amount of the update data being smaller than the data amount of an erasure correction code group, the erasure correction code group including m data blocks and k Check data blocks, m and k are natural numbers;
  • the first obtaining unit 53 is configured to obtain, according to the first update request, second version information, where the second version information is information used by the data node to indicate a version of the target data block;
  • the first determining unit 54 is configured to determine whether the first version information and the second version information match, and obtain a first determination result
  • the determining module 551 is configured to: if the first determination result indicates that the first version information matches the second version information, determine, according to the update data and the target data block, a corresponding to the target data block a check increment of each of the k check data blocks in the erasure code group;
  • the carrying module 552 is configured to carry the check increments of each of the check data blocks in a second update request, respectively.
  • the second sending module 553 is configured to send the second update request to a check node for storing the check data block, to trigger the check node to perform the check according to the check increment
  • the check data block is updated and the version vector stored by the check node itself is updated.
  • the first update module 554 is configured to: if the first determination result indicates that the first version information matches the second version information, update the data block by using the update data;
  • the second update module 555 is configured to update the second version information after the update of the data block is completed.
  • the third receiving unit 62 is configured to receive a second update request sent by the data node, where the second update request carries a check increment;
  • the fifth determining unit 63 is configured to: according to the second update request, update the check data block stored by itself according to the check increment to obtain an updated check data block;
  • the second update unit 64 is configured to update a version vector stored by itself according to the second update request, where the version vector includes m data blocks in the erasure code group corresponding to the target data block to be updated.
  • Each of the version information, the erasure code group further includes k check data blocks for recovering the m data blocks, where m and k are natural numbers;
  • the second update request further carries identifier information of the target data block and third version information stored by the data node for indicating a current version of the target data block, the second update unit And updating, by the identifier information of the target data block, version information corresponding to the target data block in the version vector to the third version information.
  • the third sending unit 65 is configured to: after updating the version vector and after storing the check data P g ′, send a second update response to the data node, where the second update response carries Verifying the incremental update of the result of the successful verification of the data block.
  • the first receiving unit 56 is configured to receive the g-th check node to be carried in the second update response, where the second update response carries the school that indicates that the self-storage is updated by using the check increment ⁇ P g The result of checking whether the data block is successful;
  • the second determining unit 57 is configured to determine whether all of the k check data blocks are updated by the corresponding check increments successfully; if all the k check data blocks are updated, the corresponding check increments are updated. The quantity is successful, and after the update of the target data block is completed, the first sending unit is triggered to send a first update response.
  • the first sending unit 58 is configured to send a first update response to the first device, where the first update response carries an update success result, where the update success result is used to trigger the client to update the first version information.
  • the second receiving unit 46 is configured to receive a first update response sent by the data node, where the first update response carries an update result;
  • the first update unit 47 is configured to update the first version information if the update result indicates that the update is successful.
  • the processing unit includes a first transmitting module and a discarding module, wherein
  • the first sending module is configured to: if the first determining result indicates that the first version information does not match the second version information, send a first update response, where the first update response carries an update failure a result value and a cause value, the cause value being used to indicate that the update failure result is caused by a first version information error;
  • the discarding module is configured to discard the update data.
  • the above-mentioned partial erasing method based on the erasure code is implemented in the form of a software function module, and is sold or used as a separate product, it may also be stored in a machine readable. In the storage medium.
  • the technical solution of the embodiments of the present disclosure may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a machine device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • embodiments of the present disclosure further provide a machine readable storage medium stored in the machine readable storage medium
  • the machine executable instructions are used to execute the partial erasing method based on the erasure code in the embodiments of the present disclosure when executed by the processor.
  • embodiments of the present disclosure further provide a data updating device, including: a storage medium, a processor, and machine executable instructions for storing on the storage medium and executable on the processor, the processing The erasure code-based partial writing method for implementing the data node side, the check node side or the terminal side in the embodiment of the present disclosure when the machine executable instructions are executed.
  • FIG. 4 is a schematic structural diagram of a data update device according to an embodiment of the present disclosure.
  • the data update device 400 may be configured. Included are: at least one processor 401, at least one communication bus 402, a user interface 403, at least one external communication interface 404, and a storage medium 405.
  • the communication bus 502 is used to implement connection communication between these components.
  • the user interface 403 can include a display screen and a keyboard.
  • the external communication interface 404 can optionally include a standard wired interface and a wireless interface.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented in the form of hardware or in the form of hardware plus software functional units. It will be understood by those skilled in the art that all or part of the steps of implementing the above method embodiments may be performed by hardware related to the program instructions.
  • the foregoing instructions may be stored in a machine readable storage medium, and the instructions are executed when executed, including The foregoing steps of the method embodiment; and the foregoing storage medium includes: a removable storage device, a read only memory (ROM), a magnetic disk, or an optical disk, and the like, which can store program codes.
  • ROM read only memory
  • the above-described integrated unit of the present disclosure may be stored in a machine readable storage medium if it is implemented in the form of a software function module and sold or used as a stand-alone product.
  • the technical solution of the embodiments of the present disclosure may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a machine device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present disclosure.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

一种基于纠删码的部分写入方法及装置。根据所述方法,数据节点接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用被所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;所述数据节点响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述节点存储的用于表明所述目标数据块的版本的信息;所述数据节点根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理。

Description

基于纠删码的部分写入方法及装置、存储介质、设备
相关申请的交叉引用
本专利申请要求于2016年11月16日提交的、申请号为201611022236.0、发明名称为“基于纠删码的部分写入方法及装置、存储介质、设备”的中国专利申请的优先权,该申请的全文以引用的方式并入本文中。
技术领域
本公开涉及存储技术,尤其涉及一种基于纠删码的部分写入方法及装置。
背景技术
纠删码(EC,Erasure Coding)起源于通信传输领域,目前逐渐出现在大规模存储系统中,特别是分布式存储系统,用于实现数据的冗余保护。纠删码冗余保护技术解决了传统冗余保护技术不适于分布式生产存储系统的问题。纠删码是一种用于数据修复的编码技术,原始数据通常被切分为L字节大小的数据块,L为固定值,得到n块原始数据;并使用每m块原始数据通过编码计算,得到k块L字节大小校验数据(即基于m块原始数据冗余计算获得k块校验数据,校验数据又称为冗余数据),并将m块原始数据(m个数据块)和k块校验数据(k个校验块)一并存储,其中m块原始数据和k块校验数据称为一个EC组;若(m+k)个数据块当中有任意有最多k块数据出错、损坏或丢失,分布式存储系统都可以通过解码计算恢复全部原始数据(m块原始数据)。其中,m小于等于n。
写入操作或更新操作是存储系统的常用操作,写入操作的编码计算过程通常可以放在客户端完成,当然也可以放在某个节点(数据节点)上完成。写入操作包括全部写入和部分写入,其中部分写入(Partial Write):若一个写操作的写入长度不是L*m的整数倍,则该写操作称为部分写入。假设L=4KB(千字节),m=8,若一次写操作长度不为32KB的整数倍,则为部分写入,因为这种写操作需要对某个目标EC组进行部分更新,即写入的新数据不足以填充某个EC组。需要说明的是,写入操作实际上是一种更新操作。
现有的进行部分写入时,当写入流程遇到错误而终止,存储系统无法确认故障所在,无 法正确重试写入操作,也无法正确执行数据修复操作。例如,若某次更新操作成功更新原始数据块,但由于故障原因未能更新全部校验数据块,那么在随后的修复过程中,存储系统将无法确认原始数据块和校验数据块中哪些是新的哪些是旧的,也就无法进行数据修复工作。由此可见,现有技术中在进行写入时,完全没有考虑容错方面的问题。
发明内容
有鉴于此,本公开实施例为解决现有技术中存在的至少一个问题而提供一种基于纠删码的部分写入方法及装置,当写入流程遇到错误而终止,能够确认故障所在进而正确重试写入操作和正确执行数据修复操作。
本公开实施例的技术方案是这样实现的:
第一方面,本公开实施例提供一种基于纠删码的部分写入方法,包括:
数据节点接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;
所述数据节点响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
所述数据节点根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理。
第二方面,本公开实施例提供一种基于纠删码的部分写入方法,包括:
客户端确定更新数据和要利用所述更新数据进行更新的目标数据块的标识信息,所述更新数据的数据量小于一个纠删码组的数据量,其中,所述纠删码组包括一个或多个数据块以及用于对所述数据块进行恢复的校验数据块;
所述客户端根据所述目标数据块的标识信息确定对应的数据节点的标识信息;
所述客户端根据所述目标数据块的标识信息确定表示所述目标数据块的当前版本的第一版本信息;
所述客户端将所述更新数据和所述第一版本信息携带于第一更新请求中,
所述客户端根据所述数据节点的标识信息将所述第一更新请求发送给所述数据节点;
所述客户端接收所述数据节点发送的第一更新响应,其中所述第一更新响应中携带有更新结果;
如果所述更新结果表明更新成功,所述客户端对所述第一版本信息进行更新。
第三方面,本公开实施例提供一种基于纠删码的部分写入方法,包括:
校验节点接收数据节点发送的第二更新请求,所述第二更新请求中携带有校验增量;
所述校验节点响应于所述第二更新请求,根据所述校验增量对自身存储的校验数据块进行更新,得到更新后的校验数据块;
所述校验节点响应所述第二更新请求,更新自身存储的版本向量,所述版本向量包括与要进行更新的目标数据块对应的纠删码组中的m个数据块各自的版本信息,所述纠删码组还包括用于对所述m个数据块进行恢复的k个校验数据块,m、k均为自然数;
所述校验节点向所述数据节点发送第二更新响应,所述第二更新响应中携带有表示利用所述校验增量更新所述校验数据块是否成功的结果。
第四方面,本公开实施例提供一种基于纠删码的部分写入装置,其中,所述装置包括第一确定单元、第一获取单元和处理单元,其中:
所述第一确定单元,用于接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;
所述第一获取单元,用于响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
所述处理单元,用于根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理。
第五方面,本公开实施例提供一种基于纠删码的部分写入装置,其中,所述装置包括第二确定单元、第三确定单元、第四确定单元、携带单元、第二接收单元和第一更新单元,其中:
所述第二确定单元,用于确定更新数据和要利用所述更新数据进行更新的目标数据块的标识信息,所述更新数据的数据量小于一个纠删码组的数据量,其中,所述纠删码组包括一个或多个数据块以及用于对所述数据块进行恢复的校验数据块;
所述第三确定单元,用于根据所述目标数据块的标识信息确定对应的数据节点的标识信息;
所述第四确定单元,用于根据所述目标数据块的标识信息确定表示所述目标数据块的当前版本的第一版本信息;
所述携带单元,用于将所述更新数据和所述第一版本信息携带于第一更新请求中,根据所述数据节点的标识信息将所述第一更新请求发送给所述数据节点;
所述第二接收单元,用于接收所述数据节点发送的第一更新响应,其中所述第一更新响应中携带有更新结果;
所述第一更新单元,用于如果所述更新结果表明更新成功,对所述第一版本信息进行更新。
第六方面,本公开实施例提供一种基于纠删码的部分写入装置,其中,所述装置包括第三接收单元、第五确定单元、第二更新单元和第三发送单元,其中:
所述第三接收单元,用于接收数据节点发送的第二更新请求,所述第二更新请求中携带有校验增量;
所述第五确定单元,用于响应于所述第二更新请求,根据所述校验增量对自身存储的校验数据块进行更新,得到更新后的校验数据块;
所述第二更新单元,用于响应所述第二更新请求,更新自身存储的版本向量,所述版本向量包括与要进行更新的目标数据块对应的纠删码组中的m个数据块各自的版本信息,所述纠删码组还包括用于对所述m个数据块进行恢复的k个校验数据块,m、k均为自然数;
所述第三发送单元,用于向所述数据节点发送第二更新响应,所述第二更新响应中携带有表示利用所述校验增量更新所述校验数据块是否成功的结果。
第七方面,本公开实施例提供一种机器可读存储介质,所述机器可读存储介质中存储有机器可执行指令,其中,所述机器可执行指令被处理器执行时用于执行上述的基于纠删码的部分写入方法。
第八方面,本公开实施例提供一种数据更新设备,包括:存储介质、处理器和用于存储在所述存储介质上并可在所述处理器上运行的机器可执行指令,其中,所述处理器执行所述机器可执行指令时用于实现上述的基于纠删码的部分写入方法。
根据本公开实施例的技术方案,可以接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息用于表明客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本信息,所述更新数据的数据量小于一个纠删码组的数据量;响应所述第一更新请求,获取第二版本信息,所述第二版本信息为数据节点存储的用于表明所述目标数据块的版本的信息;根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理;如此,当写入流程遇到错误而终止,能够确认故障所在进而正确重试写入操作和正确执行数据修复操作。
附图说明
图1A为本公开实施例所涉及的纠删码分布式存储系统的网络架构示意图;
图1B为本公开实施例一基于纠删码的部分写入方法的实现流程示意图;
图2为本公开实施例二基于纠删码的部分写入方法的实现流程示意图;
图3为本公开实施例三纠删码分布式存储系统的组成结构示意图;
图4为本公开实施例计算设备的组成结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了更好的理解本公开的各实施例,先介绍一下相关技术中的纠删码的编解码算法,纠删码的编解码算法包括以下步骤:
(1)根据m和k,生成编码系数矩阵A=[aij]k×m
这里,在实际的操作过程中,除了根据数量m和k,还可以有其他的考量因素,生成编码系数矩阵A=[aij]k×m,其中编码系数矩阵的行数为k行,列数为m列;aij表示第i行第j列的元素,i为大于等于1小于等于k的整数,j为大于等于1小于等于m的整数;
(2)令原m块原始数据为di,其中i=1..m,第i个原始数据块中的第j个字节表示为dij,其中j=1..L;
(3)令原k块校验数据为pi,i=1..k,第i块校验数据中的第j个字节表示为pij,j=1..L;
(4)编码时的公式参见公式(1):
(p1j p2j … pkj)T<==A*(d1j d2j … dmj)T          (1);
公式(1)中,j=1..L,其中<==表示赋值;
(5)解码时:如果数据有丢失,则从编码矩阵A中减去丢失数据块和丢失编码块对应的行,得到用于解码的矩阵B。将已知原始数据和必要校验数据带入等式(1),然后用求解线性方程组的算法解出未知原始数据。例如,将矩阵A换成矩阵B,在等式(1)的两边同时 乘以矩阵B的逆矩阵B’,可以求解出原始数据。这里的编解码方式仅是为了说明纠删码的编解码算法给出的示例,本公开的技术方案可使用的编解码方式不限于此。
上述所有计算过程中涉及的加、减、乘、除等运算均定义在伽罗华域GF(28),而不是实数域。需要说明的是,在实施的过程中,上述的纠删码的编解码算法还可以有其他的形式,本领域的技术人员当然可以采用其他的形式才实现,这里不做限定。
在分布式存储系统中,为了提高数据可靠性,每个EC组中的(m+k)个数据块会存储到(m+k)个不同的服务器中,每一个服务器被称为一个节点,其中用于存储数据块(例如原始数据块)的服务器可以被称为数据节点,而用于存储校验数据块的服务器可以被称为校验节点。
下面介绍一下更新操作与原始数据和更新数据间差值的关系,将编码运算过程的公式(1):(p1j p2j … pkj)T<==A*(d1j d2j … dmj)T,(j=1..L)展开可得:
p1j=(a11 a12 .. a1m)·(d1j d2j … dmj)=∑a1i·dij(i=1..m)
p2j=∑a2i·dij(i=1..m)
pkj=∑aki·dij(i=1..m)
若更新操作将(d1j d2j … dmj)中的第i个数据更新为dij’,那么:
p1j’=(a11 a12 .. a1m)·(d1j d2j … dij … dmj)
p1j’=∑a1i·dij–a1i·dij+a1i·dij
p1j’=p1j–a1i·Δdij
p2j’=p2j–a2i·Δdij
pkj’=pkj–aki·Δdij
即Δpxj=axi·Δdij,x=1..k;
这里,Δpxj即为校验增量,表示校验数据块的更新量。所以,校验块的更新可以只依赖被修改数据的变化量Δdij。上述的结论Δpxj=axi·Δdij可以简写为Δp=a·Δd,并记为公式(2)。
根据公式(2),相关技术中的更新操作或写入操作一般包括如下的步骤:
1)待更新的数据节点接收客户端发出的对数据块中数据d0的更新请求,所述更新请求用 于将数据块中数据d0更新为d0’;其中,所述更新请求中携带有更新数据d0’。
2)所述待更新的数据节点从本地磁盘读取数据d0到内存中;
3)利用等式Δp=a·Δd在所述待更新的数据节点的内存中计算出所有k个校验节点需要的校验增量的集合{ΔP1,ΔP2,...,ΔPk};
4)所述待更新的数据节点将所述更新数据d0’写入本地磁盘;
5)所述待更新的数据节点将k个校验增量分别通过网络并行发送至k个校验节点上;
6)每个校验节点从本地磁盘读取原始的校验数据p,并利用接收到的临时数据块、即校验增量Δp以及等式p’=p+Δp计算出新的校验数据块p’;并将更新后的校验数据块p’写入本地磁盘上,并向所述待更新的数据节点发送更新完毕的信号;
7)所述待更新数据节点接收完所有冗余节点(校验节点)发送的更新完毕的信号后,向纠删码集群存储系统或客户端发送更新完毕的信号。
从上述可以看出,当写入流程遇到错误而终止,系统无法确认故障所在,无法正确重试写入操作,也无法正确执行数据修复操作。例如,若某次更新操作成功更新原始数据块,但由于故障原因未能更新全部校验数据块,那么在随后的修复过程中,系统将无法确认原始数据块和校验数据块中哪些是新的哪些是旧的,也就无法进行数据修复工作。
下面结合附图和具体实施例对本公开的技术方案进一步详细阐述。
为了解决前述的技术问题,本公开实施例提供一种基于纠删码的部分写入方法,该方法应用于纠删码分布式存储系统,如图1A所示,该纠删码分布式存储系统针对于一个EC组来说,至少包括一个客户端11、m个数据节点121至12m和k个校验节点131至13k,m和k均为大于1的自然数。在实施的过程中,客户端可安装在电子设备上,数据节点和校验节点都可以利用服务器来实现,所述服务器和电子设备可以采用各种具有信息处理能力的计算设备来实现,例如电子设备可以为智能手机、笔记本电脑、台式计算机、个人数字助理、智能电视等,另外服务器还可以采用服务器集群来实现。
图1B为本公开实施例一基于纠删码的部分写入方法的实现流程示意图,该方法包括:
步骤S101,数据节点接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;
步骤S102,数据节点响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
这里,数据节点可以自身维护关于数据块的版本信息,因此,数据节点获取第二版本信息可以是从自身获取的。
步骤S103,数据节点根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理;
其中,该步骤S103可包括如下处理。
首先,数据节点可判断所述第一版本信息与第二版本信息是否匹配,得到第一判断结果。
这里,判断第一版本信息与第二版本信息是否匹配可以包括:判断第一版本信息与第二版本信息是否相同,如果相同,则第一版本信息与第二版本信息匹配,如果不相同,则第一版本信息与第二版本信息不匹配。一般来说,第二版本信息是最新的版本信息,如果第二版本信息高于第一版本信息,则说明客户端在哪次忘记更新自身的版本信息了,如果第二版本信息低于第一版本信息,则说明在某一次数据节点没有更新完成而客户端却以为更新完成了,因而客户端更新了自身的版本信息,无论是第二版本信息高于或低于第一版本信息,只要二者不匹配,数据节点都会向存储系统或者客户端发出报错信息(更新失败结果)。
接着,数据节点可根据所述第一判断结果对所述更新数据进行处理。
在本公开的实施例中,根据所述第一判断结果对所述更新数据进行处理,可包括:如果所述第一判断结果表明所述第一版本信息与所述第二版本信息不匹配,发送第一更新响应,所述第一更新响应中携带有更新失败结果和原因值,所述原因值用于表明所述更新失败结果是由于第一版本信息错误所导致的。
这里,所述原因值可以是数值或者代码,仅仅用于表征由于第一版本信息错误所导致的更新失败。
在这种情况下,数据节点可丢弃所述更新数据。
根据所述第一判断结果对所述更新数据进行处理,还可包括:如果所述第一判断结果表明所述第一版本信息与所述第二版本信息匹配,根据更新数据和所述目标数据块确定校验增量的集合{ΔP1,ΔP2,...,ΔPg,...,ΔPk},其中,所述校验增量表示所述校验数据块的更新量,ΔPg为第g个校验节点的校验增量,g大于等于1小于等于k。
在这种情况下,数据节点可将第g个校验节点的校验增量ΔPg携带于第二更新请求中, 将所述第二更新请求发送给第g个校验节点,所述第二更新请求用于触发所述第g个校验节点根据所述校验增量ΔPg对自身存储的校验数据块进行更新,并更新所述第g个校验节点自身存储的版本向量。
在本公开的其他实施例中,所述根据所述第一判断结果对所述更新数据进行处理,可包括:如果所述第一判断结果表明所述第一版本信息与所述第二版本信息匹配,利用所述更新数据对自身存储的所述目标数据块进行更新;对所述目标数据块更新完成后,对所述第二版本信息进行更新。
在本公开的其他实施例中,数据节点在对所述目标数据块更新完成后,向客户端发送第一更新响应,所述第一更新响应中携带有更新成功结果,所述更新成功结果用于触发客户端更新所述第一版本信息。本实施例中,由于客户端是最后更新数据块的版本信息的,只要客户端未能成功更新版本信息,那么则说明之前的更新操作或写操作并没有完全成功,因此,可以设置计时器,在规定的时间内如果未更新成功,则客户端可以重新发起更新请求。
本公开实施例中,数据节点对每个原始数据块维护一个自增版本信息(版本号),当有写入操作时,数据节点首先会判断接收到的数据的版本信息(第一版本信息)和自身存储的版本信息(第二版本信息)是否匹配,匹配时,数据节点才会利用更新请求中的数据进行更新,否则就会向客户端返回更新失败结果,从而避免当写入流程遇到错误而终止,系统无法确认故障所在进而无法正确重试写入操作以及无法正确执行数据修复操作的问题。
基于前述的实施例,本公开实施例提供一种基于纠删码的部分写入方法,图2为本公开实施例二基于纠删码的部分写入方法的实现流程示意图,如图2所示,该方法包括:
步骤S201,客户端确定更新数据和要利用所述更新数据进行更新的目标数据块的标识信息;
这里,所述更新数据的数据量小于一个纠删码组的数据量;
步骤S202,客户端根据所述目标数据块的标识信息确定对应的数据节点的标识信息;
步骤S203,客户端根据所述目标数据块的标识信息确定所述目标数据块的当前版本信息,将所述数据块的当前版本信息作为第一版本信息;
步骤S204,客户端将所述更新数据和第一版本信息携带于第一更新请求中,根据数据节点的标识信息将所述第一更新请求发送给对应的数据节点;
这里,从客户端发送的针对原始数据块的第一更新请求携带该目标数据块的版本号,以 备数据节点进行查验。
步骤S205,数据节点接收第一更新请求;
这里,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量;
步骤S206,数据节点响应所述第一更新请求,获取第二版本信息;
这里,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
步骤S207,数据节点判断所述第一版本信息与第二版本信息是否匹配,得到第一判断结果;
这里,如果所述第一判断结果表明所述第一版本信息与所述第二版本信息不匹配,数据节点发送第一更新响应并丢弃所述更新数据,所述第一更新响应中携带有更新失败结果和原因值,所述原因值用于表明所述更新失败结果是由于第一版本信息错误导致的。
步骤S208,如果所述第一判断结果表明所述第一版本信息与所述第二版本信息匹配,数据节点利用所述更新数据对所述数据块进行更新;
步骤S209,数据节点对所述数据块更新完成后,对所述第二版本信息进行更新。
步骤S210,如果所述第一判断结果表明所述第一版本信息与所述第二版本信息匹配,数据节点根据更新数据和所述目标数据块确定校验增量的集合{ΔP1,ΔP2,...,ΔPg,...,ΔPk};
这里,ΔPg为第g个校验节点的校验增量,g大于等于1小于等于k,k为与一个所述纠删码相匹配的校验数据块的数量;
步骤S211,数据节点将第g个校验节点的校验增量ΔPg携带于第二更新请求中,数据节点将所述第二更新请求发送给第g个校验节点;
这里,所述第二更新请求用于触发所述第g个校验节点根据所述校验增量ΔPg对自身存储的校验数据进行更新并更新所述第g个校验节点自身存储的版本向量。
步骤S212,校验节点接收数据节点发送的第二更新请求;
这里,所述第二更新请求中携带有校验增量ΔPg,所述第二更新请求用于根据所述校验增量ΔPg对自身存储的校验数据块进行更新并更新所述自身存储的版本向量;
这里,所述第二更新请求中还可以携带有所述数据节点存储的用于表示所述目标数据块 的更新前的版本的第二版本信息,此时校验节点与数据节点类似,校验节点也需要判断第二更新请求中携带的版本信息与自身维护的版本信息是否匹配,如果匹配则进行下面的更新流程(包括利用校验增量对校验数据块的更新和对版本信息的更新);如果不匹配,则向数据节点返回第二更新响应,所述第二更新响应中携带有更新失败结果和原因值(此处与数据节点更新失败类似)。
本公开实施例的方法还包括:步骤S2121,校验节点响应所述第二更新请求,获取第四版本信息,所述第四版本信息用于表明自身存储的版本信息;步骤S2122,判断所述第二版本信息与第四版本信息是否匹配,得到第二判断结果;步骤S2123,根据所述第二判断结果对所述第二更新请求进行处理。所述获取第四版本信息包括:查询自身存储的版本向量,得到第四版本信息,所述版本向量是由m个数据块的当前版本信息所组成的向量,所述m为一个纠删码组中数据块的数目;如果第二判断结果表明匹配,则进入步骤S213,反之,则向数据节点返回第二更新响应,所述第二更新响应中携带有更新失败结果和原因值。
步骤S213,校验节点根据所述校验增量ΔPg和自身存储的校验数据Pg,确定更新后的校验数据Pg’,存储所述更新后的校验数据Pg’;
步骤S214,校验节点响应所述第二更新请求,更新自身存储的版本向量;
这里,所述版本向量是由m个数据块的版本信息所组成的向量,所述m为一个纠删码组中数据块的数目;
这里,所述第二更新请求中还可以携带有所述目标数据块的标识信息和表示所述目标数据块更新后的版本的第三版本信息信息,所述更新自身存储的版本向量,包括:根据所述目标数据块的标识信息,将自身存储的版本向量中对应数据块的版本信息更新为所述第三版本信息,或者,根据所述目标数据块的标识信息和所述第三版本信息更新自身存储的版本向量。
步骤S215,校验节点更新所述版本向量和存储所述校验数据Pg’,向数据节点发送第二更新响应;
这里,所述第二更新响应中携带有更新所述校验增量ΔPg成功的结果。
步骤S216,数据节点接收第g个校验节点发送的第二更新响应;
这里,所述第二更新响应中携带有更新所述校验增量ΔPg是否成功的结果;
步骤S217,数据节点判断所有的k个校验数据块是否全部更新对应的所述校验增量ΔPg成功;
步骤S218,如果所有的k个校验数据块全部更新对应的所述校验增量ΔPg成功,且对所述目标数据块更新完成后,数据节点向客户端发送第一更新响应。
步骤S219,客户端接收所述数据节点发送的第一更新响应,所述第一更新响应中携带有更新结果;
步骤S220,如果所述更新结果表明更新成功,客户端对所述第一版本信息进行更新。
从以上可以看出,本公开实施例中的技术方案新增了版本信息,新增的版本信息具有以下特点:
1)数据节点对每个原始数据块维护一个自增版本信息(版本号),在实施的过程中,版本号可以采用整数来表示,例如版本号初始为0,每次写入自增1;当然版本号也可以不采用整数来表示,例如上一个版本号为1.1a版,下一个版本号为1.1b;另外,对数据块的版本信息持久化保存;
2)校验节点对自身存储的校验块维护所有m个原始数据块的版本号,即校验节点其实维护的是一个版本向量,所述版本向量是由m个数据块的版本信息所组成的向量,所述m为一个纠删码组中数据块的数目。在实施的过程中,版本号可以采用整数来表示,例如版本号初始为0,每次写入自增1;当然版本号也可以不采用整数来表示,例如上一个版本号为1.1a版,下一个版本号为1.1b;另外,对数据块的版本信息持久化保存。
3)客户端自身可以维护对数据块的版本信息,当然也可以从数据节点查询得知所有m个原始数据块的版本号。
本公开实施例中,数据节点在检查更新请求中的版本号后,按照现有方法计算Δp1,Δp2,…,Δpk,并分别发送到k个校验节点,同时告知校验节点自身的编号i(1≤i≤m)和该数据块的版本号;然后数据节点将新数据写入硬盘,并将自身版本号增加1。然后校验节点在检查更新请求中的版本号后,按照现有方法更新自身的校验数据p,并将自己维护的相关数据块(第i块)的版本号增加1,最后向数据节点返回校验更新成功信号;接着,数据节点分别更新k个校验块成功后,向客户端返回更新成功信号;最后,客户端将自身维护的该数据块的版本号增加1。
在本公开的其他实施例中,对于某一个EC组中,只有在需要更新的全部数据块都更新完后,校验节点才会相应的修改校验数据块所携带关于某一数据块的版本信息。本实施例中在每个校验数据块上都对应一个由m个数据块版本信息组成的向量,每个校验数据块对应的版本向量都相同。例如,m为5,那么版本向量Q=[q1,q2,q3,q4,q5],其中q1表示一个EC组 中第一个数据块的版本信息,q2表示与q1同一个EC组中第二个数据块的版本信息,q3表示与q1同一个EC组中第三个数据块的版本信息,q4表示与q1同一个EC组中第四个数据块的版本信息,q5表示与q1同一个EC组中第五个数据块的版本信息。假设需要部分写入,即只更新该EC组中的第二个数据块,则客户端向第二个数据块相应的数据节点发送第一更新请求,第一更新请求中携带有第二个数据块的版本信息,然后第二个数据块相应的数据节点执行步骤S205至步骤S210。进一步假设k=3,即假设有3个校验节点,当第二个数据块在相应的数据节点更新完毕后,第二个数据块相应的数据节点会向这3个校验节点都发送第二更新请求,第二更新请求中携带有第二个数据块的版本信息,然后3个校验节点中每一个校验节点执行步骤S212、步骤S2121、步骤S2122;如果这3个校验节点中的每一校验节点都判断第二更新请求中第二个数据块的版本信息与自身存储的第二个数据块的版本信息匹配的话,那么这3个校验节点都更新第二个数据块的校验数据,并且这3个校验节点都向第二个数据块对应的数据节点发送更新完成的第二更新响应;第二个数据块对应的数据节点确定3个校验节点全部更新成功后,还可以向3个校验节点发送更新版本向量的请求,然后,3个校验节点响应更新版本向量的请求,更新第二数据块的版本信息,即更新3个校验节点的向量。如果q1、q2、q3、q4、q5均为整数,那么3个校验节点中每一个校验节点更新后的版本向量Q=[q1,(q2+1),q3,q4,q5]。本实施例中提供的版本向量的更新方式实际上是一种被动的方式,即由第二个数据块相应的数据节点通知全部的校验节点更新版本向量(即更新第二个数据块的版本信息);而前述图2所示的实施例提供的方式,是一种校验节点主动的方式(参见步骤S214),步骤S214无需数据节点的通知即可自行更新版本向量。
需要说明的是,对不同数据块的更新操作可以并行执行,其中更新操作可以认为是写操作;对同一数据块的更新操作不能并行执行,但可以流水线方式执行,即后续更新操作不必等到前面的更新操作完成即可向服务器发出。当需要做数据恢复时,系统需要暂停对该EC组的更新操作,然后根据各原始数据块的版本号和校验块的版本号向量,决定修复动作,版本号最大的块数据最新。
基于前述的实施例,本公开实施例提供一种纠删码分布式存储系统,该系统包括客户端、数据节点和校验节点,其中客户端包括第一基于纠删码的部分写入装置(简称第一装置),数据节点包括第二基于纠删码的部分写入装置(简称第二装置),而校验节点包括第三基于纠删码的部分写入装置(简称第三装置),其中所述第一装置所包括的各单元都可以通过电子设备中的处理器来实现,第二装置所包括的各单元以及各单元所包括的各模块都可以通过数据节点中的处理器来实现,第三装置所包括的各单元都可以通过校验节点中的处理器来实现。
在实现的过程中,处理器所实现的功能当然也可通过具体的逻辑电路实现;在具体实施例的过程中,处理器可以为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等。
图3为本发明实施例三纠删码分布式存储系统的组成结构示意图,如图3所示,该系统30包括该系统包括客户端、数据节点和校验节点,其中客户端包括第一装置41,数据节点包括第二装置51,而校验节点包括第三装置61,其中:
第一装置41包括第二确定单元42、第三确定单元43、第四确定单元44、携带单元45、第二接收单元46和第一更新单元47,第二装置51包括第一确定单元52、第一获取单元53、第一判断单元54、处理单元55、第一接收单元56、第二判断单元57和第一发送单元58,其中,所述处理单元55包括确定模块551、携带模块552、第二发送模553、第一更新模块554和第二更新模块555,其中:第三装置61包括第三接收单元62、第五确定单元63、第二更新单元64和第三发送单元65,其中:
所述第二确定单元42,用于确定更新数据和要利用所述更新数据进行更新的目标数据块的标识信息,所述更新数据的数据量小于一个纠删码组的数据量,其中,所述纠删码组包括m个数据块以及用于对所述数据块进行恢复的k个校验数据块,m、k均为自然数;
所述第三确定单元43,用于根据所述目标数据块的标识信息确定对应的数据节点的标识信息;
所述第四确定单元44,用于根据所述目标数据块的标识信息确定表示所述目标数据块的当前版本的第一版本信息;
所述携带单元45,用于将所述更新数据和第一版本信息携带于第一更新请求中,根据所述数据节点的标识信息将所述第一更新请求发送给所述数据节点;
所述第一确定单元52,用于接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;
所述第一获取单元53,用于响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
所述第一判断单元54,用于判断所述第一版本信息与第二版本信息是否匹配,得到第一判断结果;
所述确定模块551,用于如果所述第一判断结果表明所述第一版本信息与所述第二版本信息匹配,根据更新数据和所述目标数据块,确定与所述目标数据块对应的所述纠删码组中的所述k个校验数据块各自的校验增量;
所述携带模块552,用于将各所述校验数据块的所述校验增量分别携带于第二更新请求中;
所述第二发送模块553,用于将所述第二更新请求发送给用于存储所述校验数据块的校验节点,以触发所述校验节点根据所述校验增量对所述校验数据块进行更新并更新所述校验节点自身存储的版本向量。
所述第一更新模块554,用于如果所述第一判断结果表明所述第一版本信息与所述第二版本信息匹配,利用所述更新数据对所述数据块进行更新;
所述第二更新模块555,用于对所述数据块更新完成后,对所述第二版本信息进行更新。
所述第三接收单元62,用于接收数据节点发送的第二更新请求,所述第二更新请求中携带有校验增量;
所述第五确定单元63,用于响应于所述第二更新请求,根据所述校验增量对自身存储的校验数据块进行更新,得到更新后的校验数据块;
所述第二更新单元64,用于响应所述第二更新请求,更新自身存储的版本向量,所述版本向量包括与要进行更新的目标数据块对应的纠删码组中的m个数据块各自的版本信息,所述纠删码组还包括用于对所述m个数据块进行恢复的k个校验数据块,m、k均为自然数;
这里,所述第二更新请求中还携带有所述目标数据块的标识信息和所述数据节点存储的用于表示所述目标数据块的当前版本的第三版本信息,所述第二更新单元,用于根据所述目标数据块的标识信息将所述版本向量中的对应所述目标数据块的版本信息更新为所述第三版本信息。
所述第三发送单元65,用于更新所述版本向量完成后和存储所述校验数据Pg’后,向数据节点发送第二更新响应,所述第二更新响应中携带有利用所述校验增量更新所述校验数据块成功的结果。
所述第一接收单元56,用于接收第g个校验节点携带于第二更新响应,所述第二更 新响应中携带有表示利用所述校验增量ΔPg更新自身存储的所述校验数据块是否成功的结果;
所述第二判断单元57,用于判断所有的k个校验数据块是否全部更新对应的所述校验增量成功;如果所有的k个校验数据块全部更新对应的所述校验增量成功,且对所述目标数据块更新完成后,触发所述第一发送单元发送第一更新响应。
第一发送单元58,用于向第一装置发送第一更新响应,所述第一更新响应中携带有更新成功结果,所述更新成功结果用于触发客户端更新所述第一版本信息
所述第二接收单元46,用于接收所述数据节点发送的第一更新响应,所述第一更新响应中携带有更新结果;
所述第一更新单元47,用于如果所述更新结果表明更新成功,对所述第一版本信息进行更新。
在本公开的其他实施例中,所述处理单元包括第一发送模块和丢弃模块,其中
所述第一发送模块,用于如果所述第一判断结果表明所述第一版本信息与所述第二版本信息不匹配,发送第一更新响应,所述第一更新响应中携带有更新失败结果和原因值,所述原因值用于表明所述更新失败结果是由于第一版本信息错误所导致的;
所述丢弃模块,用于丢弃所述更新数据。
这里需要指出的是:以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果,因此不做赘述。对于本发明装置实施例中未披露的技术细节,请参照本公开方法实施例的描述而理解,为节约篇幅,因此不再赘述。
需要说明的是,本公开实施例中,如果以软件功能模块的形式实现上述的基于纠删码的部分写入方法,并作为独立的产品销售或使用时,也可以存储在一个机器可读取存储介质中。基于这样的理解,本公开实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台机器设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。
相应地,本公开实施例再提供一种机器可读存储介质,所述机器可读存储介质中存储 有机器可执行指令,所述机器可执行指令被处理器执行时用于执行本公开实施例中基于纠删码的部分写入方法。
相应地,本公开实施例再提供一种数据更新设备,包括:存储介质、处理器和用于存储在所述存储介质上并可在所述处理器上运行的机器可执行指令,所述处理器执行所述机器可执行指令时用于实现本公开实施例中的数据节点侧、校验节点侧或终端侧的基于纠删码的部分写入方法。
在实现的过程中,数据节点、校验节点或终端都可以通过数据更新设备来实现,图4为本公开实施例数据更新设备的组成结构示意图,如图4所示,该数据更新设备400可以包括:至少一个处理器401、至少一个通信总线402、用户接口403、至少一个外部通信接口404和存储介质405。其中,通信总线502用于实现这些组件之间的连接通信。其中,用户接口403可以包括显示屏和键盘。外部通信接口404可选的可以包括标准的有线接口和无线接口。
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本公开的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本公开的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。另外,在本公开各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的指令可以存储于机器可读取存储介质中,该指令在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。
或者,本公开上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个机器可读取存储介质中。基于这样的理解,本公开实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台机器设备(可以是个人计算机、服务器、或者网络设备等)执行本公开各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。

Claims (15)

  1. 一种基于纠删码的部分写入方法,包括:
    数据节点接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;
    所述数据节点响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
    所述数据节点根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理。
  2. 根据权利要求1所述的方法,其中,根据所述第一版本信息与所述第二版本信息之间的匹配结果,对所述更新数据进行处理,包括:
    如果所述第一版本信息与所述第二版本信息不匹配,所述数据节点向所述客户端发送第一更新响应并丢弃所述更新数据,其中
    所述第一更新响应中携带有更新失败结果和原因值,
    所述原因值用于表明所述更新失败结果是由于所述第一版本信息错误导致的。
  3. 根据权利要求1所述的方法,其中,根据所述第一版本信息与所述第二版本信息之间的匹配结果,对所述更新数据进行处理,包括:
    如果所述第一版本信息与所述第二版本信息匹配,
    所述数据节点根据所述更新数据和所述目标数据块,确定与所述目标数据块对应的所述纠删码组中的所述k个校验数据块各自的校验增量;
    所述数据节点将各所述校验数据块的所述校验增量分别携带于第二更新请求中,
    所述数据节点将所述第二更新请求发送给用于存储所述校验数据块的校验节点,以触发所述校验节点根据所述校验增量对所述校验数据块进行更新并更新所述校验节点自身存储的版本向量。
  4. 根据权利要求1所述的方法,其中,根据所述第一版本信息与所述第二版本信息之间的匹配结果,对所述更新数据进行处理,包括:
    如果所述第一版本信息与所述第二版本信息匹配,
    所述数据节点利用所述更新数据对自身存储的所述目标数据块进行更新;
    所述数据节点在对所述目标数据块更新完成后,对所述第二版本信息进行更新。
  5. 根据权利要求4所述的方法,还包括:
    所述数据节点在对所述目标数据块更新完成后,向所述客户端发送第一更新响应,其中
    所述第一更新响应中携带有更新成功结果,
    所述更新成功结果用于触发所述客户端更新所述第一版本信息。
  6. 根据权利要求3所述的方法,还包括:
    所述数据节点接收所述校验节点发送的第二更新响应,所述第二更新响应中携带有表示利用所述校验增量对校验数据块进行更新是否成功的结果;
    如果所有的k个校验数据块全部更新对应的所述校验增量成功,且对所述目标数据块更新完成,所述数据节点向所述客户端发送第一更新响应,其中
    所述第一更新响应中携带有更新成功结果,
    所述更新成功结果用于触发所述客户端更新所述第一版本信息。
  7. 一种基于纠删码的部分写入方法,包括:
    客户端确定更新数据和要利用所述更新数据进行更新的目标数据块的标识信息,所述更新数据的数据量小于一个纠删码组的数据量,其中,所述纠删码组包括一个或多个数据块以及用于对所述数据块进行恢复的校验数据块;
    所述客户端根据所述目标数据块的标识信息确定对应的数据节点的标识信息;
    所述客户端根据所述目标数据块的标识信息确定表示所述目标数据块的当前版本的第一版本信息;
    所述客户端将所述更新数据和所述第一版本信息携带于第一更新请求中,
    所述客户端根据所述数据节点的标识信息将所述第一更新请求发送给所述数据节点;
    所述客户端接收所述数据节点发送的第一更新响应,其中所述第一更新响应中携带有更新结果;
    如果所述更新结果表明更新成功,所述客户端对所述第一版本信息进行更新。
  8. 一种基于纠删码的部分写入方法,包括:
    校验节点接收数据节点发送的第二更新请求,所述第二更新请求中携带有校验增量;
    所述校验节点响应于所述第二更新请求,根据所述校验增量对自身存储的校验数据块进行更新,得到更新后的校验数据块;
    所述校验节点响应所述第二更新请求,更新自身存储的版本向量,所述版本向量包括与要进行更新的目标数据块对应的纠删码组中的m个数据块各自的版本信息,所述纠删码组还包括用于对所述m个数据块进行恢复的k个校验数据块,m、k均为自然数;
    所述校验节点向所述数据节点发送第二更新响应,所述第二更新响应中携带有表示利用所述校验增量更新所述校验数据块是否成功的结果。
  9. 根据权利要求8所述的方法,其中,
    所述第二更新请求中还携带有所述目标数据块的标识信息和所述数据节点存储的用于表示所述目标数据块的当前版本的第三版本信息,
    更新所述版本向量,包括:
    所述校验节点根据所述目标数据块的标识信息,将所述版本向量中的对应所述目标数据块的版本信息更新为所述第三版本信息。
  10. 根据权利要求8所述的方法,其中,
    所述第二更新请求中还携带有所述数据节点存储的用于表示所述目标数据块的更新前的版本的第二版本信息,
    所述方法还包括:
    所述校验节点获取第四版本信息,所述第四版本信息为所述校验节点存储的用于表明所述校验数据块的版本的信息;
    所述校验节点根据所述第二版本信息与第四版本信息是否匹配的结果对所述第二更新请求进行处理。
  11. 一种基于纠删码的部分写入装置,其中,所述装置包括第一确定单元、第一获取单元和处理单元,其中:
    所述第一确定单元,用于接收来自客户端的第一更新请求,所述第一更新请求中携带有更新数据和第一版本信息,其中所述第一版本信息为所述客户端存储的用于表明要利用所述更新数据进行更新的目标数据块的版本的信息,所述更新数据的数据量小于一个纠删码组的数据量,所述纠删码组包括m个数据块以及k个校验数据块,m、k均为自然数;
    所述第一获取单元,用于响应所述第一更新请求,获取第二版本信息,所述第二版本信息为所述数据节点存储的用于表明所述目标数据块的版本的信息;
    所述处理单元,用于根据所述第一版本信息与第二版本信息之间的匹配结果,对所述更新数据进行处理。
  12. 一种基于纠删码的部分写入装置,其中,所述装置包括第二确定单元、第三确定单元、第四确定单元、携带单元、第二接收单元和第一更新单元,其中:
    所述第二确定单元,用于确定更新数据和要利用所述更新数据进行更新的目标数据块的标识信息,所述更新数据的数据量小于一个纠删码组的数据量,其中,所述纠删码组包括一个或多个数据块以及用于对所述数据块进行恢复的校验数据块;
    所述第三确定单元,用于根据所述目标数据块的标识信息确定对应的数据节点的标识信息;
    所述第四确定单元,用于根据所述目标数据块的标识信息确定表示所述目标数据块的当前版本的第一版本信息;
    所述携带单元,用于将所述更新数据和所述第一版本信息携带于第一更新请求中,根据所述数据节点的标识信息将所述第一更新请求发送给所述数据节点;
    所述第二接收单元,用于接收所述数据节点发送的第一更新响应,其中所述第一更新响应中携带有更新结果;
    所述第一更新单元,用于如果所述更新结果表明更新成功,对所述第一版本信息进行更新。
  13. 一种基于纠删码的部分写入装置,其中,所述装置包括第三接收单元、第五确定单元、第二更新单元和第三发送单元,其中:
    所述第三接收单元,用于接收数据节点发送的第二更新请求,所述第二更新请求中携带有校验增量;
    所述第五确定单元,用于响应于所述第二更新请求,根据所述校验增量对自身存储的校验数据块进行更新,得到更新后的校验数据块;
    所述第二更新单元,用于响应所述第二更新请求,更新自身存储的版本向量,所述版本向量包括与要进行更新的目标数据块对应的纠删码组中的m个数据块各自的版本信息,所述纠删码组还包括用于对所述m个数据块进行恢复的k个校验数据块,m、k均为自然数;
    所述第三发送单元,用于向所述数据节点发送第二更新响应,所述第二更新响应中携带有表示利用所述校验增量更新所述校验数据块是否成功的结果。
  14. 一种机器可读存储介质,所述机器可读存储介质中存储有机器可执行指令,其中,所述机器可执行指令被处理器执行时用于执行权利要求1至6任一项、或7、或8至10任一项所述的基于纠删码的部分写入方法。
  15. 一种数据更新设备,包括:存储介质、处理器和用于存储在所述存储介质上并可在所述处理器上运行的机器可执行指令,其中,所述处理器执行所述机器可执行指令时用于实现权利要求1至6任一项、或7、或8至10任一项基于纠删码的部分写入方法。
PCT/CN2017/109154 2016-11-16 2017-11-02 基于纠删码的部分写入方法及装置、存储介质、设备 Ceased WO2018090837A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/461,520 US11119849B2 (en) 2016-11-16 2017-11-02 Erasure code-based partial write-in
CA3071925A CA3071925C (en) 2016-11-16 2017-11-02 Erasure code-based partial write-in method and apparatus, storage medium and equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611022236.0A CN106708651B (zh) 2016-11-16 2016-11-16 基于纠删码的部分写入方法及装置、存储介质、设备
CN201611022236.0 2016-11-16

Publications (1)

Publication Number Publication Date
WO2018090837A1 true WO2018090837A1 (zh) 2018-05-24

Family

ID=58941056

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/109154 Ceased WO2018090837A1 (zh) 2016-11-16 2017-11-02 基于纠删码的部分写入方法及装置、存储介质、设备

Country Status (4)

Country Link
US (1) US11119849B2 (zh)
CN (1) CN106708651B (zh)
CA (1) CA3071925C (zh)
WO (1) WO2018090837A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558875A (zh) * 2020-12-14 2021-03-26 北京百度网讯科技有限公司 数据校验方法、装置、电子设备及存储介质

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708651B (zh) * 2016-11-16 2020-09-11 北京三快在线科技有限公司 基于纠删码的部分写入方法及装置、存储介质、设备
CN110874181B (zh) * 2018-08-31 2021-12-17 杭州海康威视系统技术有限公司 一种数据更新方法及更新装置
CN111176880B (zh) * 2018-11-09 2021-08-13 杭州海康威视系统技术有限公司 磁盘分配方法、装置和可读存储介质
CN109558086B (zh) * 2018-12-03 2019-10-18 浪潮电子信息产业股份有限公司 一种数据读取方法、系统及相关组件
CN110190926B (zh) * 2019-04-26 2020-09-18 华中科技大学 基于网络计算的纠删码更新方法及系统
CN112825052A (zh) * 2019-11-20 2021-05-21 华为技术有限公司 确定条带一致性的方法及装置
CN111124740A (zh) * 2019-12-11 2020-05-08 新华三大数据技术有限公司 一种数据读取方法、装置、存储设备及机器可读存储介质
CN111444042B (zh) * 2020-03-24 2023-10-27 哈尔滨工程大学 一种基于纠删码的区块链数据存储方法
CN112162699B (zh) * 2020-09-18 2023-12-22 北京浪潮数据技术有限公司 一种数据读写方法、装置、设备及计算机可读存储介质
CN112737849B (zh) * 2020-12-29 2023-02-03 青岛海尔科技有限公司 一种设备信息处理方法及装置
CN113296695A (zh) * 2021-02-08 2021-08-24 阿里巴巴集团控股有限公司 多az环境下纠删码数据的写入方法以及装置
CN113157715B (zh) * 2021-05-12 2022-06-07 厦门大学 纠删码数据中心机架协同更新方法
CN114594914B (zh) * 2022-03-17 2024-04-02 阿里巴巴(中国)有限公司 用于分布式存储系统的控制方法及系统
CN114595092B (zh) * 2022-04-28 2022-09-20 阿里云计算有限公司 分布式存储系统、数据重构方法、设备及存储介质
CN114968668B (zh) * 2022-06-17 2025-08-01 重庆紫光华山智安科技有限公司 数据处理方法、装置、数据接入端及存储介质
CN116126374A (zh) * 2022-12-16 2023-05-16 深圳市汇川技术股份有限公司 设备升级方法、装置、设备及存储介质
CN117708150A (zh) * 2023-12-14 2024-03-15 中国电信股份有限公司 纠删码数据更新方法及装置
CN118971895B (zh) * 2024-07-18 2025-11-18 中国科学技术大学 一种基于日志的高可用纠删码更新方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102696017A (zh) * 2010-02-22 2012-09-26 国际商业机器公司 用于在回写分布式冗余数据存储系统中维持奇偶校验一致性的读取其他项的协议
US20130198585A1 (en) * 2012-02-01 2013-08-01 Xyratex Technology Limited Method of, and apparatus for, improved data integrity
CN103558998A (zh) * 2013-11-07 2014-02-05 华为技术有限公司 一种数据操作的方法和设备
CN105242879A (zh) * 2015-09-30 2016-01-13 华为技术有限公司 一种数据存储方法以及协议服务器
CN106708651A (zh) * 2016-11-16 2017-05-24 北京三快在线科技有限公司 基于纠删码的部分写入方法及装置、存储介质、设备

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7401192B2 (en) * 2004-10-04 2008-07-15 International Business Machines Corporation Method of replicating a file using a base, delta, and reference file
US8479078B2 (en) * 2009-10-30 2013-07-02 Cleversafe, Inc. Distributed storage network for modification of a data object
CN102681793A (zh) * 2012-04-16 2012-09-19 华中科技大学 一种基于纠删码集群存储系统的局部式数据更新方法
CN103561057A (zh) * 2013-10-15 2014-02-05 深圳清华大学研究院 基于分布式哈希表和纠删码的数据存储方法
WO2015167603A1 (en) * 2014-04-29 2015-11-05 Hewlett-Packard Development Company, L.P. Maintaining files in a retained file system
CN104158897B (zh) 2014-08-25 2017-06-23 曙光信息产业股份有限公司 一种分布式文件系统中文件布局的更新方法
CN104407808B (zh) * 2014-10-31 2017-10-10 华为技术有限公司 写入数据的方法和装置
US10270468B2 (en) * 2014-12-19 2019-04-23 Aalborg Universitet Method for file updating and version control for linear erasure coded and network coded storage
CN105095013B (zh) * 2015-06-04 2017-11-21 华为技术有限公司 数据存储方法、恢复方法、相关装置以及系统
GB201615748D0 (en) * 2016-09-15 2016-11-02 Gb Gas Holdings Ltd System for importing data into a data repository

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102696017A (zh) * 2010-02-22 2012-09-26 国际商业机器公司 用于在回写分布式冗余数据存储系统中维持奇偶校验一致性的读取其他项的协议
US20130198585A1 (en) * 2012-02-01 2013-08-01 Xyratex Technology Limited Method of, and apparatus for, improved data integrity
CN103558998A (zh) * 2013-11-07 2014-02-05 华为技术有限公司 一种数据操作的方法和设备
CN105242879A (zh) * 2015-09-30 2016-01-13 华为技术有限公司 一种数据存储方法以及协议服务器
CN106708651A (zh) * 2016-11-16 2017-05-24 北京三快在线科技有限公司 基于纠删码的部分写入方法及装置、存储介质、设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558875A (zh) * 2020-12-14 2021-03-26 北京百度网讯科技有限公司 数据校验方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CA3071925C (en) 2023-01-03
US11119849B2 (en) 2021-09-14
US20190347160A1 (en) 2019-11-14
CN106708651B (zh) 2020-09-11
CN106708651A (zh) 2017-05-24
CA3071925A1 (en) 2018-05-24

Similar Documents

Publication Publication Date Title
WO2018090837A1 (zh) 基于纠删码的部分写入方法及装置、存储介质、设备
KR102645583B1 (ko) 예측성 메모리 유지보수
US20180232274A1 (en) Global error recovery system
TWI541820B (zh) 解碼方法、記憶體控制電路單元及記憶體儲存裝置
CN111078662B (zh) 一种区块链数据存储方法与装置
KR102714845B1 (ko) 오류 정정 디코더 및 이를 포함하는 메모리 시스템
US9189327B2 (en) Error-correcting code distribution for memory systems
CN106201338A (zh) 数据存储方法及装置
JP2011065599A (ja) メモリシステムおよびメモリシステムの制御方法
EP3852275A1 (en) Method, device and apparatus for storing data, computer readable storage medium
KR102540772B1 (ko) 에러 정정 회로 및 이의 동작 방법
CN114385409A (zh) 基于纠删码的编码方法、分布式系统、设备及存储介质
KR20200004195A (ko) 메모리 컨트롤러 및 이의 동작 방법
KR102592870B1 (ko) 에러 정정 회로 및 이의 동작 방법
JP2020046871A (ja) メモリシステム
TW202025642A (zh) 用於低密度同位檢查碼的偏移最佳化的設備及方法
CN106919474A (zh) 一种缓存数据保护方法和装置
US20160357627A1 (en) Data error correction from cached error correction information
CN116954479A (zh) 用于raid的数据访问方法、电子设备和计算机程序产品
CN110896309A (zh) Turbo乘积码的译码方法、装置、译码器及计算机存储介质
WO2016201639A1 (zh) 分布式数据存储方法、控制设备和系统
CN114721586A (zh) 用于存储管理的方法、电子设备和计算机程序产品
HK1237923A (zh) 基於糾刪碼的部分寫入方法及裝置、存儲介質、設備
HK1237923A1 (zh) 基於纠删码的部分写入方法及装置、存储介质、设备
HK1237923B (zh) 基於纠删码的部分写入方法及装置、存储介质、设备

Legal Events

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

Ref document number: 17870826

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17870826

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 3071925

Country of ref document: CA