WO2019137323A1 - 一种数据存储方法、装置及系统 - Google Patents

一种数据存储方法、装置及系统 Download PDF

Info

Publication number
WO2019137323A1
WO2019137323A1 PCT/CN2019/070582 CN2019070582W WO2019137323A1 WO 2019137323 A1 WO2019137323 A1 WO 2019137323A1 CN 2019070582 W CN2019070582 W CN 2019070582W WO 2019137323 A1 WO2019137323 A1 WO 2019137323A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage
data block
fragments
successfully
Prior art date
Application number
PCT/CN2019/070582
Other languages
English (en)
French (fr)
Inventor
董元元
赵亚飞
魏舒展
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to EP19738610.5A priority Critical patent/EP3739441A4/en
Publication of WO2019137323A1 publication Critical patent/WO2019137323A1/zh
Priority to US16/922,706 priority patent/US11210169B2/en

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/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/1068Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices in sector programmable memories, e.g. flash disk
    • 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/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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • H03M13/05Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words using block codes, i.e. a predetermined number of check bits joined to a predetermined number of information bits
    • H03M13/13Linear codes
    • H03M13/15Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes
    • H03M13/151Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes using error location or error correction polynomials
    • H03M13/154Error and erasure correction, e.g. by using the error and erasure locator or Forney polynomial

Definitions

  • the number of storage nodes successfully writing data fragments in the first set duration is greater than or equal to the set value, determining that the data block is successfully written; wherein the set value is greater than or equal to the data score
  • the number of data block fragments in the slice is less than or equal to the number of the data fragments.
  • the method may further include: performing asynchronous rewriting on the data slice that is not successfully written to the storage node.
  • the data block is sealed, the data block is marked as read-only, and the data block is reconstructed and restored by the storage management node.
  • determining that the data block is successfully written may include:
  • the method may further include:
  • the embodiment of the present application provides a data storage device, including:
  • the encoding module is adapted to perform erasure coding on the data block to obtain a corresponding plurality of data fragments
  • the processing module may be further configured to perform asynchronous rewriting of data fragments that are not successfully written to the storage node after determining that the data block is successfully written.
  • the processing module may be adapted to be unsuccessful if the number of storage nodes successfully writing data fragments within the first set duration is greater than or equal to the set value. After the data fragment written to the storage node is successfully written to the allocated backup storage node, it is determined that the data block is successfully written.
  • the apparatus may further include: a parameter determining module, configured to determine the following parameters: the number K of the data block fragments obtained by performing the erasure code encoding on any of the data blocks, and any data block to be erased and deleted.
  • the embodiment of the present application provides a data storage system, including: a storage client and at least two storage nodes; wherein the storage client is adapted to perform erasure coding on a data block to obtain a corresponding multiple Data fragmentation; writing the plurality of data fragments to the corresponding allocated storage node; if the number of storage nodes successfully writing the data fragment within the first set duration is greater than or equal to the set value, The storage client determines that the data block is successfully written; wherein the set value is greater than or equal to the number of data block fragments in the data fragment and less than or equal to the number of the data fragments.
  • the storage client may be further adapted to perform asynchronous rewriting of data fragments that are not successfully written to the storage node after determining that the data block is successfully written.
  • system may further include: a storage management node, configured to receive a storage node allocation request of the storage client, and allocate the storage data to the storage client according to the storage node allocation request Fragmented storage node.
  • a storage management node configured to receive a storage node allocation request of the storage client, and allocate the storage data to the storage client according to the storage node allocation request Fragmented storage node.
  • FIG. 6 is a schematic diagram of a computing device provided by an embodiment of the present application.
  • a computing device that performs a data storage method can include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Computer readable media includes both permanent and non-permanent, removable and non-removable storage media.
  • the storage medium can be stored by any method or technique.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, disk storage or other magnetic storage devices or any other non-transportable media that can be used to store information that can be accessed by computing devices.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • FIG. 1 is a schematic diagram of a data storage system according to an embodiment of the present application.
  • the data storage system provided by this embodiment includes: a storage client (for example, storage clients 101a, 101b, 101n) and a plurality of storage nodes (for example, storage nodes 102a, 102b, 102n).
  • the storage client connects to the storage node.
  • the first set duration may be determined according to an empirical value or a statistical value of a timeout average value written by the storage node in the corresponding scenario.
  • this application is not limited thereto.
  • the number of storage nodes successfully writing data fragments is K+N, it is determined that the data block is successfully written. Therefore, the number of nodes that tolerate failure during the writing process can be M-N. Among them, the larger the N, the higher the data reliability, the fewer the number of nodes tolerating the failure during the writing process; the smaller the N, the lower the data reliability, and the more nodes that tolerate the failure during the writing process.
  • the storage client may be further adapted to perform asynchronous rewriting of data fragments that were not successfully written to the storage node after determining that the data block write was successful.
  • the data block is sealed, the data block is marked as read-only, and the data block is reconstructed and restored by the storage management node.
  • the Seal operation may include: persisting a read-only flag of the data block to the storage management node, such that the data block is marked as read-only, and subsequent updates to the data block are not allowed.
  • the storage client may be further configured to perform a Seal operation on the data block if the number of storage nodes successfully writing data fragments within the first set duration is less than a set value, and mark the data block as Read-only; allocating a new data block, and determining a corresponding plurality of data fragments obtained by performing EC coding on the new data block; wherein the data content carried by the new data block and the data block marked as read-only The data content carried is the same; the data fragments corresponding to the new data block are respectively written into the reallocated storage node.
  • the storage management node may be requested to reallocate the storage node, and then the storage client reassigns the new data block to the newly allocated storage node.
  • FIG. 2 is a first schematic diagram of an execution flow of a data storage system according to an embodiment of the present application.
  • This example uses the process of writing a data block in a write-through EC scenario as an example.
  • the EC uses the Reed-Solomon algorithm, and the coding parameter is (K, M) as an example.
  • the storage client is configured with a reliability parameter N in the data writing process for determining that in the process of writing the data block, in the case of determining that the writing is successful without losing data, the maximum Can tolerate the number of storage nodes.
  • this example includes the following process:
  • the storage client determines a data block to be written for the first time; for example, the storage client determines a user request to be written.
  • the storage client requests the storage management node to allocate a storage node.
  • the storage client performs EC coding on the data block to obtain corresponding K+M data fragments; and writes the data fragments into corresponding allocated storage nodes; wherein, one storage node writes one data fragment correspondingly. .
  • K data block fragments and M parity fragments can be obtained, wherein K data block fragments are segmented by the data block, and M parity fragments are redundant.
  • the remainder algorithm performs check coding on K data block fragments.
  • the storage client if the storage client is within the first set duration of the writing process, it is determined that the number of storage nodes that successfully write the data fragment is equal to K+M, that is, the data fragments corresponding to the data block are all written. If the entry is successful, the storage client confirms that the data is written, and the write success can be returned to the user. If the storage client determines that the number of storage nodes successfully writing data fragments is less than K+M and greater than or equal to K+N within the first set duration of the writing process, S205 may be performed. If the storage client determines that the number of storage nodes successfully writing data fragments is less than K+N within the first set duration of the writing process, S206 may be performed.
  • the storage client determines whether the retry write performed within a certain length of time is successful. If the retry is successful, it confirms that the data write is completed, that is, the successfully written storage node is restored to K+M; if the retry fails, Then, S208 is executed, that is, the data block is subjected to a Seal operation to ensure that the data block does not have a subsequent additional update operation, and then the storage management node performs background rebuild (reconstruction) on the data block and performs data recovery. The storage management node may automatically initiate data reconstruction and then perform data recovery at the corresponding storage node.
  • the storage client determines that the data block write fails, and may return a write failure to the user.
  • the second set duration may be determined according to a maximum timeout period in which the storage client returns a result to the user.
  • the second set duration is greater than the first set duration.
  • FIG. 3 is a second exemplary flowchart of an execution process of a data storage system according to an embodiment of the present disclosure.
  • the process of writing a data block in a write-through EC scenario is taken as an example.
  • the EC uses the Reed-Solomon algorithm, and the coding parameter is (K, M) as an example.
  • the storage client is configured with a reliability parameter N in the data writing process and a number P of backup storage nodes; wherein N is used to determine the write confirmation in the data block writing process. In the case of success without losing data, the maximum number of storage nodes can be tolerated.
  • the storage client determines a data block to be written for the first time; for example, the storage client determines a user request to be written.
  • the storage client requests the storage management node to allocate a storage node.
  • the storage client performs EC coding on the data block to obtain corresponding K+M data fragments, and writes the data fragments into the corresponding allocated storage nodes, where one storage node writes one data fragment correspondingly. .
  • the storage client if the storage client is within the first set duration of the writing process, it is determined that the number of storage nodes that successfully write the data fragment is equal to K+M, that is, the data fragments corresponding to the data block are all written. If the entry is successful, the storage client confirms that the data is written, and the write success can be returned to the user. If the storage client determines that the number of storage nodes successfully writing data fragments is less than K+M and greater than or equal to K+N within the first set duration of the writing process, S305 may be performed. If the storage client determines that the number of storage nodes successfully writing data fragments is less than K+N within the first set duration of the writing process, S306 may be performed.
  • the storage client determines that the number of storage nodes that successfully write the data fragment is less than K+M and greater than or equal to K+N, that is, in the first setting.
  • the storage client writes the unsuccessfully written data fragments to the additionally allocated P backup storage nodes, and persistently records the above in the storage management node.
  • the metadata of the storage relationship after successfully writing to the P backup storage nodes, the storage client determines that the data block is successfully written, and can return the write success to the user.
  • P can be set to 3.
  • data fragments that are not successfully written can be written in three copies and stored in three storage nodes.
  • data fragments that are not successfully written can be sequentially written to three backup storage nodes.
  • this application is not limited thereto.
  • FIG. 4 is a flowchart of a data storage method according to an embodiment of the present application. As shown in FIG. 4, the data storage method provided in this embodiment includes:
  • the data storage method of the embodiment may further include asynchronous rewriting for data fragments that are not successfully written to the storage node.
  • asynchronous rewriting of data fragments that are not successfully written to the storage node may include:
  • the data storage method of this embodiment may further include:
  • the data storage method of this embodiment may further include: determining, if the number of storage nodes successfully writing data fragments within the second set duration is less than a set value, determining the data block The write fails; wherein the second set duration is greater than the first set duration.
  • S403 may include:
  • the data storage method of the embodiment may further include: determining the following parameters: the number K of the data block fragments obtained by the erasure code coding of any data block, any data block The number M of the verification fragments obtained by the erasure code coding, and the reliability parameter N during the writing process of any data block; wherein K and M are positive integers, and N is greater than or equal to 0 and less than or equal to An integer of M.
  • the encoding parameter can be (K, M).
  • M determines that the complete data block can tolerate the number of storage nodes without losing data.
  • N determines that in the process of writing any data block, in the case of determining that the writing is successful without losing data, the maximum number of storage nodes can be tolerated; wherein the value of N is greater than or equal to 0 and less than Or an integer equal to M. That is, the above set value can be K+N.
  • the foregoing parameters may further include: the number of backup storage nodes.
  • FIG. 5 is a schematic diagram of a data storage device according to an embodiment of the present application. As shown in FIG. 5, the data storage device provided in this embodiment includes:
  • the encoding module 501 is adapted to perform EC encoding on the data block to obtain a corresponding plurality of data fragments
  • the writing module 502 is adapted to respectively write a plurality of data fragments into the corresponding allocated storage nodes
  • the processing module 503 is configured to determine that the data block is successfully written if the number of storage nodes successfully writing data fragments within the first set duration is greater than or equal to the set value; wherein the set value is greater than or equal to the data The number of data block fragments in the fragment is less than or equal to the number of data fragments.
  • the processing module 503 may be further adapted to perform asynchronous rewriting of data fragments that are not successfully written to the storage node after determining that the data block is successfully written.
  • the processing module 503 is further adapted to perform a sealing operation on the data block if the number of storage nodes successfully writing data fragments within the first set duration is less than a set value.
  • the block is marked as read-only; a new data block is allocated, and a corresponding plurality of data fragments obtained by EC encoding the new data block are determined; wherein the data content carried by the new data block and the data marked as read-only The data content carried by the block is the same; and the data fragments corresponding to the new data block are respectively written into the reallocated storage node.
  • the data storage apparatus of this embodiment may further include: a parameter determining module, configured to determine the following parameters: the number K of the data block fragments obtained by the erasure code encoding by any data block, and any data block is performed.
  • FIG. 6 is a schematic diagram of a computing device provided by an embodiment of the present application.
  • the computing device 600 provided in this embodiment includes: a memory 601 and a processor 602.
  • the memory 601 is adapted to store a data storage program.
  • the data storage program is executed by the processor 602, the corresponding embodiment of FIG. 4 is implemented. The steps of the data storage method.
  • the embodiment of the present application further provides a computer readable medium storing a data storage program, where the data storage program is executed by a processor to implement the steps of the data storage method.
  • computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer.
  • communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Algebra (AREA)
  • Pure & Applied Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

本申请公开了一种数据存储方法、装置及系统;上述数据存储方法,包括:对数据块进行纠删码编码,得到对应的多个数据分片;将多个数据分片分别写入对应分配的存储节点;若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定该数据块写入成功;其中,设定值大于或等于数据分片中的数据块分片的个数且小于或等于数据分片的个数。如此,能够降低数据写入延迟,并提高存储节点存在故障时的性能稳定性。

Description

一种数据存储方法、装置及系统
本申请要求2018年01月09日递交的申请号为201810020376.7、发明名称为“一种数据存储方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及但不限于数据存储技术领域,尤其涉及一种数据存储方法、装置及系统。
背景技术
目前的分布式存储系统越来越多地采用纠删码(EC,Erasure Coding)技术对数据进行存储。以Reed-Solomon(RS,理德-所罗门)类EC为例,其技术原理是:将数据分割成K个数据块,采用冗余算法对K个数据块进行校验编码,生成M个校验块;其中,当K+M个块中小于或等于M个块丢失时,均可以还原丢失的块中的数据。为了保证存储的可靠性,分布式存储系统会将K+M个块交给K+M个存储节点进行存储。这样,即使某个节点出现故障,也能够根据其他节点中存储的数据进行数据恢复。
目前的分布式存储系统中EC实现方式主要包括:先将数据写成三个副本,然后在后台根据设定策略将三个副本转存成EC编码数据。然而,此种方式存在流量放大的问题。因此,针对某些情况下(比如,写入数据大于或等于128KB时),可以直接进行EC编码,不再先写成三个副本,从而避免流量放大。然而,在上述直写(Direct)EC场景下,若写入过程中涉及的部分存储节点出现异常,导致不能保证所有存储节点均写入成功的情况下,则会一直重试写入直到超时或写入失败,对超时或写入失败的存储节点进行数据重建,重建完成后,再继续写入;如此,会产生比较大的写入延迟和写入失败率,从而导致直写EC延迟波动较大,性能不稳定。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本申请实施例提供一种数据存储方法、装置及系统,能够降低数据写入延迟,并提高存储节点存在故障时的性能稳定性。
第一方面,本申请实施例提供一种数据存储方法,包括:
对数据块进行纠删码编码,得到对应的多个数据分片;
将所述多个数据分片分别写入对应分配的存储节点;
若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定所述数据块写入成功;其中,所述设定值大于或等于所述数据分片中的数据块分片的个数且小于或等于所述数据分片的个数。
在示例性实施方式中,所述确定所述数据块写入成功之后,上述方法还可以包括:对于未成功写入存储节点的数据分片进行异步重新写入。
在示例性实施方式中,所述对于未成功写入存储节点的数据分片进行异步重新写入,可以包括:
向未成功写入数据分片的存储节点,重新写入所述数据分片;
若重新写入成功,则更新成功写入数据分片的存储节点的个数;
若重新写入失败,则对所述数据块进行密封操作,将所述数据块标记为只读,并通过存储管理节点对所述数据块进行数据重建和恢复。
在示例性实施方式中,所述将所述多个数据分片分别写入对应分配的存储节点之后,上述方法还可以包括:
若所述第一设定时长内成功写入数据分片的存储节点的个数小于所述设定值,则对所述数据块进行密封操作,将所述数据块标记为只读;
分配新的数据块,并确定所述新的数据块进行纠删码编码后得到的对应的多个数据分片;其中,所述新的数据块携带的数据内容与标记为只读的所述数据块携带的数据内容相同;
将所述新的数据块对应的数据分片分别写入重新分配的存储节点。
在示例性实施方式中,所述将所述多个数据分片分别写入对应分配的存储节点之后,上述方法还可以包括:
若第二设定时长内成功写入数据分片的存储节点的个数小于所述设定值,则确定所述数据块写入失败;其中,所述第二设定时长大于所述第一设定时长。
在示例性实施方式中,所述若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定所述数据块写入成功,可以包括:
若所述第一设定时长内成功写入数据分片的存储节点的个数大于或等于所述设定值,则在将未成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定所述数据块写入成功。
在示例性实施方式中,所述对数据块进行纠删码编码,得到对应的多个数据分片之 前,上述方法还可以包括:
确定以下参数:任一数据块进行纠删码编码得到的数据块分片的个数K、任一数据块进行纠删码编码得到的校验分片的个数M、在任一数据块写入过程中的可靠性参数N;其中,K、M均为正整数,N为大于或等于0且小于或等于M的整数。
在示例性实施方式中,所述参数还可以包括:备份存储节点的个数。
第二方面,本申请实施例提供一种数据存储装置,包括:
编码模块,适于对数据块进行纠删码编码,得到对应的多个数据分片;
写入模块,适于将所述多个数据分片分别写入对应分配的存储节点;
处理模块,适于若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定所述数据块写入成功;其中,所述设定值大于或等于所述数据分片中的数据块分片的个数且小于或等于所述数据分片的个数。
在示例性实施方式中,所述处理模块,还可以适于在确定所述数据块写入成功之后,对于未成功写入存储节点的数据分片进行异步重新写入。
在示例性实施方式中,所述处理模块,还可以适于若所述第一设定时长内成功写入数据分片的存储节点的个数小于所述设定值,则对所述数据块进行密封操作,将所述数据块标记为只读;分配新的数据块,并确定所述新的数据块进行纠删码编码后得到的对应的多个数据分片;其中,所述新的数据块携带的数据内容与标记为只读的所述数据块携带的数据内容相同;以及将所述新的数据块对应的数据分片分别写入重新分配的存储节点。
在示例性实施方式中,所述处理模块,可以适于若所述第一设定时长内成功写入数据分片的存储节点的个数大于或等于所述设定值,则在将未成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定所述数据块写入成功。
在示例性实施方式中,上述装置还可以包括:参数确定模块,适于确定以下参数:任一数据块进行纠删码编码得到的数据块分片的个数K、任一数据块进行纠删码编码得到的校验分片的个数M、在任一数据块写入过程中的可靠性参数N;其中,K、M均为正整数,N为大于或等于0且小于或等于M的整数。
第三方面,本申请实施例提供一种数据存储系统,包括:存储客户端以及至少两个存储节点;其中,所述存储客户端适于对数据块进行纠删码编码,得到对应的多个数据分片;将所述多个数据分片分别写入对应分配的存储节点;若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则所述存储客户端确定所述数据块写入 成功;其中,所述设定值大于或等于所述数据分片中的数据块分片的个数且小于或等于所述数据分片的个数。
在示例性实施方式中,所述存储客户端,还可以适于在确定所述数据块写入成功之后,对于未成功写入存储节点的数据分片进行异步重新写入。
在示例性实施方式中,上述系统还可以包括:存储管理节点,适于接收所述存储客户端的存储节点分配请求,并根据所述存储节点分配请求,给所述存储客户端分配存储所述数据分片的存储节点。
此外,本申请实施例还提供一种计算设备,包括存储器以及处理器,所述存储器适于存储数据存储程序,所述数据存储程序被所述处理器执行时实现上述第一方面提供的数据存储方法的步骤。
此外,本申请实施例还提供一种计算机可读介质,存储有数据存储程序,所述数据存储程序被处理器执行时实现上述第一方面提供的数据存储方法的步骤。
在本申请实施例中,对数据块进行EC编码,得到对应的多个数据分片;将多个数据分片分别写入对应分配的存储节点;若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定该数据块写入成功;其中,设定值大于或等于数据分片中的数据块分片的个数且小于或等于数据分片的个数。本申请实施例中,在数据块写入过程中能够容忍部分存储节点出现故障,即使部分存储节点出现故障,仍可以确定数据块写入成功;如此,实现降低数据写入延迟,提高存储节点存在故障时的性能稳定性。
当然,实施本申请的任一产品并不一定需要同时达到以上所有优点。
附图说明
图1为本申请实施例提供的数据存储系统的示意图;
图2为本申请实施例提供的数据存储系统的执行流程示例图一;
图3为本申请实施例提供的数据存储系统的执行流程示例图二;
图4为本申请实施例提供的数据存储方法的流程图;
图5为本申请实施例提供的数据存储装置的示意图;
图6为本申请实施例提供的计算设备的示意图。
具体实施方式
以下结合附图对本申请实施例进行详细说明,应当理解,以下所说明的实施例仅用 于说明和解释本申请,并不用于限定本申请。
需要说明的是,如果不冲突,本申请实施例以及实施例中的各个特征可以相互结合,均在本申请的保护范围之内。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
一些实施方式中,执行数据存储方法的计算设备可包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存(memory)。
内存可能包括计算机可读介质中的非永久性存储器、随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。内存可能包括模块1,模块2,……,模块N(N为大于2的整数)。
计算机可读介质包括永久性和非永久性、可移动和非可移动存储介质。存储介质可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM),快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例提供一种数据存储方法、装置及系统,能够降低数据写入延迟,提高存储节点存在故障时的性能稳定性。特别地,在直写EC场景下,在部分存储节点出现异常,导致不能保证所有存储节点均写入成功的情况下,能够返回写入成功,从而降低直写EC处理延迟,并提高性能稳定性。
图1为本申请实施例提供的数据存储系统的示意图。如图1所示,本实施例提供的数据存储系统,包括:存储客户端(比如,存储客户端101a、101b、101n)以及多个存储节点(比如,存储节点102a、102b、102n)。存储客户端连接存储节点。
本实施例提供的数据存储系统可以为分布式存储系统。其中,存储客户端可以为部署在终端设备上的逻辑功能模块,负责确定写入存储节点的数据块,并向存储节点写入数据块,以及向用户或终端设备返回数据块是否写入成功的结果。存储节点适于存储数据块。存储节点可以是物理存储节点,也可以是物理存储节点划分的多个逻辑存储节点。然而,本申请对此并不限定。
如图1所示,本实施例提供的数据存储系统还可以包括:存储管理节点103,连接多个存储节点;存储管理节点103适于接收存储客户端的存储节点分配请求,并根据存储节点分配请求,给该存储客户端分配存储数据分片的存储节点。
本实施例中,存储客户端(比如,存储客户端101a)确定需要写入存储节点的数据块之后,向存储管理节点103发送存储节点分配请求,该存储节点分配请求中可以携带EC编码的相关参数;存储管理节点103接收该存储节点分配请求后,可以根据设定的存储节点分配策略,确定给该存储客户端分配的存储数据分片的存储节点;存储管理节点103向该存储客户端返回分配的存储节点的信息;然后,该存储客户端可以向这些存储节点写入对该数据块通过EC编码后得到的数据分片。其中,本申请对于存储节点分配策略并不限定。
本实施例中,针对一个数据块的多个数据分片,一个数据分片写入一个存储节点。因此,存储管理节点103给一个存储客户端分配的存储节点的数目可以根据数据块进行EC编码产生的数据分片的数目确定。
以EC编码采用Reed-Solomon算法为例,编码参数可以为(K,M),决定了存储成本;其中,(K+M)/K为存储效率;例如,K=8,M=4,则存储效率为1.5。其中,K表示任一数据块进行EC编码得到的数据块分片的个数;M表示任一数据块进行EC编码得到的校验分片的个数。其中,K和M均为正整数。本示例中,一个数据块进行EC编码后可以得到K个数据块分片以及M个校验分片,即一共K+M个数据分片,则存储管理节点103可以给存储客户端分配K+M个存储节点。其中,M决定了完整的数据块在不丢失数据的情况下,最大能容忍宕掉存储节点的个数;换言之,当K+M个数据分片中小于或等于M个数据分片丢失时,均可以还原丢失的数据分片中的数据。
在本实施例中,存储客户端(比如,存储客户端101a)适于对数据块进行EC编码,得到对应的多个数据分片;将多个数据分片分别写入对应分配的存储节点;若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则存储客户端确定该数据块写入成功;其中,设定值大于或等于数据分片中的数据块分片的个数且小于或等于数据分片的个数。以EC编码采用Reed-Solomon算法,编码参数为(K,M)为例,则设定值可以大于或等于K且小于或等于K+M。换言之,当部分存储节点出现故障时,存储客户端仍可以确定数据块写入成功,比如向用户或终端设备返回数据块写入成功。
其中,第一设定时长可以根据相应场景下存储节点写入数据分片的超时平均值的经验值或统计值确定。然而,本申请对此并不限定。
本实施例中,在存储客户端还可以配置在任一数据块写入过程中的可靠性参数N;N用于决定在任一数据块的写入过程中,在确定该数据块写入成功且不丢失数据的情况下,最大能容忍宕掉存储节点的个数;其中,N为大于或等于0且小于或等于M的整数。即上述的设定值可以为K+N。换言之,在任一数据块的写入过程中,当K+M个数据分片中小于或等于N个数据分片丢失时,均可以确定该数据块写入成功。
在本实施例中,针对一个数据块的K+M个数据分片的写入过程,若成功写入数据分片的存储节点的数目为K+N个,则确定该数据块写入成功。因此,在写入过程中容忍故障的节点数可以为M-N。其中,N越大,数据可靠性越高,写入过程中容忍故障的节点数越少;N越小,数据可靠性越低,写入过程中容忍故障的节点数越多。
在一种示例性实施方式中,存储客户端还可以适于在确定数据块写入成功之后,对于未成功写入存储节点的数据分片进行异步重新写入。
示例性地,存储客户端可以适于通过以下方式对于未成功写入存储节点的数据分片进行异步重新写入:
向未成功写入数据分片的存储节点,重新写入数据分片;
若重新写入成功,则更新成功写入数据分片的存储节点的个数;
若重新写入失败,则对数据块进行密封(Seal)操作,将该数据块标记为只读,并通过存储管理节点对该数据块进行数据重建和恢复。
其中,Seal操作可以包括:向存储管理节点持久化数据块的只读标记,使得该数据块标记为只读,不允许对该数据块的后续更新。
在本示例中,在部分存储节点出现异常,存储客户端仍确定数据块写入成功的情况下,对于未写入成功的数据分片进行异步写入处理,以确保数据块的完整写入。
示例性地,存储客户端还可以适于若第一设定时长内成功写入数据分片的存储节点的个数小于设定值,则对该数据块进行Seal操作,将该数据块标记为只读;分配新的数据块,并确定该新的数据块进行EC编码后得到的对应的多个数据分片;其中,该新的数据块携带的数据内容与标记为只读的该数据块携带的数据内容相同;将该新的数据块对应的数据分片分别写入重新分配的存储节点。
在本示例中,在未成功写入数据分片的存储节点的个数较多时,可以请求存储管理节点重新分配存储节点,然后,存储客户端重新分配新的数据块写入重新分配的存储节点。
示例性地,存储客户端还可以适于若第二设定时长内成功写入数据分片的存储节点 的个数小于设定值,则确定数据块写入失败,比如,向用户或终端设备返回数据块写入失败;其中,第二设定时长大于第一设定时长。
在本示例中,第二设定时长可以根据存储客户端向用户返回写入结果的最大超时时长确定。即,存储客户端在进行写入过程的时长达到第二设定时长时,若仍没有满足写入成功的条件,则返回写入失败。
在另一示例性实施方式中,存储客户端还可以适于若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则在将未成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定数据块写入成功。
在本示例中,在存储客户端还可以配置备份存储节点的个数P;其中,P为正整数。示例性地,EC编码参数为(K,M)时,存储管理节点103分配给存储客户端用于存储数据分片的存储节点的数目可以为K+M+P个。
下面参照图2和图3对数据存储系统的执行流程进行说明。
图2为本申请实施例提供的数据存储系统的执行流程示例图一。本示例以直写EC场景下写入一个数据块的过程为例进行说明。其中,以EC采用Reed-Solomon算法,编码参数为(K,M)为例进行说明。而且,在本示例中,在存储客户端配置有数据写入过程中的可靠性参数N,用于决定在数据块的写入过程中,在确定写入成功且不丢失数据的情况下,最大能容忍宕掉存储节点的个数。
如图2所示,本示例包括以下流程:
S201、存储客户端确定第一次待写入的数据块;比如,存储客户端确定待写入的用户请求。
S202、存储客户端向存储管理节点请求分配存储节点;
本步骤中,存储客户端可以向存储管理节点发送存储节点分配请求,该存储节点分配请求中可以携带编码参数(K,M);存储管理节点接收到存储节点分配请求之后,可以确定需要分配的存储节点的数目,即K+M个,然后,根据设定的存储节点分配策略,确定给该存储客户端分配哪些存储节点,并向该存储客户端返回分配的存储节点的信息;其中,存储管理节点确定分配的存储节点之后,在整个写入过程中,该存储客户端的数据块通过EC编码后得到的数据分片不再变更存储节点。
S203、存储客户端对该数据块进行EC编码,得到对应的K+M个数据分片;并将数据分片分别写入对应分配的存储节点;其中,一个存储节点对应写入一个数据分片。
本示例中,对一个数据块进行EC编码可以得到K个数据块分片以及M个校验分片, 其中,K个数据块分片由该数据块分割得到,M个校验分片通过冗余算法对K个数据块分片进行校验编码得到。
S204、存储客户端确定成功写入数据分片的存储节点的个数;
在本步骤中,存储客户端可以确定第一设定时长内数据分片对应的存储节点写入成功的个数。其中,第一设定时长可以根据直写EC场景下存储节点写入数据分片的超时平均值的经验值或统计值确定。然而,本申请对此并不限定。
在本示例中,若一个存储节点成功写入数据分片,则该存储节点会向存储客户端返回写入成功响应消息,否则,返回写入失败响应消息或不返回响应消息;存储客户端根据第一设定时长内接收到的写入成功响应消息,确定成功写入数据分片的存储节点的个数,进而根据成功写入数据分片的存储节点的个数来确定该数据块是否写入成功。
本示例中,若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数等于K+M,即该数据块对应的数据分片全部写入成功,则存储客户端确认完成数据写入,可以向用户返回写入成功。若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+M且大于或等于K+N,则可以执行S205。若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+N,则可以执行S206。
S205、若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+M且大于或等于K+N,则存储客户端确定该数据块写入成功,可以返回用户写入成功,并且对于写入超时的M-N个存储节点,进行异步后台重试写入。
S207、存储客户端会判断在一定时长内进行的重试写入是否成功;若重试成功,则确认完成数据写入,即成功写入的存储节点恢复为K+M;若重试失败,则执行S208,即对该数据块进行Seal操作,保证该数据块不会有后续的追加更新操作,然后,由存储管理节点对该数据块进行后台Rebuild(重建)并进行数据恢复。其中,存储管理节点可以自动发起数据重建,然后在相应的存储节点进行数据恢复。
其中,Seal操作过程可以为:向分布式存储的存储管理节点持久化数据块的只读标记,使得该数据块标记为只读,不允许对该数据块的后续更新。
S206、若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+N,此时说明当前分配的存储节点的故障率较高,则可以在后台对该数据块进行Seal操作,保证该数据块不会有后续的追加更新操作,然后返回S201重新执行新的数据块的写入流程,其中,重新分配的新的数据块的数据内容与标记为只读 的原数据块的数据内容一致。换言之,对未成功写入的数据内容重新执行写入过程。在重新写入过程中,存储管理节点重新分配写入数据分片的存储节点,然后,同样地根据成功写入数据分片的存储节点的个数来执行对应的操作处理。
在本示例中,若在第二设定时长内,成功写入的存储节点的个数仍小于K+N,则存储客户端确定数据块写入失败,可以向用户返回写入失败。其中,第二设定时长可以根据存储客户端向用户返回结果的最大超时时长确定。第二设定时长大于第一设定时长。
在本示例中,针对一个数据块,写入K+M个数据分片时,若K+N个存储节点成功写入数据分片,则存储客户端返回用户写入成功;由于K+N小于或等于K+M,所以写入过程中能够容忍M-N个存储节点出现故障;针对出现故障的存储节点可以通过异步方式追加数据,从而可以大幅降低写入延迟,从而保证直写EC场景下的性能稳定性。
图3为本申请实施例提供的数据存储系统的执行流程示例图二。本示例中以直写EC场景下写入一个数据块的过程为例进行说明。其中,以EC采用Reed-Solomon算法,编码参数为(K,M)为例进行说明。而且,在本示例中,在存储客户端配置有数据写入过程中的可靠性参数N以及备份存储节点的个数P;其中,N用于决定在数据块写入过程中,在确认写入成功且不丢失数据的情况下,最大能容忍宕掉存储节点的个数。
如图3所示,本示例包括以下流程:
S301、存储客户端确定第一次待写入的数据块;比如,存储客户端确定待写入的用户请求。
S302、存储客户端向存储管理节点请求分配存储节点;
本步骤中,存储客户端可以向存储管理节点发送存储节点分配请求,该存储节点分配请求中可以携带参数(K,M,P);存储管理节点接收到存储节点分配请求之后,可以确定需要分配的存储节点的数目,即K+M+P个,然后,根据设定的存储节点分配策略,确定给该存储客户端分配哪些存储节点,并向该存储客户端返回分配的存储节点的信息;其中,存储管理节点确定分配的存储节点之后,在整个写入过程中,该存储客户端的数据块通过EC编码后得到的数据分片不再变更存储节点。
S303、存储客户端对该数据块进行EC编码,得到对应的K+M个数据分片;并将数据分片分别写入对应分配的存储节点;其中,一个存储节点对应写入一个数据分片。
本示例中,对一个数据块进行EC编码可以得到K个数据块分片以及M个校验分片,其中,K个数据块分片由该数据块分割得到,M个校验分片通过冗余算法对K个数据块分片进行校验编码得到。
S304、存储客户端确定成功写入数据分片的存储节点的个数。
本示例中,若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数等于K+M,即该数据块对应的数据分片全部写入成功,则存储客户端确认完成数据写入,可以向用户返回写入成功。若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+M且大于或等于K+N,则可以执行S305。若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+N,则可以执行S306。
关于本步骤的其他说明可以参照图2中的S204的描述,故于此不再赘述。
S305、若存储客户端在写入过程中的第一设定时长内,确定成功写入数据分片的存储节点的个数小于K+M且大于或等于K+N,即在第一设定时长内存在M-N个存储节点因超时或者故障写入失败时,存储客户端将未成功写入的数据分片写入到额外分配的P个备份存储节点中,并在存储管理节点持久化记录上述存储关系的元数据;在成功写入P个备份存储节点后,则存储客户端确定该数据块写入成功,可以向用户返回写入成功。
示例性地,P可以设置为3。比如,可以将未成功写入的数据分片写成三个副本,分别存储在三个存储节点。或者,可以依次将未成功写入的数据分片写入三个备份存储节点。然而,本申请对此并不限定。
关于S306的说明可以参照图2中的S206,故于此不再赘述。
图4为本申请实施例提供的数据存储方法的流程图。如图4所示,本实施例提供的数据存储方法,包括:
S401、对数据块进行EC编码,得到对应的多个数据分片;
S402、将多个数据分片分别写入对应分配的存储节点;
S403、若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定该数据块写入成功;其中,设定值大于或等于数据分片中的数据块分片的个数且小于或等于数据分片的个数。
本实施例提供的数据存储方法可以由数据存储系统中的存储客户端执行。
在示例性实施方式中,在S403之后,本实施例的数据存储方法还可以包括:对于未成功写入存储节点的数据分片进行异步重新写入。
示例性地,对于未成功写入存储节点的数据分片进行异步重新写入,可以包括:
向未成功写入数据分片的存储节点,重新写入数据分片;
若重新写入成功,则更新成功写入数据分片的存储节点的个数;
若重新写入失败,则对该数据块进行密封(Seal)操作,将该数据块标记为只读,并通过存储管理节点对该数据块进行数据重建和恢复。
在示例性实施方式中,在S402之后,本实施例的数据存储方法还可以包括:
若第一设定时长内成功写入数据分片的存储节点的个数小于设定值,则对该数据块进行Seal操作,将该数据块标记为只读;
分配新的数据块,并确定新的数据块进行EC编码后得到的对应的多个数据分片;其中,新的数据块携带的数据内容与标记为只读的该数据块携带的数据内容相同;
将新的数据块对应的数据分片分别写入重新分配的存储节点。
在示例性实施方式中,在S402之后,本实施例的数据存储方法还可以包括:若第二设定时长内成功写入数据分片的存储节点的个数小于设定值,则确定数据块写入失败;其中,第二设定时长大于第一设定时长。
在示例性实施方式中,S403可以包括:
若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则在将未成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定数据块写入成功。
在示例性实施方式中,在S401之前,本实施例的数据存储方法还可以包括:确定以下参数:任一数据块进行纠删码编码得到的数据块分片的个数K、任一数据块进行纠删码编码得到的校验分片的个数M、在任一数据块写入过程中的可靠性参数N;其中,K、M均为正整数,N为大于或等于0且小于或等于M的整数。
以EC编码采用Reed-Solomon算法为例,编码参数可以为(K,M),M决定了完整的数据块在不丢失数据的情况下,最大能容忍宕掉存储节点的个数。N决定了在任一数据块的写入过程中,在确定写入成功且不丢失数据的情况下,最大能容忍宕掉存储节点的个数;其中,N的取值为大于或等于0且小于或等于M的整数。即上述的设定值可以为K+N。
示例性地,上述参数还可以包括:备份存储节点的个数。
关于本实施例提供的数据存储方法的相关说明可以参照上述系统实施例的描述,故于此不再赘述。
图5为本申请实施例提供的数据存储装置的示意图。如图5所示,本实施例提供的数据存储装置,包括:
编码模块501,适于对数据块进行EC编码,得到对应的多个数据分片;
写入模块502,适于将多个数据分片分别写入对应分配的存储节点;
处理模块503,适于若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定该数据块写入成功;其中,设定值大于或等于数据分片中的数据块分片的个数且小于或等于数据分片的个数。
示例性地,处理模块503,还可以适于在确定该数据块写入成功之后,对于未成功写入存储节点的数据分片进行异步重新写入。
示例性地,处理模块503,还适于若第一设定时长内成功写入数据分片的存储节点的个数小于设定值,则对该数据块进行密封(Seal)操作,将该数据块标记为只读;分配新的数据块,并确定新的数据块进行EC编码后得到的对应的多个数据分片;其中,新的数据块携带的数据内容与标记为只读的该数据块携带的数据内容相同;以及将该新的数据块对应的数据分片分别写入重新分配的存储节点。
示例性地,处理模块503,可以适于若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则在将未成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定数据块写入成功。
示例性地,本实施例的数据存储装置还可以包括:参数确定模块,适于确定以下参数:任一数据块进行纠删码编码得到的数据块分片的个数K、任一数据块进行纠删码编码得到的校验分片的个数M、在任一数据块写入过程中的可靠性参数N;其中,K、M均为正整数,N为大于或等于0且小于或等于M的整数。
关于本实施例提供的数据存储装置的相关说明可以参照上述方法及系统实施例的描述,故于此不再赘述。
图6为本申请实施例提供的计算设备的示意图。如图6所示,本实施例提供的计算设备600,包括:存储器601和处理器602,存储器601适于存储数据存储程序,该数据存储程序被处理器602执行时实现图4对应实施例提供的数据存储方法的步骤。
其中,处理器602可以包括但不限于微处理器(MCU,Microcontroller Unit)或可编程逻辑器件(FPGA,Field Programmable Gate Array)等的处理装置。存储器601可用于存储应用软件的软件程序以及模块,如本实施例中的数据存储方法对应的程序指令或模块,处理器602通过运行存储在存储器601内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的数据存储方法。存储器601可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器601可包括相对于处理器602远程设置的存储器,这 些远程存储器可以通过网络连接至上述计算设备600。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
示例性地,计算设备600还可以包括通信单元603;通信单元603可以经由一个网络接收或者发送数据。在一个实例中,通信单元603可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网络进行通信。
此外,本申请实施例还提供一种计算机可读介质,存储有数据存储程序,该数据存储程序被处理器执行时实现上述数据存储方法的步骤。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
以上显示和描述了本申请的基本原理和主要特征和本申请的优点。本申请不受上述实施例的限制,上述实施例和说明书中描述的只是说明本申请的原理,在不脱离本申请精神和范围的前提下,本申请还会有各种变化和改进,这些变化和改进都落入要求保护的本申请范围内。

Claims (18)

  1. 一种数据存储方法,其特征在于,包括:
    对数据块进行纠删码编码,得到对应的多个数据分片;
    将所述多个数据分片分别写入对应分配的存储节点;
    若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定所述数据块写入成功;其中,所述设定值大于或等于所述数据分片中的数据块分片的个数且小于或等于所述数据分片的个数。
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述数据块写入成功之后,所述方法还包括:对于未成功写入存储节点的数据分片进行异步重新写入。
  3. 根据权利要求2所述的方法,其特征在于,所述对于未成功写入存储节点的数据分片进行异步重新写入,包括:
    向未成功写入数据分片的存储节点,重新写入所述数据分片;
    若重新写入成功,则更新成功写入数据分片的存储节点的个数;
    若重新写入失败,则对所述数据块进行密封操作,将所述数据块标记为只读,并通过存储管理节点对所述数据块进行数据重建和恢复。
  4. 根据权利要求1所述的方法,其特征在于,所述将所述多个数据分片分别写入对应分配的存储节点之后,所述方法还包括:
    若所述第一设定时长内成功写入数据分片的存储节点的个数小于所述设定值,则对所述数据块进行密封操作,将所述数据块标记为只读;
    分配新的数据块,并确定所述新的数据块进行纠删码编码后得到的对应的多个数据分片;其中,所述新的数据块携带的数据内容与标记为只读的所述数据块携带的数据内容相同;
    将所述新的数据块对应的数据分片分别写入重新分配的存储节点。
  5. 根据权利要求1所述的方法,其特征在于,所述将所述多个数据分片分别写入对应分配的存储节点之后,所述方法还包括:若第二设定时长内成功写入数据分片的存储节点的个数小于所述设定值,则确定所述数据块写入失败;其中,所述第二设定时长大于所述第一设定时长。
  6. 根据权利要求1所述的方法,其特征在于,所述若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定所述数据块写入成功,包括:若所述第一设定时长内成功写入数据分片的存储节点的个数大于或等于所述设定值,则在将未 成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定所述数据块写入成功。
  7. 根据权利要求1所述的方法,其特征在于,所述对数据块进行纠删码编码,得到对应的多个数据分片之前,所述方法还包括:确定以下参数:任一数据块进行纠删码编码得到的数据块分片的个数K、任一数据块进行纠删码编码得到的校验分片的个数M、在任一数据块写入过程中的可靠性参数N;其中,K、M均为正整数,N为大于或等于0且小于或等于M的整数。
  8. 根据权利要求7所述的方法,其特征在于,所述参数还包括:备份存储节点的个数。
  9. 一种数据存储装置,其特征在于,包括:
    编码模块,适于对数据块进行纠删码编码,得到对应的多个数据分片;
    写入模块,适于将所述多个数据分片分别写入对应分配的存储节点;
    处理模块,适于若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则确定所述数据块写入成功;其中,所述设定值大于或等于所述数据分片中的数据块分片的个数且小于或等于所述数据分片的个数。
  10. 根据权利要求9所述的装置,其特征在于,所述处理模块,还适于在确定所述数据块写入成功之后,对于未成功写入存储节点的数据分片进行异步重新写入。
  11. 根据权利要求9所述的装置,其特征在于,所述处理模块,还适于若所述第一设定时长内成功写入数据分片的存储节点的个数小于所述设定值,则对所述数据块进行密封操作,将所述数据块标记为只读;分配新的数据块,并确定所述新的数据块进行纠删码编码后得到的对应的多个数据分片;其中,所述新的数据块携带的数据内容与标记为只读的所述数据块携带的数据内容相同;以及将所述新的数据块对应的数据分片分别写入重新分配的存储节点。
  12. 根据权利要求9所述的装置,其特征在于,所述处理模块,适于若所述第一设定时长内成功写入数据分片的存储节点的个数大于或等于所述设定值,则在将未成功写入存储节点的数据分片成功写入已分配的备份存储节点后,确定所述数据块写入成功。
  13. 根据权利要求9所述的装置,其特征在于,所述装置还包括:参数确定模块,适于确定以下参数:任一数据块进行纠删码编码得到的数据块分片的个数K、任一数据块进行纠删码编码得到的校验分片的个数M、在任一数据块写入过程中的可靠性参数N;其中,K、M均为正整数,N为大于或等于0且小于或等于M的整数。
  14. 一种数据存储系统,其特征在于,包括:
    存储客户端以及至少两个存储节点;
    其中,所述存储客户端适于对数据块进行纠删码编码,得到对应的多个数据分片;将所述多个数据分片分别写入对应分配的存储节点;若第一设定时长内成功写入数据分片的存储节点的个数大于或等于设定值,则所述存储客户端确定所述数据块写入成功;其中,所述设定值大于或等于所述数据分片中的数据块分片的个数且小于或等于所述数据分片的个数。
  15. 根据权利要求14所述的系统,其特征在于,所述存储客户端,还适于在确定所述数据块写入成功之后,对于未成功写入存储节点的数据分片进行异步重新写入。
  16. 根据权利要求14所述的系统,其特征在于,所述系统还包括:存储管理节点,适于接收所述存储客户端的存储节点分配请求,并根据所述存储节点分配请求,给所述存储客户端分配存储所述数据分片的存储节点。
  17. 一种计算设备,其特征在于,包括存储器以及处理器,所述存储器适于存储数据存储程序,所述数据存储程序被所述处理器执行时实现如权利要求1至8中任一项所述的数据存储方法的步骤。
  18. 一种计算机可读介质,其特征在于,存储有数据存储程序,所述数据存储程序被处理器执行时实现如权利要求1至8中任一项所述的数据存储方法的步骤。
PCT/CN2019/070582 2018-01-09 2019-01-07 一种数据存储方法、装置及系统 WO2019137323A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19738610.5A EP3739441A4 (en) 2018-01-09 2019-01-07 DATA STORAGE PROCESS, APPARATUS AND SYSTEM
US16/922,706 US11210169B2 (en) 2018-01-09 2020-07-07 Data storage method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810020376.7A CN110018783B (zh) 2018-01-09 2018-01-09 一种数据存储方法、装置及系统
CN201810020376.7 2018-01-09

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/922,706 Continuation US11210169B2 (en) 2018-01-09 2020-07-07 Data storage method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2019137323A1 true WO2019137323A1 (zh) 2019-07-18

Family

ID=67187846

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/070582 WO2019137323A1 (zh) 2018-01-09 2019-01-07 一种数据存储方法、装置及系统

Country Status (4)

Country Link
US (1) US11210169B2 (zh)
EP (1) EP3739441A4 (zh)
CN (1) CN110018783B (zh)
WO (1) WO2019137323A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625400A (zh) * 2020-05-26 2020-09-04 平安科技(深圳)有限公司 一种数据冗余处理方法、装置及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515542B (zh) * 2019-07-30 2021-08-31 华为技术有限公司 数据存储方法、装置、计算设备、存储系统及存储介质
CN112799607B (zh) * 2021-04-12 2021-06-22 骊阳(广东)节能科技股份有限公司 一种根据数据大小分区式存放的数据存储方法
CN113515531B (zh) * 2021-05-08 2022-12-02 重庆紫光华山智安科技有限公司 数据访问方法、装置、客户端及存储介质
CN114116774B (zh) * 2022-01-28 2022-06-28 北京安帝科技有限公司 日志数据的查询方法及装置
CN114594914B (zh) * 2022-03-17 2024-04-02 阿里巴巴(中国)有限公司 用于分布式存储系统的控制方法及系统
CN115098467A (zh) * 2022-07-18 2022-09-23 重庆紫光华山智安科技有限公司 数据存储方法、装置、存储节点及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681793A (zh) * 2012-04-16 2012-09-19 华中科技大学 一种基于纠删码集群存储系统的局部式数据更新方法
US20150019937A1 (en) * 2012-06-13 2015-01-15 Caringo, Inc. Erasure coding and replication in storage clusters
CN105630423A (zh) * 2015-12-25 2016-06-01 华中科技大学 一种基于数据缓存的纠删码集群存储扩容方法
CN106662983A (zh) * 2015-12-31 2017-05-10 华为技术有限公司 分布式存储系统中的数据重建的方法、装置和系统

Family Cites Families (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5099517A (en) * 1990-06-29 1992-03-24 Digital Equipment Corporation Frame status encoding for communication networks
US7017162B2 (en) * 2001-07-10 2006-03-21 Microsoft Corporation Application program interface for network software platform
US20060069800A1 (en) 2004-09-03 2006-03-30 Microsoft Corporation System and method for erasure coding of streaming media
US8364891B2 (en) 2006-04-04 2013-01-29 Permabit Technology Corporation Storage assignment technique for scalable and fault tolerant storage system
US9098519B2 (en) 2008-09-16 2015-08-04 File System Labs Llc Methods and apparatus for distributed data storage
US8473778B2 (en) 2010-09-08 2013-06-25 Microsoft Corporation Erasure coding immutable data
US9229809B2 (en) * 2011-09-11 2016-01-05 Microsoft Technology Licensing Llc Nonvolatile media journaling of verified data sets
US8713405B2 (en) 2011-11-22 2014-04-29 Simplivity Corporation Method and apparatus for allocating erasure coded data to disk storage
US8683296B2 (en) 2011-12-30 2014-03-25 Streamscale, Inc. Accelerated erasure coding system and method
US8788913B1 (en) 2011-12-30 2014-07-22 Emc Corporation Selection of erasure code parameters for no data repair
CN103634361B (zh) * 2012-08-28 2018-07-20 腾讯科技(深圳)有限公司 下载文件的方法和装置
US9378084B2 (en) * 2013-06-25 2016-06-28 Microsoft Technology Licensing, Llc Erasure coding across multiple zones
US9244761B2 (en) * 2013-06-25 2016-01-26 Microsoft Technology Licensing, Llc Erasure coding across multiple zones and sub-zones
US9558129B2 (en) * 2014-06-10 2017-01-31 Xilinx, Inc. Circuits for and methods of enabling the access to data
US9798489B2 (en) * 2014-07-02 2017-10-24 Hedvig, Inc. Cloning a virtual disk in a storage platform
US9503127B2 (en) 2014-07-09 2016-11-22 Quantum Corporation Data deduplication with adaptive erasure code redundancy
CN104484251B (zh) * 2014-12-11 2018-10-02 华为技术有限公司 一种硬盘故障的处理方法及装置
US9116833B1 (en) 2014-12-18 2015-08-25 Igneous Systems, Inc. Efficiency for erasure encoding
US9595979B2 (en) 2015-01-20 2017-03-14 International Business Machines Corporation Multiple erasure codes for distributed storage
US10187083B2 (en) 2015-06-26 2019-01-22 Microsoft Technology Licensing, Llc Flexible erasure coding with enhanced local protection group structures
CN106649401A (zh) * 2015-11-03 2017-05-10 阿里巴巴集团控股有限公司 分布式文件系统中的数据写入方法和装置
US20170228285A1 (en) * 2016-02-10 2017-08-10 SwiftStack, Inc. Data durability in stored objects
CN106598488B (zh) * 2016-11-24 2019-08-13 北京小米移动软件有限公司 分布式数据读取方法及装置
US10990478B2 (en) * 2019-02-01 2021-04-27 Fungible, Inc. Flexible reliability coding for storage on a network
US10761931B2 (en) * 2018-10-24 2020-09-01 Fungible, Inc. Inline reliability coding for storage on a network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681793A (zh) * 2012-04-16 2012-09-19 华中科技大学 一种基于纠删码集群存储系统的局部式数据更新方法
US20150019937A1 (en) * 2012-06-13 2015-01-15 Caringo, Inc. Erasure coding and replication in storage clusters
CN105630423A (zh) * 2015-12-25 2016-06-01 华中科技大学 一种基于数据缓存的纠删码集群存储扩容方法
CN106662983A (zh) * 2015-12-31 2017-05-10 华为技术有限公司 分布式存储系统中的数据重建的方法、装置和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3739441A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625400A (zh) * 2020-05-26 2020-09-04 平安科技(深圳)有限公司 一种数据冗余处理方法、装置及存储介质
CN111625400B (zh) * 2020-05-26 2024-01-16 平安科技(深圳)有限公司 一种数据冗余处理方法、装置及存储介质

Also Published As

Publication number Publication date
CN110018783B (zh) 2022-12-20
US11210169B2 (en) 2021-12-28
CN110018783A (zh) 2019-07-16
US20200334106A1 (en) 2020-10-22
EP3739441A1 (en) 2020-11-18
EP3739441A4 (en) 2021-10-13

Similar Documents

Publication Publication Date Title
WO2019137323A1 (zh) 一种数据存储方法、装置及系统
US8972779B2 (en) Method of calculating parity in asymetric clustering file system
CN111177040B (zh) 共享主机存储器的存储装置及其操作方法和存储系统
US11698728B2 (en) Data updating technology
CN106776130B (zh) 一种日志恢复方法、存储装置和存储节点
CN110651246B (zh) 一种数据读写方法、装置和存储服务器
CN114415976B (zh) 一种分布式数据存储系统与方法
WO2014056381A1 (zh) 数据冗余实现方法及装置
WO2019001521A1 (zh) 数据存储方法、存储设备、客户端及系统
CN110427156B (zh) 一种基于分片的mbr的并行读方法
US10802958B2 (en) Storage device, its controlling method, and storage system having the storage device
CN113377569B (zh) 用于恢复数据的方法、设备和计算机程序产品
US11782778B2 (en) Data recovery bypassing protocol for cloud network storage system
WO2023197937A1 (zh) 数据处理方法及其装置、存储介质、计算机程序产品
US10740189B2 (en) Distributed storage system
WO2020034695A1 (zh) 数据存储方法、数据恢复方法、装置、设备及存储介质
CN111506450B (zh) 用于数据处理的方法、设备和计算机程序产品
CN111381767A (zh) 一种数据处理方法及装置
US20210349780A1 (en) Systems, methods, and devices for data recovery with spare storage device and fault resilient storage device
WO2024040919A1 (zh) 一种数据修复方法及存储设备
CN114822631A (zh) 一种基于mram主存的混合型nvme ssd存储系统
WO2018107460A1 (zh) 对象复制方法、装置及对象存储设备
CN117336308A (zh) 使用网络恢复存储装置中的数据的方法和存储装置
CN110888750A (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: 19738610

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019738610

Country of ref document: EP

Effective date: 20200810