WO2018082302A1 - 响应写请求的方法和装置 - Google Patents

响应写请求的方法和装置 Download PDF

Info

Publication number
WO2018082302A1
WO2018082302A1 PCT/CN2017/087198 CN2017087198W WO2018082302A1 WO 2018082302 A1 WO2018082302 A1 WO 2018082302A1 CN 2017087198 W CN2017087198 W CN 2017087198W WO 2018082302 A1 WO2018082302 A1 WO 2018082302A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
write request
write
nodes
request
Prior art date
Application number
PCT/CN2017/087198
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 华为技术有限公司
Publication of WO2018082302A1 publication Critical patent/WO2018082302A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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/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/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Definitions

  • Embodiments of the present invention relate to the field of storage, and in particular, to a method and apparatus for responding to a write request, a first node, and a distributed object storage system.
  • the node of the distributed object storage system first solidifies the write request carrying the data to the local disk.
  • the solidification method is: The received write request is written to the edit log on the disk. Subsequently responding to the write request in the edit log, specifically adding, deleting, or modifying data in the memory according to the data of the write request.
  • IOPS Input/Output Operations Per Second
  • the read request and the write request originating from the client are random, so the write request received by the node within the preset time period is usually discontinuous. Because the operations of responding to read requests and write requests are mutually exclusive, they cannot be executed at the same time. In this way, the disk I/O needs to be used multiple times to write the write request to the edit log in the preset time. Lower, so the read and write performance of the entire distributed object storage system is lower.
  • embodiments of the present invention provide a method and apparatus for responding to a write request, a first node, and a distributed object storage system, which improve the efficiency of writing a write request to an edit log.
  • the present application provides a method for responding to a write request, which is applied to a distributed object storage system, the distributed object storage system including a plurality of nodes, the plurality of nodes including at least one first node and at least one Two nodes.
  • the first node is used to aggregate write requests originating from the client, and uniformly distribute write requests to the second node.
  • the second node is configured to respond to the write request, including writing the first write request to an edit log of the node.
  • the first node receives a plurality of write requests, and continuously arranges the plurality of write requests; after the plurality of write requests are consecutively arranged, the first node sends the first write request to all of the The second node sends, where the first write request is all write requests that belong to the preset time period among the plurality of write requests that are consecutively arranged.
  • the second node can continuously write the multiple write requests included in the first write request. Enter the edit log. Therefore, the second node can write the write request in the preset time to the edit log by using only one disk I/O, thereby improving the response efficiency of the second node in response to the write request in the preset time period, thereby improving the response efficiency.
  • the read and write performance of the second node improves the read and write performance of the entire distributed object storage system.
  • the first node is configured to respond to at least one of the plurality of write requests, the manner of responding includes writing the at least one write request to an edit log of the first node; the first node is not used to respond to the A write request other than the at least one write request among the plurality of write requests.
  • the first node responds to the at least one write request in the preset time period, and is also continuously responsive, and specifically includes continuously writing at least one write request in the preset time period to the edit log;
  • the disk I/O is required to complete the writing of the at least one write request in the preset time to the edit log, thereby improving the response efficiency of the first node in response to the at least one write request in the preset time period, thereby improving the response efficiency.
  • the read and write performance of the second node improves the read and write performance of the entire distributed object storage system.
  • the first node For example, if the first node belongs to a node that responds to the first write request, the first node writes the first write request to an edit log of the local node.
  • a possible design, from the client's write request, is divided into two categories; one is the client directly sends a write request to the first node; the other is the client to the distributed object storage system in addition to the first node Write requests sent by other nodes.
  • the number of clients of the distributed object storage system may be multiple.
  • the manner in which the first node receives the write request from the plurality of clients includes:
  • the first node receives a second write request sent by any one of the plurality of clients; and/or,
  • the second write request and the third write request are different write requests.
  • all second nodes belong to the third node.
  • the third node has a write request queue; the third node adds the third write request sent by the multiple clients to the third node to the write request queue of the third node, The third write request in the write request queue of the third node is sent to the first node.
  • the third node can continuously acquire the write request that needs to be sent to the first node from the write request queue, thereby improving the efficiency of forwarding the write request; thereby avoiding the need to read the intermediate write interval when forwarding the write request.
  • the request also needs to respond to the read request before continuing to obtain the write request to be forwarded.
  • the third node has a read request queue. After receiving the read request from the client, the third node adds the read request to the read request queue of the third node. In this way, the third node can continuously acquire the read request from the read request queue, thereby continuously responding to the read request in the read request queue, thereby improving the efficiency of responding to the read request.
  • the first node has a write request queue.
  • the first node sequentially adds the multiple write requests to the write request queue of the first node according to the sequence of receiving times of the multiple write requests, and the write request queue of the first node is used by
  • the receiving time specifically refers to the time when the first node receives the write request.
  • the first node has a write request queue and a read request queue.
  • the first node adds the received write request to the write request queue and adds the received read request to the read request queue.
  • the implementation of the first node adding a write request to the write request queue is described in the possible design above.
  • the first node For a read request, the first node receives a read request sent by multiple clients, adds the read request to a read request queue of the first node, and responds to a read request in a read request queue of the first node. . In this way, the first node can continuously acquire a read request from the read request queue, thereby continuously responding to the read request in the read request queue, thereby improving the efficiency of responding to the read request.
  • the application provides an apparatus for responding to a write request, the apparatus comprising performing the first aspect or the first party
  • the functional unit of the method for responding to the write request provided by any possible design of the face; the division of the functional unit is not limited in the present application, for example, the functional unit may be correspondingly divided according to the flow step of the method in response to the write request.
  • the present application provides a method for responding to a write request, applied to a distributed object storage system, the distributed object storage system comprising a plurality of nodes.
  • the first node is any one of the plurality of nodes; the second node is any one of the plurality of nodes except the first node.
  • the first node receives a first write request and a second write request, where the first write request is a write request sent by the client to the first node, and the second write request is all a write request sent by the two nodes to the first node; the first node sequentially arranging the first write request and the second write request to obtain a plurality of write requests that are consecutively arranged; the first node will The consecutively arranged plurality of write requests in the preset time period are written into the edit log of the first node; if the first node receives the first write request in the preset time period, The first node sends the first write request in a preset time period to all third nodes, and the third node is configured to write the first write request into an edit log of the local node, where all the third Each of the third nodes in the node is a node of all of the second nodes.
  • the first node since all write requests in the preset time period are consecutively arranged, there is no interval read request among the plurality of consecutive write requests, so the first node can continuously write the write request to the edit log. Therefore, the first node can complete writing the multiple write requests in the preset time to the edit log by using only one disk I/O, thereby improving the response efficiency of the first node in response to the write request in the preset time period, thereby Improve the read and write performance of the first node, thereby improving the read and write performance of the entire distributed object storage system.
  • the third node also responds to the first write request received from the first node.
  • the implementation manner of the second node (including the third node) in response to the write request is the same as the implementation manner of the first node responding to the write request, and details are not described herein again.
  • the third node receives the write request of the client, and receives a write request of other nodes (including the first node), and continuously arranges all the write requests received, and the preset time period is A plurality of write requests arranged in succession are written to the edit log of the second node.
  • each node in the plurality of nodes in the distributed system, the principle of responding to the write request of each node is the same as the principle that the first node responds to the write request; that is, each node directly responds to the write request received from the client,
  • the write request is forwarded to other nodes that are responsive to the write request so that other nodes respond to the request.
  • each node also receives a write request forwarded by another node that needs its response, and sequentially responds by receiving the forwarded write request and the write request directly received from the client.
  • each node continuously responds to the write request within the preset time period, which improves the response efficiency of each node in response to the write request, thereby improving the read and write performance of each node, thereby improving the entire distributed object storage system. Read and write performance.
  • the first node has a write request queue that is used to cache write requests.
  • the first node sequentially adds the first write request and the second write request to the location according to the receiving time of the first write request and the receiving time of the second write request according to the order of receiving time.
  • the write request queue of the first node In this way, the first node can continuously obtain a write request that needs to respond from the write request queue, which improves the efficiency of responding to the write request.
  • the first node has a read request queue.
  • the first node receives a read request sent by the client, adds the read request to the read request queue of the first node, and responds to the read request in the read request queue of the first node.
  • the first node can continuously acquire a read request from the read request queue, thereby continuously responding to the read request in the read request queue, thereby improving the efficiency of responding to the read request.
  • the present application provides an apparatus for responding to a write request, the apparatus comprising a functional unit for performing the method of responding to a write request provided by any of the third aspect or the third aspect; the application does not divide the functional unit
  • the functional units may be correspondingly divided according to the flow steps of the method in response to the write request.
  • the application provides a first node.
  • the distributed object storage system includes the first node.
  • the first node includes at least one processor, a memory, and a communication interface.
  • the at least one processor, the memory, and the communication interface are each connected by a bus; the memory storage computer executes instructions; the at least one processor executes the memory stored computer execution instructions such that the first node Performing a data interaction with the other nodes in the distributed object storage system through the communication interface to perform the method of responding to the write request provided by the first aspect or the various possible designs of the first aspect, or causing the first node to pass the Means that the communication interface performs data interaction with other nodes in the distributed object storage system to implement the response write request in the second aspect, or causes the first node to perform various possible designs of the third aspect or the third aspect described above
  • the method of responding to the write request is provided, so that the first node performs data interaction with other nodes in the distributed object storage system through the communication interface to implement the device for responding to the write request in the fourth aspect.
  • a computer readable storage medium where computer execution instructions are stored, when at least one processor of a first node in a distributed object storage system executes the computer to execute an instruction A method for responding to a write request provided by the first aspect or the various possible designs of the first aspect, or the method for the first node to perform the response write request provided by the third aspect or the various possible designs of the third aspect .
  • a computer program product comprising computer executable instructions stored in a computer readable storage medium.
  • At least one processor of the first node in the distributed object storage system can read the computer execution instructions from the computer readable storage medium, and the at least one processor executes the computer to execute the instructions such that the first node implements the first aspect or the first A method of responding to a write request provided by various possible designs on the one hand, or a method of responding to a write request provided by the first node in the various possible designs of the third aspect or the third aspect described above.
  • FIG. 1 is a schematic structural diagram of a system of a distributed object storage system according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for responding to a write request according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a system of a distributed object storage system according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of a method for responding to a write request according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a logical architecture of an apparatus for responding to a write request according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a logical architecture of an apparatus for responding to a write request according to an embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of hardware of a first node according to an embodiment of the present invention.
  • Method embodiment 1 applicable distributed object storage system
  • a distributed object-based storage system includes L nodes, and L is a positive integer greater than or equal to 2.
  • the distributed object storage system shown in Figure 1 has 5 nodes, that is, L is equal to 5.
  • a device that can be configured as the node which can be a server, computer, or other computing capable device.
  • the role of the node in the distributed object storage system is not limited in the embodiment of the present invention; for example, the distributed object storage system may be a Distributed File System (DFS), and the node is in the DFS. It can be a name node or it can be a data node.
  • DFS Distributed File System
  • the node may respond to an input/output (I/O) request, and the I/O request may be a write request or a read request.
  • I/O request is a write request
  • the node writes the write request to the edit log of the node; subsequently, when responding to the write request in the edit log, the data specified by the write request is written
  • the node is in memory so that the data in the memory is written to the local storage medium.
  • the I/O request is a read request, the node retrieves the data specified by the read request from the storage medium of the node in response to the read request.
  • the storage medium may be a magnetic disk, a hard disk, or other medium that can store data.
  • the L nodes include M first nodes, and M is a positive integer greater than or equal to 1.
  • M is a positive integer greater than or equal to 1.
  • the first node 101 is a first node among the M first nodes. If M is equal to 1, there is no first node 102 indicated by a broken line in FIG. 1. If M is greater than 1, then there is The first node 102 is shown in dashed lines in FIG.
  • the method of selecting the first node from the distributed object storage system may be: selecting the first node from a plurality of homogeneous nodes, or selecting a node with a larger storage capacity as the first node, or selecting a node with a larger IOPS. As the first node, or using the hash algorithm to select the first node.
  • the first node refers to a node that can be used to continuously arrange a plurality of write requests.
  • the continuous arrangement may mean that no read request is interrupted between the multiple write requests.
  • the first node also sends a first write request to the second node.
  • the first write request is all write requests belonging to the preset time period among the plurality of write requests after the continuous arrangement.
  • the preset time period refers to a time interval preset by the user or the program.
  • the embodiment of the present invention may divide consecutive time intervals from the time axis dimension in chronological order; different time intervals of the multiple time intervals may have the same time length, or have different length of time.
  • the plurality of time intervals are correspondingly a plurality of preset time segments, and one time interval corresponds to one preset time period.
  • the length of the preset time period may be adjusted, for example, according to the delay of the write request; if the time length of the preset time period is long, the response delay of the first write request corresponding to the preset time period is relatively If the length of the preset time period is short, the response delay of the first write request corresponding to the preset time period is relatively short.
  • the L nodes include N second nodes, and N is a positive integer greater than or equal to 1.
  • the second node 103 is a second node among the N second nodes. If N is equal to 1, there is no second node 104 indicated by a broken line in FIG. 1. If N is greater than 1, then there is The second node 104 is shown in dashed lines in FIG.
  • all nodes in the L nodes for responding to the first write request constitute a set of response nodes; wherein, the response node The set includes N second nodes. If the first node is also used to respond to the first write request, the set of responding nodes includes the first node; if the first node is not used to respond to the first write request, the set of responding nodes does not include the first node.
  • the set of responding nodes for responding to different first write requests may be different, in particular, the nodes included in the set of responding nodes for responding to different first write requests may be different; therefore the second node may change, N may change, and
  • the response role of a node for different first write requests is also different, wherein the response role may include both responding and non-responsive roles.
  • the preset time period and the second preset time period are different preset time periods; the four nodes for responding to the first write request corresponding to the first preset time period include the first node 101, the second node 103, and the Two nodes 104, so N is equal to 2; 1 node for responding to the first write request corresponding to the second preset time period is node 105, so N is equal to 1, and is used to respond to the first preset time period.
  • the second node (the second node 103 and the second node 104) of the first write request is no longer used to respond to the first write request corresponding to the second preset time period, and is configured to respond to the second preset time period.
  • the second node of the first write request is the node 105; it can be seen that the second node for different processing different first write requests may be different nodes, and the number of nodes for processing the second node of different first write requests may also be The change, as well as the first node, may be a different response role for different first write requests.
  • the present embodiment provides a method for responding to a write request, which is applied to the distributed object storage system shown in FIG.
  • the steps of the method of responding to the write request are described below from the perspective of a single first node and a single second node, for example, step S201, step S202, step S203, step S204, and step S205.
  • step S201 the first node receives a plurality of write requests.
  • All of the plurality of write requests are originated from a client; optionally, different ones of the plurality of write requests may originate from the same client, or different writes in the multiple write requests Requests may come from different clients.
  • the first node In the first receiving mode, the first node only receives write requests sent by all clients. Specifically, all client write requests are sent only to any of the M first nodes.
  • the first node only receives a write request originating from the client forwarded by all nodes except the M first nodes among the L nodes. Specifically, all client write requests are sent only to nodes other than the M first nodes among the L nodes; wherein, a write request of the client only refers to a node other than the M first nodes among the L nodes. send. All the nodes except the M first nodes of the L nodes do not process the write request received from the client, and directly send the respective received write request to any of the M first nodes.
  • the first node receives the write request of the client, and also receives other write requests originating from the client forwarded by all the nodes except the M first nodes among the L nodes. Specifically, all clients send a write request directly to any one of the M first nodes, or send a write request to a node other than the M first nodes among the L nodes; All the nodes except the M first nodes do not process the write request received from the client, and directly send the respective received write request to any one of the M first nodes. In this way, all write requests received by the first node may include directly sent by the client, and may also include a write request originating from the client forwarded by nodes other than the M first nodes among the L nodes.
  • Step S202 the first node sequentially arranges the plurality of write requests.
  • each of the plurality of write requests has a receiving time; the receiving time of each write request refers to a time when the first node receives the write request. Specifically, if the first node receives the write request of the client, the receiving time is specifically the time of receiving the write request of the client; if the first node receives other nodes (except the M first nodes among the L nodes) The node is forwarded by the write request, and the receiving time is specifically the time of receiving the write request forwarded by other nodes.
  • the first node Since the first node receives the write request in a sequential order, each of the plurality of write requests is received by the first node for a different time. In order to ensure the correctness of the data, the write request received by the client needs to be processed first; therefore, the first node may perform the step S202 according to the chronological order of the respective receiving times of the multiple write requests, and the multiple writes are performed. Requests are arranged in a row.
  • the first node has a write request queue, and the write request queue is used to cache a write request.
  • the first node may sequentially add the multiple write requests to the write request queue according to the chronological order of the respective receiving times of the multiple write requests, and implement the write request queue.
  • the plurality of write requests are consecutively arranged.
  • the write request queue is configured with a first in first out principle; the first in first out principle specifically means: for two adjacent write requests, the write request added to the write request queue is first taken out, and The write request added to the write request queue needs to wait for the first added write request to be fetched before being fetched.
  • step S202 After the first node continuously arranges the multiple write requests in step S202, if there is a write request within the preset time period, the plurality of write requests are consecutively arranged. All write requests within the preset time period are fetched in the write request, and all write requests within the preset time period constitute a first write request. It can be seen that the first write request includes all write requests belonging to the preset time period among the plurality of write requests that are consecutively arranged. In addition, at the end of the preset time period, step S203 is performed.
  • step S203 Send the first write request.
  • Step S203 the first node sends the first write request to all the second nodes.
  • all of the L nodes that respond to the first write request constitute a set of responding nodes. It should be noted that different sets of responding nodes corresponding to the first write request may be different; specifically, if different sets of responding nodes corresponding to the first write request are different, at least one node included in a set of responding nodes in different sets of responding nodes Does not belong to another set of responding nodes.
  • the set of response nodes includes N second nodes. If the first node is also used to respond to the first write request, the set of responding nodes includes the first node; if the first node is not used to respond to the first write request, the set of responding nodes does not include the first node
  • the second node is configured to write the first write request to an edit log of the node.
  • each time at the end of a preset time period if there is a write request within the preset time period, all write requests within the preset time period are taken out to form a first A write request is sent, and the step S203 is performed to send the first write request corresponding to the preset time period to the second node.
  • different preset time segments correspond to different first write requests, and nodes for processing different first write requests may be different nodes, and thus the second node for processing different first write requests may change.
  • Step S204 the second node writes the first write request to the edit log of the node.
  • a set of responding nodes for responding to the first write request includes a second node.
  • the second node responds to the first write request; specifically, the second node responds to each write request in the first write request, and the specific manner of the response includes: writing each write request in the first write request to the The edit log of the second node.
  • the second node since all the write requests in the preset time period are consecutively arranged, there is no interval read request in the middle of the consecutively arranged write requests, and therefore, the second node may continuously write the multiple writes included in the first write request. Request to write to the edit log. Therefore, the second node can complete the write request of the preset time by using only one disk I/O.
  • the edit log is added to improve the response efficiency of the second node in response to the write request in the preset time period, thereby improving the read and write performance of the second node, thereby improving the read and write performance of the entire distributed object storage system.
  • the second node may store the edit log in a local storage medium of the second node. Subsequently, the second node may respond to the write request in the edit log, and the specific manner of the response includes: first writing the data specified by the write request to the memory of the second node, and then writing the data in the memory to the local storage medium. .
  • step S205 the first node writes the first write request to the edit log of the node.
  • the first node responds to the first write request.
  • the first node responds to the first write request in the same manner as the second node responds to the first write request, and details are not described herein again.
  • the first node responding to the first write request includes writing the first write request to an edit log of the first node.
  • the first node responds to the at least one write request in the preset time period, and is also continuously responsive, and specifically includes continuously writing at least one write request in the preset time period to the edit log;
  • a node can write the at least one write request in the preset time to the edit log by using only one disk I/O, which improves the response efficiency of the at least one write request in the preset response time of the first node. , thereby improving the read and write performance of the second node, thereby improving the read and write performance of the entire distributed object storage system.
  • the M first nodes are respectively collected.
  • each of the received write requests each performing step 202 sequentially generates a first write request in chronological order, each first node correspondingly generates a first write request in each preset time period; each of the M first nodes performs step S203 Sending each generated first write request to the second node; it should be noted that the first write request may not be sent to a different second node.
  • the M first nodes receive the write request by using the first receiving manner in step S201, specifically receiving only the write requests of all the clients, and not receiving the write requests of other nodes.
  • the M first nodes do not respond to all write requests, that is, the write request is not written into the edit log of the node; the M first nodes send the write request to the second node to respond, specifically by sending the first Send a request (including all write requests for a preset time period).
  • the M first nodes receive the write request in the second receiving manner in the step S201, and specifically receive only the client-side writes forwarded by all the nodes except the M first nodes among the L nodes.
  • Request in this alternative embodiment, all clients send write requests to only nodes other than the M first nodes among the L nodes, and do not directly send write requests to the M first nodes.
  • the M first nodes do not respond to all write requests, that is, the write request is not written into the edit log of the node; the M first nodes send the write request to the second node to respond, specifically by sending the first Send a request (including all write requests for a preset time period).
  • the M first nodes receive the write request by using the third receiving manner in step S201, specifically receiving only write requests of all clients, and receiving write requests of other nodes; wherein other nodes are receiving When a write request is made to the client, only the write request is forwarded to the M first nodes, and the write request is not directly responded.
  • the M first nodes receive the write request by using the second receiving manner or the third receiving manner in step S201; specifically, the third node receives a write request of any client, and the third node It is any node other than the M first nodes among the L nodes.
  • the third node has a write request queue. Taking a single third node as an example, after receiving the write request of the client, the third node adds the write request to the write request queue of the third node. In this way, the third node can continuously acquire the write request that needs to be sent to the first node from the write request queue, thereby improving the efficiency of forwarding the write request; thereby avoiding the need to read the intermediate write interval when forwarding the write request. The request also needs to respond to the read request before continuing to obtain the write request to be forwarded.
  • the specific implementation manner that the third node adds the write request to the write request queue may be: the third node sequentially receives the chronological order of the receiving times of the multiple write requests according to the third node, and sequentially The plurality of write requests are added to the write request queue.
  • the specific implementation manner that the third node adds the write request to the write request queue may be that the third node adds the write request to the write request queue every time a write request is received; The third node sequentially adds a plurality of write requests to the write request queue according to the receiving time of receiving the write request.
  • the third node does not directly respond to the write request in the write request queue (ie, the write request received from the client), but sends the write request in the write request queue to the first node.
  • the first node has a write request queue and a read request queue.
  • the first node adds the received write request to the write request queue.
  • the first node adds the received read request to the read request queue, and responds to the read request in the read request queue.
  • the specific response manner may be that the first node is from the first node according to the read request in the read request queue.
  • the data is read from the storage medium; thus, the first node can continuously acquire the read request from the read request queue, thereby continuously responding to the read request in the read request queue, thereby improving the efficiency of responding to the read request.
  • the first node may separately cache the write request and the read request in the write request queue and the read request queue, and continuously process the write request when processing the write request in the write request queue (the processing manner may be generating The first write request), in the same way, responds to the read request in response to the read request in the read request queue.
  • the optional implementation manner can improve the processing efficiency of the write request and improve the response efficiency of the read request; and, the larger the number of read requests continuously processed, the write request The higher the processing efficiency, the larger the amount of write requests processed continuously, and the higher the response efficiency of read requests.
  • each of the L nodes has a write request queue and a read request queue.
  • the write request queue of each node works in the same manner. For details, refer to the description of the write request queue (for example, the write request queue of the first node or the write request queue of the third node).
  • the read request queue of each node works in the same manner. For details, refer to the description of the read request queue of the first node.
  • the distributed object storage system includes L nodes, and L is a positive integer greater than or equal to 2.
  • the distributed object storage system shown in FIG. 3 has 5 nodes, that is, L is equal to 5.
  • the distributed object storage system to which the method embodiment 2 is applicable is similar to the distributed object storage system to which the first embodiment of the method is applicable.
  • the node in the distributed object storage system to which the method embodiment 2 is applicable, and the method embodiment 1 The nodes in the applicable distributed object storage system are similar in the implementation and working mode of the distributed system.
  • any one of the L nodes can receive the write request sent by the client, and can also receive any one of the L nodes.
  • the other node forwards other write requests originating from the client; wherein the other write request is sent by the client to the other node and is not directly sent to the node.
  • the other node responds to the other write request when receiving the other write request sent by the client, and also sends the other write request to the node (including the node) for responding to the other write request. .
  • any of the L nodes responds to a write request received directly from the client and sends the write request to other nodes in addition to the any of the nodes in response to the write request.
  • the present embodiment provides a method for responding to a write request, which is applied to the distributed object storage system shown in FIG.
  • the steps of the method of responding to the write request are described below from the perspective of the first node, for example, step S401, step S402, and step S403.
  • the first node is any one of the L nodes.
  • the second node is any one of the L nodes except the first node.
  • Step S401 the first node receives the first write request sent by the client, and receives the second write request forwarded by the second node.
  • the first write request is a write request sent by the client directly to the first node. Therefore, the first write request is not forwarded by the second node.
  • the second write request is a write request originating from the client forwarded by all the second nodes.
  • the client sends a second write request to the second node, and the second node sends the second write request to all nodes (including the first node) for responding to the second write request;
  • the node is also responsive to the second write request, and the manner of responding can include writing the second write request to the edit log of the second node.
  • the write request is sent directly by the client to the node for responding to the write request, that is, the write request belongs to the first write request; therefore, only one node is needed.
  • the write request In response to the scenario of the write request, there is no second write request.
  • Step S402 the first node continuously arranges the first write request and the second write request to obtain a plurality of write requests that are consecutively arranged.
  • the first node implements the continuous arrangement in step S402, which is similar to the implementation of the continuous arrangement in the step S202 of the method embodiment. For details, refer to the detailed description of the continuous arrangement in step S202. Let me repeat.
  • the first node according to the receiving time of the first write request and the receiving time of the second write request, the first write request and the second write request according to a sequence of receiving times Arrange continuously.
  • the receiving time of the first write request refers to a time when the first node receives the first write request.
  • the receiving time of the second write request refers to the time when the first node receives the second write request.
  • the first node according to the receiving time of the first write request and the receiving time of the second write request, the first write request and the second write request according to a sequence of receiving times
  • a write request queue is sequentially added to the first node, and a write request queue of the first node is used to cache a write request.
  • the first node adds the write request to the write request queue in order of the receiving time to implement the continuous arrangement.
  • Step S403 the first node writes the consecutively arranged multiple write requests in the preset time period into the edit log of the first node.
  • the multiple write requests in the preset time period may include a first write request and may also include a second write request.
  • the first node writes an implementation manner that requests a plurality of consecutive write requests in the preset time period to be written into the edit log of the first node, and implements the first write request into the edit log in the first embodiment of the method. For details, refer to the description of the implementation manner of writing the first write request to the edit log in the first embodiment of the method.
  • the first node since all the write requests in the preset time period are consecutively arranged, there is no interval read request among the plurality of consecutive write requests, so the first node can continuously write the write request to the edit log. . Therefore, the first node can complete writing the multiple write requests in the preset time to the edit log by using only one disk I/O, thereby improving the response efficiency of the first node in response to the write request in the preset time period, thereby Improve the read and write performance of the first node, thereby improving the read and write performance of the entire distributed object storage system.
  • the first write request only needs one node (ie, the first node) to respond, after the first node responds to the first write request, the first write request is not sent to other nodes in the L nodes (ie, the second node).
  • step S404 If the node for responding to the first write request includes a plurality of nodes, the present embodiment performs step S404.
  • Step S404 if the first node receives the first write request in the preset time period, the first node sends the first write request in a preset time period to all third nodes. send.
  • all nodes for responding to the first write request include a first node and a third node
  • the third node is any one of the nodes for responding to the first write request except the first node.
  • the manner in which the third node responds to the first write request may include writing the first write request to an edit log of the local node.
  • the implementation manner of the second node (including the third node) in response to the write request is the same as the implementation manner of the first node responding to the write request, and details are not described herein again.
  • the second node receives a write request from the client, and receives write requests from other nodes (including the first node and other second nodes); the second node will continuously receive all write requests.
  • each node among the L nodes in the distributed system, the principle of responding to the write request of each node is the same as the principle that the first node responds to the write request; that is, each node directly responds to the write request received from the client, and The write request is forwarded to other nodes that are responsive to the write request so that other nodes respond to the request.
  • each node also receives a write request forwarded by another node that needs its response, and sequentially responds by receiving the forwarded write request and the write request directly received from the client.
  • each node continuously responds to the write request within the preset time period, which improves the response efficiency of each node in response to the write request, thereby improving the read and write performance of each node, thereby improving the entire distributed object storage system. Read and write performance.
  • each of the L nodes has a write request queue and a read request queue.
  • the write request queue of each node works in the same manner. For details, refer to the description of the write request queue in the method embodiment 1 and the method embodiment 2.
  • the read request queue of each node works in the same manner. For details, refer to the description of the read request queue in the method embodiment 1.
  • Embodiments of the present invention provide an apparatus for responding to a write request.
  • the device is applied to a distributed object storage system to which the method embodiment is applicable.
  • the distributed object storage system includes a plurality of nodes (the first embodiment of the method is illustrated as L nodes), and the plurality of nodes includes at least one first A node and at least one second node.
  • the device is deployed in the first node; the specific deployment manner is: deploying, on the first node, each functional unit included in the device for performing the method for responding to the write request provided by Embodiment 1 of the foregoing method. It should be noted that the manner of dividing each functional unit in the embodiment of the present invention is not limited herein.
  • the apparatus 500 includes a receiving unit 501, an arranging unit 502, and a sending unit 503.
  • the receiving unit 501 is configured to receive multiple write requests.
  • An arranging unit 502 configured to continuously arrange the plurality of write requests
  • a sending unit 503 configured to send, after the plurality of write requests are consecutively arranged, a first write request to all the second nodes, where the second node is configured to write the first write request to the local node Editing the log, the first write request is all write requests belonging to the plurality of write requests that are consecutively arranged within a preset time period.
  • the arranging unit 502 is configured to continuously arrange the multiple write requests, including:
  • the arranging unit 502 is configured to sequentially add the multiple write requests to the write request queue of the first node according to a sequence of receiving times of the multiple write requests, and write the first node
  • the request queue is used to cache write requests.
  • the device further includes: a response unit 504, configured to write the first write request to an edit log of the local node if the first node belongs to a node that responds to the first write request.
  • a response unit 504 configured to write the first write request to an edit log of the local node if the first node belongs to a node that responds to the first write request.
  • the receiving unit 501 is configured to receive multiple write requests, including:
  • the receiving unit 501 is configured to receive a second write request sent by any one of the multiple clients, and/or to receive a third write request forwarded by the third node, where the third node is Any one of the plurality of nodes except the first node, where the third write request is sent by any one of the plurality of clients to the third node;
  • the second write request and the third write request are different write requests.
  • the third node has a write request queue, and the third node is configured to add the third write request sent by the multiple clients to the third node to the third node. Writing a request queue, and transmitting the third write request in the write request queue of the third node to the first node.
  • the receiving unit 501 is further configured to receive a read request sent by multiple clients;
  • the arranging unit 502 is configured to add the read request to a read request queue of the first node
  • the apparatus includes a response unit 504 responsive to a read request in a read request queue of the first node.
  • Embodiments of the present invention provide an apparatus for responding to a write request.
  • the device is applied to a distributed object storage system to which the second embodiment of the method is applicable.
  • the distributed object storage system includes a plurality of nodes (the first embodiment of the method is illustrated as L nodes), and the first node is the plurality of nodes. Any of the nodes.
  • the device is deployed in the first node; the specific deployment manner is: deploying, on the first node, each functional unit included in the device for performing the method for responding to the write request provided by the foregoing method embodiment 2. It should be noted that the division manner of each functional unit in this optional manner is not limited herein.
  • the apparatus 600 includes a receiving unit 601, an arranging unit 602, a response unit 603, and a sending unit 604.
  • the receiving unit 601 is configured to receive a first write request and a second write request, where the first write request is a write request sent by the client to the first node, and the second write request is a write request sent by the first node, where the second node is any one of the plurality of nodes except the first node;
  • the arranging unit 602 is configured to continuously arrange the first write request and the second write request to obtain a plurality of write requests that are consecutively arranged;
  • the response unit 603 is configured to write the consecutively arranged multiple write requests in the preset time period into the edit log of the first node;
  • the sending unit 604 is configured to: if the first node receives the first write request in the preset time period, the first node sends the first write request in a preset time period to all
  • the third node sends the third node is configured to write the first write request to an edit log of the local node, and each of the third nodes of all the third nodes is all the second nodes.
  • the arranging unit 602 is configured to continuously arrange the first write request and the second write request, including:
  • the arranging unit 602 is configured to sequentially, according to the receiving time of the first write request and the receiving time of the second write request, the first write request and the second write request in the order of receiving time. Adding to a write request queue of the first node, the write request queue of the first node is used to cache a write request.
  • the receiving unit 601 is configured to receive a read request sent by the client.
  • the arranging unit 602 is configured to add the read request to a read request queue of the first node
  • the response unit 603 is configured to respond to a read request in a read request queue of the first node.
  • the second node is configured to write the first write request of the local node into an edit log of the local node.
  • the hardware body of the method for responding to the write request provided by the method embodiment 1 or the method embodiment 2 is any one of the plurality of nodes; or the response provided by the device embodiment 1 or the device embodiment 2 is deployed.
  • the hardware body of the device that writes the request may be the first node.
  • the first node is illustrated in FIG. 7 as a first node 700.
  • the first node 700 includes at least one processor 701, a memory 702, and a communication interface 703; the at least one processor 701, the memory 702, and the communication interface 703 are all connected by a bus 704;
  • the memory 702 is configured to store a computer execution instruction
  • the at least one processor 701 is configured to execute computer execution instructions stored by the memory 702, so that the first node 700 performs data interaction with other nodes in the distributed object storage system through the communication interface 703 to perform the foregoing.
  • the at least one processor 701 may include different types of processors 701, or include the same type of processor 701; the processor 701 may be any one of the following: a central processing unit (CPU), an ARM processor. , Field Programmable Gate Array (FPGA), dedicated processor and other devices with computational processing capabilities. In an optional implementation manner, the at least one processor 701 may also be integrated into a many-core processor.
  • processors 701 may be any one of the following: a central processing unit (CPU), an ARM processor. , Field Programmable Gate Array (FPGA), dedicated processor and other devices with computational processing capabilities.
  • the at least one processor 701 may also be integrated into a many-core processor.
  • the memory 702 may be any one or any combination of the following: a random access memory (RAM), a read only memory (ROM), a non-volatile memory (non-volatile memory). , referred to as NVM), Solid State Drives (SSD), mechanical hard disks, disks, disk arrays and other storage media.
  • RAM random access memory
  • ROM read only memory
  • NVM non-volatile memory
  • SSD Solid State Drives
  • Communication interface 703 is used by first node 700 to perform data interaction with other devices, such as other nodes in a distributed object storage system.
  • the communication interface 703 may be any one or any combination of the following: a network interface (such as an Ethernet interface), a wireless network card, or the like having a network access function.
  • the bus 704 can include an address bus, a data bus, a control bus, etc., for ease of representation, Figure 7 shows the bus with a thick line.
  • the bus 704 can be any one or any combination of the following: an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, and an extended industry standard structure ( Extended Industry Standard Architecture (EISA) bus and other devices for wired data transmission.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • This embodiment provides a distributed object storage system, which may be a distributed object storage system to which the first embodiment of the method is applicable, as shown in FIG. 1 .
  • the first node in the distributed object storage system performs the method for responding to the write request provided by Embodiment 1 of the method.
  • the device that responds to the write request provided by the device embodiment is deployed on the first node in the distributed object storage system.
  • This embodiment provides a distributed object storage system, which may be a distributed object storage system to which the second embodiment of the method is applicable, as shown in FIG. 2 .
  • the first node in the distributed object storage system performs the method for responding to the write request provided by the second embodiment of the method.
  • the distributed object storage system The device in response to the write request provided by the device embodiment 2 is deployed on the first node.

Landscapes

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

Abstract

一种响应写请求的方法和装置、第一节点、分布式对象存储系统。该分布式对象存储系统包括至少一个第一节点和至少一个第二节点。在本方法中,第一节点接收多个写请求(S201),将该多个写请求连续排列(S202),将第一写请求向所有第二节点发送(S203),该第一写请求为连续排列的该多个写请求中属于预设时间段内的所有写请求。从而第二节点仅使用需一次磁盘输入/输出(Input/Output,I/O)便能完成将该预设时间内的写请求写入编辑日志,提高了第二节点响应预设时间段内的写请求的响应效率,从而提高了第二节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。

Description

响应写请求的方法和装置 技术领域
本发明实施例涉及存储领域,尤其涉及响应写请求的方法和装置、第一节点、分布式对象存储系统。
背景技术
在分布式对象存储系统(Distributed Object-Based Storage System)中,为了保证数据可靠性,分布式对象存储系统的节点会先将携带该数据的写请求固化到本地磁盘上,固化的方式是:将接收到的写请求写入磁盘上的编辑日志(edit log)。后续再响应该编辑日志中的写请求,具体是根据该写请求的数据增加、删除、或者修改内存中的数据。
由于向内存写数据是很快的,因此在节点响应写请求的整个过程中,主要的时间消耗在将写请求写入磁盘上的编辑日志。写编辑日志的性能直接决定了分布式对象存储系统的性能。通常,磁盘的每秒进行读写操作的次数(Input/Output Operations Per Second,IOPS)是固定的。
来源于客户端的读请求和写请求均是随机的,因此节点在预设时间段内接收的写请求通常是不连续的。由于响应读请求和写请求的操作是互斥的,不能同时执行;这样,需要通过多次使用磁盘I/O才能完成将该预设时间内的写请求写入编辑日志,节点的读写性能较低,从而整个分布式对象存储系统的读写性能较低。
发明内容
有鉴于此,本发明实施例提供了一种响应写请求的方法和装置、第一节点、分布式对象存储系统,提高将写请求写入编辑日志的效率。
第一方面,本申请提供一种响应写请求的方法,应用于分布式对象存储系统,所述分布式对象存储系统包括多个节点,所述多个节点包括至少一个第一节点和至少一个第二节点。
第一节点用于汇集来源于客户端的写请求,和统一分发写请求给第二节点响应。所述第二节点用于响应该写请求,包括将所述第一写请求写入本节点的编辑日志。
在本方法中,所述第一节点接收多个写请求,将所述多个写请求连续排列;所述多个写请求连续排列后,所述第一节点将第一写请求向所有所述第二节点发送,所述第一写请求为连续排列的所述多个写请求中属于预设时间段内的所有写请求。
本申请中,由于预设时间段内的所有写请求是连续排列的,连续排列的写请求中间没有间隔读请求,因此,第二节点可以连续将该第一写请求包含的多有写请求写入编辑日志。从而第二节点仅使用需一次磁盘I/O便能完成将该预设时间内的写请求写入编辑日志,提高了第二节点响应预设时间段内的写请求的响应效率,从而提高了第二节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
一个可能设计,第一节点用于响应所述多个写请求中的至少一个写请求,响应的方式包括将该至少一个写请求写入第一节点的编辑日志;第一节点不用于响应所述多个写请求中除了该至少一个写请求以外的其它写请求。
可见,第一节点响应该预设时间段内的至少一个写请求,也是连续响应的,具体包括连续地将该预设时间段内的至少一个写请求写入编辑日志;从而第一节点仅使用需一次磁盘I/O便能完成将该预设时间内的该至少一个写请求写入编辑日志,提高了第一节点响应预设时间段内的该至少一个写请求的响应效率,从而提高了第二节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
举例说明,若所述第一节点属于响应所述第一写请求的一个节点,则所述第一节点将所述第一写请求写入本节点的编辑日志。
一个可能设计,来源于客户端的写请求,分为两类;一类是客户端直接向第一节点发送的写请求;另一类是客户端向分布式对象存储系统中除了该第一节点以外的其它节点发送的写请求。
应知,分布式对象存储系统的客户端的数量可以是多个。对应地,第一节点接收来源于该多个客户端的写清求的方式包括:
所述第一节点接收多个客户端中的任一客户端发送的第二写请求;和/或,
所述第一节点接收第三节点转发的第三写请求,所述第三节点为所述多个节点中除所述第一节点以外的任一节点,所述第三写请求由所述多个客户端中的任一客户端向所述第三节点发送。
所述第二写请求与所述第三写请求为不同写请求。
可选地,所有第二节点均属于第三节点。
一种可能设计,第三节点具有写请求队列;第三节点将所述多个客户端向所述第三节点发送的所述第三写请求添加到所述第三节点的写请求队列,将所述第三节点的写请求队列中的所述第三写请求向所述第一节点发送。这样,第三节点可以连续地从写请求队列获取到需要向第一节点发送的写请求,从而提高了转发写请求的效率;从而也避免转发写请求时,若多个写请求中间间隔有读请求,还需要响应该读请求后才能继续获取待转发的写请求。
一种可能设计,第三节点具有读请求队列。该第三节点接收客户端的读请求后,将该读请求添加到该第三节点的读请求队列中。这样,第三节点可以连续从读请求队列获取到读请求,进而连续响应读请求队列中的读请求,提高了响应读请求的效率。
一种可能设计,第一节点具有写请求队列。所述第一节点按照所述多个写请求各自的接收时间的先后顺序,将所述多个写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求,所述接收时间具体是指所述第一节点接收到写请求的时间。
一种可能设计,第一节点具有写请求队列和读请求队列。第一节点将接收的写请求添加入写请求队列中,将接收的读请求添加入读请求队列中。第一节点将写请求添加到写请求队列的实现方式参见上述可能设计。
对于读请求,所述第一节点接收多个客户端发送的读请求,将所述读请求添加入所述第一节点的读请求队列,响应所述第一节点的读请求队列中的读请求。这样,第一节点可以连续从读请求队列获取到读请求,进而连续响应读请求队列中的读请求,提高了响应读请求的效率。
第二方面,本申请提供一种响应写请求的装置,该装置包括执行第一方面或第一方 面的任意可能设计提供的响应写请求的方法的功能单元;本申请对功能单元的划分不做限定,例如可以按照响应写请求的方法的流程步骤对应划分功能单元。
第三方面,本申请提供一种响应写请求的方法,应用于分布式对象存储系统,所述分布式对象存储系统包括多个节点。其中,第一节点为所述多个节点中的任一节点;第二节点为所述多个节点中除了所述第一节点以外的任一节点。
在本方法中,所述第一节点接收第一写请求和第二写请求,所述第一写请求为客户端向所述第一节点发送的写请求,所述第二写请求为所有第二节点向所述第一节点发送的写请求;所述第一节点将所述第一写请求和所述第二写请求连续排列,得到连续排列的多个写请求;所述第一节点将预设时间段内的所述连续排列的多个写请求写入第一节点的编辑日志;若所述第一节点接收到所述预设时间段内的所述第一写请求,则所述第一节点将预设时间段内的所述第一写请求向所有第三节点发送,所述第三节点用于将所述第一写请求写入本节点的编辑日志,所述所有第三节点中的每个所述第三节点为所述所有第二节点中的节点。
本申请中,由于预设时间段内的所有写请求是连续排列的,连续排列的多个写请求中间没有间隔读请求,因此,第一节点可以连续将该多有写请求写入编辑日志。从而第一节点仅使用需一次磁盘I/O便能完成将该预设时间内的多个写请求写入编辑日志,提高了第一节点响应预设时间段内的写请求的响应效率,从而提高了第一节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
第三节点也响应从第一节点接收的该第一写请求。
应知,每个第二节点(包括第三节点)响应写请求的实现方式与第一节点响应写请求的实现方式同原理,在此不再赘述。以一个第三节点为例,该个第三节点接收客户端的写请求,和接收其它节点(包括第一节点)的写请求,将接收的所有写请求连续排列,并将预设时间段内的连续排列的多个写请求写入该个第二节点的编辑日志。
可见,分布式系统中的所述多个节点中,每个节点的响应写请求的原理均与第一节点响应写请求的原理相同;即,每个节点直接响应从客户端接收的写请求,并将该写请求向用于响应该写请求的其它节点转发,以便其它节点响应该请求。另外,每个节点还接收需要其响应的其它节点转发的写请求,将接收的该转发的写请求与从客户端直接接收的写请求连续排列后依次响应。因此,每个节点均是连续响应预设时间段内的写请求,提高了每个节点响应写请求的响应效率,从而提高了每个节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
一种可能设计,第一节点具有写请求队列,该写请求队列用于缓存写请求。所述第一节点根据所述第一写请求的接收时间和所述第二写请求的接收时间,按照接收时间的先后顺序将所述第一写请求和所述第二写请求依次添加到所述第一节点的写请求队列。这样,第一节点可以连续地从写请求队列获取到需要响应的写请求,提高了响应写请求的效率。
一种可能设计,第一节点具有读请求队列。所述第一节点接收客户端发送的读请求,将所述读请求添加入所述第一节点的读请求队列,响应所述第一节点的读请求队列中的读请求。这样,第一节点可以连续从读请求队列获取到读请求,进而连续响应读请求队列中的读请求,提高了响应读请求的效率。
第四方面,本申请提供一种响应写请求的装置,该装置包括执行第三方面或第三方面的任意可能设计提供的响应写请求的方法的功能单元;本申请对功能单元的划分不做限定,例如可以按照响应写请求的方法的流程步骤对应划分功能单元。
第五方面,本申请提供一种第一节点。分布式对象存储系统包括该第一节点。该第一节点包括至少一个处理器、存储器和通信接口。所述至少一个处理器、所述存储器和所述通信接口均通过总线连接;所述存储器存储计算机执行指令;所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述第一节点通过所述通信接口与分布式对象存储系统中的其它节点进行数据交互来执行上述第一方面或者第一方面的各种可能设计提供的响应写请求的方法,或者使得所述第一节点通过所述通信接口与分布式对象存储系统中的其它节点进行数据交互来实现第二方面中的响应写请求的装置,或者使得所述第一节点执行上述第三方面或者第三方面的各种可能设计提供的响应写请求的方法,使得所述第一节点通过所述通信接口与分布式对象存储系统中的其它节点进行数据交互来实现第四方面中的响应写请求的装置。
第六方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当分布式对象存储系统中的第一节点的至少一个处理器执行该计算机执行指令时,该第一节点执行上述第一方面或者第一方面的各种可能设计提供的响应写请求的方法,或者该第一节点执行上述第三方面或者第三方面的各种可能设计提供的响应写请求的方法。
第七方面,提供一种计算机程序产品,该计算机程序产品包括计算机执行指令,该计算机执行指令存储在计算机可读存储介质中。分布式对象存储系统中的第一节点的至少一个处理器可以从计算机可读存储介质读取该计算机执行指令,至少一个处理器执行该计算机执行指令使得该第一节点实施上述第一方面或者第一方面的各种可能设计提供的响应写请求的方法,或者第一节点执行上述第三方面或者第三方面的各种可能设计提供的响应写请求的方法。
附图说明
图1为本发明实施例提供的一种分布式对象存储系统的系统架构示意图;
图2为本发明实施例提供的响应写请求的方法的一种流程示意图;
图3为本发明实施例提供的一种分布式对象存储系统的系统架构示意图;
图4为本发明实施例提供的响应写请求的方法的一种流程示意图;
图5为本发明实施例提供的响应写请求的装置的一种逻辑架构示意图;
图6为本发明实施例提供的响应写请求的装置的一种逻辑架构示意图;
图7为本发明实施例提供的第一节点的硬件结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例提供的技术方案进行描述。
方法实施例一适用的分布式对象存储系统
分布式对象存储系统(Distributed Object-Based Storage System)包括L个节点,L为大于或等于2的正整数。图1所示的分布式对象存储系统,具有5个节点,即L等于5。
可以被配置为该节点的设备,可以是服务器、计算机或者其它具有计算能力的设备。另外,本发明实施例对该节点在分布式对象存储系统中的角色,不做限定;例如,该分布式对象存储系统可以是分布式文件系统(Distributed File System,DFS),该节点在DFS中可以是名称节点(name node),或者可以是数据节点(data node)。
本发明实施例中,该节点可以响应输入/输出(Input/Output,I/O)请求,该I/O请求可以是写请求或者读请求。如果I/O请求为写请求,则该节点将该写请求写入该节点的编辑日志(edit log)中;后续在响应该编辑日志中的写请求时,将该写请求指定的数据写入该节点的内存中,以便将该内存中的数据写入本地的存储介质中。如果I/O请求为读请求,则该节点在响应该读请求时从该节点的存储介质中获取该读请求指定的数据。可选地,存储介质可以是磁盘,硬盘或者其它可以存储数据的介质。
L个节点包括M个第一节点,M为大于或等于1的正整数。以图1为例,第一节点101为M个第一节点中的一个第一节点,如果M等于1,则不存在图1中虚线所示的第一节点102,如果M大于1,则存在图1中虚线所示的第一节点102。
从分布式对象存储系统中选择第一节点的方式可以是:从数量较多的同构节点中选择第一节点,或者选择存储容量较大的节点作为第一节点,或者选择IOPS较大的节点作为第一节点,或者使用哈希算法选择第一节点。
本发明实施例中,该第一节点是指可以用于将多个写请求连续排列的节点;其中,连续排列可以是指该多个写请求中间没有间隔任一读请求。
另外,第一节点还将第一写请求向第二节点发送。该第一写请求为连续排列后的该多个写请求中属于预设时间段内的所有写请求。
应知,该预设时间段,是指用户或者程序预先设定的时间区间。可选地,本发明实施例可以从时间轴维度,按照时间先后顺序,划分出连续的多个时间区间;所述多个时间区间中的不同时间区间可以具有相同的时间长度,或者具有不同的时间长度。所述多个时间区间一一对应地为多个预设时间段,一个时间区间对应一个预设时间段。
可选地,预设时间段的时间长度可以调整,例如根据写请求的延迟调整;如果预设时间段的时间长度较长,响应该预设时间段对应的第一写请求的响应延迟相对较长;如果预设时间段的时间长度较短,响应该预设时间段对应的第一写请求的响应延迟相对较短。
L个节点包括N个第二节点,N为大于或等于1的正整数。以图1为例,第二节点103为N个第二节点中的一个第二节点,如果N等于1,则不存在图1中虚线所示的第二节点104,如果N大于1,则存在图1中虚线所示的第二节点104。
在本发明实施例中,对于该第一写请求(即预设时间段内的所有写请求),L个节点中用于响应该第一写请求的所有节点构成响应节点集合;其中,响应节点集合包括N个第二节点。如果该第一节点也用于响应该第一写请求,则该响应节点集合包括该第一节点;如果该第一节点不用于响应该第一写请求,则该响应节点集合不包括该第一节点。
应知,不同预设时间段对应不同第一写请求。用于响应不同第一写请求的响应节点集合可能不同,具体地,用于响应不同第一写请求的响应节点集合所包括的节点可能不同;因此第二节点可能变化,N可能变化,以及第一节点对于不同第一写请求的响应角色也不同,其中,响应角色可以包括响应和不响应两种角色。以图1为例举例说明,第一 预设时间段和第二预设时间段为不同预设时间段;用于响应该第一预设时间段对应的第一写请求的4个节点包括第一节点101、第二节点103和第二节点104,因此N等于2;用于响应该第二预设时间段对应的第一写请求的1个节点为节点105,因此N等于1,并且用于响应该第一预设时间段对应的第一写请求的第二节点(第二节点103和第二节点104)不再用于响应该第二预设时间段对应的第一写请求,用于响应该第二预设时间段对应的第一写请求的第二节点为节点105;可见用于不同处理不同第一写请求的第二节点可能为不同节点,用于处理不同第一写请求的第二节点的节点个数也可能变化,以及第一节点对于不同第一写请求可能为不同响应角色。
方法实施例一
参见图2,本实施例提供了一种响应写请求的方法,该方法应用于在图1所示的分布式对象存储系统。为便于描述,下面从单个第一节点和单个第二节点的角度描述该响应写请求的方法的各步骤,例如步骤S201、步骤S202、步骤S203、步骤S204和步骤S205。
步骤S201,第一节点接收多个写请求。
具体地,用于访问分布式对象存储系统的客户端可以有一个或多个。所述多个写请求中的所有写请求都来源于客户端;可选地,所述多个写请求中的不同写请求可能来源于同一客户端,或者所述多个写请求中的不同写请求可能来源于不同客户端。
第一节点接收写请求的方式有三种。
第一种接收方式,第一节点仅接收所有客户端发送的写请求。具体地,所有客户端的写请求都仅向M个第一节点中的任一第一节点发送。
第二种接收方式,第一节点仅接收L个节点中除了M个第一节点以外的所有节点转发的来源于客户端的写请求。具体地,所有客户端的写请求都仅向L个节点中除了M个第一节点以外的节点发送;其中,客户端的一个写请求,仅向L个节点中除了M个第一节点以外的一个节点发送。L个节点中除了M个第一节点以外的所有节点,都不处理从客户端接收的写请求,直接将各自接收的写请求统一向M个第一节点中的任一第一节点发送。
第三种接收方式,第一节点接收客户端的写请求,还接收L个节点中除了M个第一节点以外的所有节点转发的来源于客户端的其它写请求。具体地,所有客户端将写请求直接发送至M个第一节点中的任一第一节点,或者将写请求向L个节点中除了M个第一节点以外的节点发送;L个节点中除了M个第一节点以外的所有节点,都不处理从客户端接收的写请求,直接将各自接收的写请求统一向M个第一节点中的任一第一节点发送。这样,第一节点接收的所有写请求,可能包括客户端直接发送的,还可能包括L个节点中除了M个第一节点以外的节点转发的来源于客户端的写请求。
步骤S202,第一节点将该多个写请求连续排列。
具体地,该多个写请求中的每个写请求,各自具有接收时间;每个写请求的接收时间是指第一节点接收到该写请求的时间。具体地,如果第一节点接收到客户端的写请求,则该接收时间具体为接收到客户端的该写请求的时间;如果第一节点接收到其它节点(L个节点中除了M个第一节点以外的节点)转发的写请求,则该接收时间具体为接收到其它节点转发的该写请求的时间。
由于第一节点接收写请求有先后顺序,所以该多个写请求中的每个写请求被第一节点接收的时间都不同。为保证数据的正确性,客户端先接收的写请求需要先处理;因此,第一节点在执行步骤S202时可以是按照该多个写请求各自的接收时间的时间先后顺序,将该多个写请求连续排列。
可选地,所述第一节点具有写请求队列,该写请求队列用于缓存写请求。具体地,第一节点在执行步骤S202时可以是按照该多个写请求各自的接收时间的时间先后顺序,依次将该多个写请求添加到该写请求队列中,实现在写请求队列中的该多个写请求是连续排列的。可选地,写请求队列配置有先进先出原则;该先进先出原则具体是指:对于相邻的两个写请求而言,先添加入该写请求队列的写请求会被先取出,相对地,后添加入该写请求队列的写请求需要等待先添加的写请求被取出后才能被取出。
具体地,第一节点在步骤S202中将该多个写请求连续排列后,在一个预设时间段结束时,如果有属于该个预设时间段内的写请求,则从连续排列的多个写请求中取出该预设时间段内的所有写请求,该预设时间段内的所有写请求构成一个第一写请求。可见,该第一写请求包含连续排列的该多个写请求中属于该预设时间段内的所有写请求。另外,在该个预设时间段结束时,执行步骤S203。
应知,在该个预设时间段结束时,如果没有属于该个预设时间段内的写请求,则不会生成该个预设时间对应的第一写请求,从而不会执行步骤S203来发送该第一写请求。
步骤S203,第一节点将第一写请求向所有第二节点发送。
对于第一写请求而言,L个节点中用于响应该第一写请求的所有节点构成响应节点集合。应知,不同该第一写请求对应的响应节点集合可能不同;具体地,如果不同该第一写请求对应的响应节点集合不同,则在不同响应节点集合中一个响应节点集合包括的至少一个节点不属于另一个响应节点集合。
其中,响应节点集合包括N个第二节点。如果该第一节点也用于响应该第一写请求,则该响应节点集合包括该第一节点;如果该第一节点不用于响应该第一写请求,则该响应节点集合不包括该第一节点
所述第二节点用于将所述第一写请求写入本节点的编辑日志(edit log)。
以此类推,随着时间推移,每在一个预设时间段结束时,如果有属于该个预设时间段内的写请求,会取出该个预设时间段内的所有写请求来构成一个第一写请求,并执行一次步骤S203将该个预设时间段对应的该个第一写请求向第二节点发送。应知,不同预设时间段对应不同第一写请求,用于处理不同第一写请求的节点可能为不同的节点,因此用于处理不同第一写请求的第二节点可能变化。
步骤S204,第二节点将第一写请求写入本节点的编辑日志。
本实施例中,用于响应该第一写请求的响应节点集合,该响应节点集合包括第二节点。
第二节点响应该第一写请求;具体地,第二节点响应该第一写请求中的每个写请求,响应的具体方式包括:将该第一写请求中的每个写请求写入该第二节点的编辑日志。
本发明实施例中,由于预设时间段内的所有写请求是连续排列的,连续排列的写请求中间没有间隔读请求,因此,第二节点可以连续将该第一写请求包含的多有写请求写入编辑日志。从而第二节点仅使用需一次磁盘I/O便能完成将该预设时间内的写请求写 入编辑日志,提高了第二节点响应预设时间段内的写请求的响应效率,从而提高了第二节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
可选地,第二节点可以将该编辑日志存储至第二节点的本地存储介质中。后续,第二节点可以响应该编辑日志中的写请求,响应的具体方式包括:先将该写请求指定的数据写入第二节点的内存,再将内存中的该数据写入本地存储介质中。
步骤S205,第一节点将第一写请求写入本节点的编辑日志。
具体地,如果该第一节点属于用于响应该第一写请求的响应节点集合中的一个节点,该第一节点响应该第一写请求。该第一节点响应该第一写请求与第二节点响应该第一写请求的响应方式一样,在此不再赘述。例如该第一节点响应该第一写请求,包括将该第一写请求写入第一节点的编辑日志。
本发明实施例中,第一节点响应该预设时间段内的至少一个写请求,也是连续响应的,具体包括连续地将该预设时间段内的至少一个写请求写入编辑日志;从而第一节点仅使用需一次磁盘I/O便能完成将该预设时间内的该至少一个写请求写入编辑日志,提高了第一节点响应预设时间段内的该至少一个写请求的响应效率,从而提高了第二节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
应知,在实现响应写请求的方法时,如果第一节点的数量为多个,每个第一节点的工作原理相同,因此不再赘述每个第一节点的工作原理,每个第一节点的工作原理参加上述对第一节点的工作原理的相关描述;另外,如果第二节点的数量为多个,每个第二节点的工作原理相同,因此不再赘述每个第二节点的工作原理,每个第二节点的工作原理参加上述对第二节点的工作原理的相关描述。
从M个第一节点的角度来看,M个第一节点在步骤S201中采用第一种接收方式或者第二种接收方式或者第三种接收方式接收写请求后,M个第一节点各自汇集各自接收到的写请求,各自执行步骤202按照时间顺序依次生成第一写请求,每个第一节点在每个预设时间段对应生成一个第一写请求;M个第一节点各自执行步骤S203向第二节点发送各自生成的第一写请求;应知,不用第一写请求可能是向不同第二节点发送。
一种可选实施方式,M个第一节点在步骤S201中采用第一种接收方式接收写请求,具体仅接收所有客户端的写请求,并且不接收其它节点的写请求。
后续,M个第一节点不响应所有写请求,即不将写请求写入本节点的编辑日志中;M个第一节点均将写请求发送至第二节点来响应,具体是以发送第一写请求(包含预设时间段的所有写请求)的方式发送。
一种可选实施方式,M个第一节点在步骤S201中采用第二种接收方式接收写请求,具体仅接收L个节点中除了M个第一节点以外的所有节点转发的来源于客户端的写请求;本可选实施方式中,所有客户端仅向L个节点中除了M个第一节点以外的节点发送写请求,不直接向M个第一节点发送写请求。
后续,M个第一节点不响应所有写请求,即不将写请求写入本节点的编辑日志中;M个第一节点均将写请求发送至第二节点来响应,具体是以发送第一写请求(包含预设时间段的所有写请求)的方式发送。
一种可选实施方式,M个第一节点在步骤S201中采用第三种接收方式接收写请求,具体仅接收所有客户端的写请求,并且接收其它节点的写请求;其中,其它节点在接收 到客户端的写请求时,也仅将该写请求向M个第一节点转发,不直接响应该写请求。
一种可选实施方式,M个第一节点在步骤S201中采用第二种接收方式或者第三种接收方式接收写请求;具体地,第三节点接收任一客户端的写请求,该第三节点为L个节点中除了M个第一节点以外的任一节点。
第三节点具有写请求队列。以单个第三节点为例,该第三节点接收客户端的写请求后,将该写请求添加到该第三节点的写请求队列中。这样,第三节点可以连续地从写请求队列获取到需要向第一节点发送的写请求,从而提高了转发写请求的效率;从而也避免转发写请求时,若多个写请求中间间隔有读请求,还需要响应该读请求后才能继续获取待转发的写请求。
可选地,第三节点将该写请求添加到该写请求队列的具体实现方式可以是,第三节点按照所述第三节点接收该多个写请求各自的接收时间的时间先后顺序,依次将该多个写请求添加到该写请求队列中。
可选地,第三节点将该写请求添加到该写请求队列的具体实现方式可以是,第三节点每接收到一个写请求,便将该个写请求添加到该写请求队列中;即,第三节点按照接收写请求的接收时间依次将多个写请求添加到该写请求队列中。
本可选实施方式中,第三节点不直接响应该写请求队列中的写请求(即从客户端接收的写请求),而是将该写请求队列中的写请求向第一节点发送。
一种可选实施方式,第一节点具有写请求队列和读请求队列。第一节点将接收的写请求添加入写请求队列中,添加的可选实现方式参见上述。另外,第一节点将接收的读请求添加入读请求队列中,响应该读请求队列中的读请求,具体的响应方式可以是第一节点根据该读请求队列中的读请求,从第一节点的存储介质中读取数据;这样,第一节点可以连续从读请求队列获取到读请求,进而连续响应读请求队列中的读请求,提高了响应读请求的效率。
本可选实施方式中,第一节点可以将写请求和读请求在写请求队列和读请求队列分别缓存,在处理写请求队列中的写请求时是连续处理写请求(处理的方式可以是生成第一写请求),同理在响应读请求队列中的读请求时是连续响应读请求。相对于现有技术将写请求和读请求随机排列的情况,本可选实施方式可以提高写请求的处理效率,提高读请求的响应效率;并且,连续处理的读请求的量越大,写请求的处理效率越高,连续处理的写请求的量越大,读请求的响应效率越高。
一种可选实施方式,L个节点中的每个节点,均具有写请求队列和读请求队列。每个节点的写请求队列的工作原理相同,具体参见上面对写请求队列(例如第一节点的写请求队列或者第三节点的写请求队列)的相关描述。每个节点的读请求队列的工作原理相同,具体参见上面对第一节点的读请求队列的相关描述。
方法实施例二适用的分布式对象存储系统
分布式对象存储系统包括L个节点,L为大于或等于2的正整数。图3所示的分布式对象存储系统,具有5个节点,即L等于5。
方法实施例二适用的分布式对象存储系统,与方法实施例一适用的分布式对象存储系统类似。例如,方法实施例二适用的分布式对象存储系统中的节点,与方法实施例一 适用的分布式对象存储系统中的节点,在分布式系统的实现方式和工作方式均类似。
不同的是,在方法实施例二适用的分布式对象存储系统中,L个节点中的任一节点,均可以接收客户端发送的写请求,还可以接收L个节点中出该任一节点以外的其它节点转发的来源于客户端的其它写请求;其中,该其它写请求是客户端向该其它节点发送并且不会直接向该任一节点发送的。另外,该其它节点在接收到客户端发送的该其它写请求时,会响应该其它写请求,并且还将该其它写请求向用于响应该其它写请求的节点(包括该任一节点)发送。
另外,L个节点中的该任一节点,响应从客户端直接接收的写请求,并将该写请求向用于响应该写请求的所有节点中除了该任一节点的其它节点发送。
方法实施例二
参见图4,本实施例提供了一种响应写请求的方法,该方法应用于在图3所示的分布式对象存储系统。为便于描述,下面从第一节点的角度描述该响应写请求的方法的各步骤,例如步骤S401、步骤S402和步骤S403。
该第一节点为L个节点中的任一节点。第二节点为L个节点中除了该个第一节点以外的任一节点。
步骤S401,第一节点接收客户端发送的第一写请求,和接收第二节点转发的第二写请求。
其中,该第一写请求为客户端直接向该第一节点发送的写请求。因此,该第一写请求不会经过第二节点转发。
该第二写请求为所有第二节点转发的来源于客户端的写请求。本实施例中,客户端向第二节点发送第二写请求,第二节点将该第二写请求向用于响应该第二写请求的所有节点(包括第一节点)发送;另外,第二节点还响应该第二写请求,响应的方式可以包括将该第二写请求写入该第二节点的编辑日志中。
应知,如果写请求只需要一个节点响应,则该写请求会被客户端直接发送至用于响应该写请求的该个节点,即该写请求属于第一写请求;因此在只需要一个节点响应写请求的场景,不存在第二写请求。
步骤S402,第一节点将第一写请求和第二写请求连续排列,得到连续排列的多个写请求。
连续排列的定义参见方法实施例一适用的分布式对象存储系统中对连续排列的定义。
第一节点在步骤S402中实现连续排列的实现方式,与上述在方法实施例一的步骤S202中实现连续排列的实现方式类似,具体参见上面对步骤S202实现连续排列的具体描述,在此不再赘述。
可选地,所述第一节点根据所述第一写请求的接收时间和所述第二写请求的接收时间,按照接收时间的先后顺序将所述第一写请求和所述第二写请求连续排列。其中,所述第一写请求的接收时间是指所述第一节点接收所述第一写请求的时间。所述第二写请求的接收时间是指所述第一节点接收所述第二写请求的时间。
所述第一节点按照接收时间的先后顺序将写请求连续排列的实现方式,具体参见上 述在方法实施例一中的相应描述,在此不再赘述。
可选地,所述第一节点根据所述第一写请求的接收时间和所述第二写请求的接收时间,按照接收时间的先后顺序将所述第一写请求和所述第二写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
所述第一节点按照接收时间的先后顺序将写请求依次添加到写请求队列来实现连续排列的实现方式,具体参见上述在方法实施例一中的相应描述,在此不再赘述。
步骤S403,第一节点将预设时间段内的所述连续排列的多个写请求写入第一节点的编辑日志。
该预设时间段的定义和该预设时间段的划分方法,参见方法实施例一和方法实施例一适用的分布式对象存储系统中的相应描述,在此不再赘述。
在本实施例中,该预设时间段内的多个写请求,可能包括第一写请求,也可能包括第二写请求。第一节点将写请求该预设时间段内的连续排列的多个写请求写入第一节点的编辑日志的实现方式,与方法实施例一中将第一写请求写入编辑日志的实现方式类似,在此不再赘述,具体参见方法实施例一中对将第一写请求写入编辑日志的实现方式的相关描述。
本实施例中,由于预设时间段内的所有写请求是连续排列的,连续排列的多个写请求中间没有间隔读请求,因此,第一节点可以连续将该多有写请求写入编辑日志。从而第一节点仅使用需一次磁盘I/O便能完成将该预设时间内的多个写请求写入编辑日志,提高了第一节点响应预设时间段内的写请求的响应效率,从而提高了第一节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
如果第一写请求只需要一个节点(即第一节点)响应,则第一节点响应该第一写请求后,不会将该第一写请求发送至L个节点中的其它节点(即第二节点)。
如果用于响应该第一写请求的节点包括多个节点,则本实施例执行步骤S404。
步骤S404,若所述第一节点接收到所述预设时间段内的所述第一写请求,则所述第一节点将预设时间段内的所述第一写请求向所有第三节点发送。
本实施例中,用于响应该第一写请求的所有节点包括第一节点和第三节点,所述第三节点为用于响应该第一写请求的所有节点中除了第一节点以外的任一节点。可见,每个第三节点均属于第二节点,即所有第三节点中的每个第三节点为所有第二节点中的节点。
第三节点响应该第一写请求的方式可以包括将所述第一写请求写入本节点的编辑日志。
本实施例中,第二节点(包括第三节点)响应写请求的实现方式与第一节点响应写请求的实现方式同原理,在此不再赘述。以一个第二节点为例,该个第二节点接收客户端的写请求,以及接收其它节点(包括第一节点和其它第二节点)的写请求;该个第二节点将接收的所有写请求连续排列,并将预设时间段内的连续排列的多个写请求写入该个第二节点的编辑日志;如果该个第二节点接收到客户端发送的属于该预设时间段内的写请求,则该个第二节点将客户端发送的属于该预设时间段内的写请求向第四节点发送,第四节点是指用于响应客户端发送的属于该预设时间段内的写请求的所有节点中除了该个第二节点的任一节点。
可见,分布式系统中的L个节点中,每个节点的响应写请求的原理均与第一节点响应写请求的原理相同;即,每个节点直接响应从客户端接收的写请求,并将该写请求向用于响应该写请求的其它节点转发,以便其它节点响应该请求。另外,每个节点还接收需要其响应的其它节点转发的写请求,将接收的该转发的写请求与从客户端直接接收的写请求连续排列后依次响应。因此,每个节点均是连续响应预设时间段内的写请求,提高了每个节点响应写请求的响应效率,从而提高了每个节点的读写性能,进而提高了整个分布式对象存储系统的读写性能。
一种可选实施方式,L个节点中的每个节点(第一节点或者第二节点),均具有写请求队列和读请求队列。每个节点的写请求队列的工作原理相同,具体参见方法实施例一和方法实施例二对写请求队列的相关描述。每个节点的读请求队列的工作原理相同,具体参见方法实施例一中对读请求队列的相关描述。
软件实现的装置实施例一
本发明实施例提供一种响应写请求的装置。
该装置应用于方法实施例一适用的分布式对象存储系统,所述分布式对象存储系统包括多个节点(上述方法实施例一示意为L个节点),所述多个节点包括至少一个第一节点和至少一个第二节点。
所述装置部署在所述第一节点;具体的部署方式是:在所述第一节点上部署所述装置包括的用于执行上述方法实施例一提供的响应写请求的方法的各功能单元。应知,本发明实施例对各功能单元的划分方式在此不做限定。
下面提供一种与上述方法实施例一提供的响应写请求的方法对应的功能单元作为举例,参见图5,所述装置500包括接收单元501、排列单元502和发送单元503。
接收单元501,用于接收多个写请求;
排列单元502,用于将所述多个写请求连续排列;
发送单元503,用于在所述多个写请求连续排列后,将第一写请求向所有所述第二节点发送,所述第二节点用于将所述第一写请求写入本节点的编辑日志,所述第一写请求为连续排列的所述多个写请求中属于预设时间段内的所有写请求。
可选地,所述排列单元502,用于将所述多个写请求连续排列,包括:
所述排列单元502,用于按照所述多个写请求各自的接收时间的先后顺序,将所述多个写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
可选地,所述装置还包括:响应单元504,用于若所述第一节点属于响应所述第一写请求的一个节点,则将所述第一写请求写入本节点的编辑日志。
可选地,所述接收单元501,用于接收多个写请求,包括:
所述接收单元501,用于接收多个客户端中的任一客户端发送的第二写请求;和/或,用于接收第三节点转发的第三写请求,所述第三节点为所述多个节点中除所述第一节点以外的任一节点,所述第三写请求由所述多个客户端中的任一客户端向所述第三节点发送;
其中,所述第二写请求与所述第三写请求为不同写请求。
可选地,所述第三节点具有写请求队列;所述第三节点用于将所述多个客户端向所述第三节点发送的所述第三写请求添加到所述第三节点的写请求队列,以及将所述第三节点的写请求队列中的所述第三写请求向所述第一节点发送。
可选地,所述接收单元501,还用于接收多个客户端发送的读请求;
所述排列单元502,用于将所述读请求添加入所述第一节点的读请求队列;
所述装置包括:响应单元504,用于响应所述第一节点的读请求队列中的读请求。
软件实现的装置实施例二
本发明实施例提供一种响应写请求的装置。
该装置应用于方法实施例二适用的分布式对象存储系统,所述分布式对象存储系统包括多个节点(上述方法实施例一示意为L个节点),第一节点为所述多个节点中的任一节点。
所述装置部署在所述第一节点;具体的部署方式是:在所述第一节点上部署所述装置包括的用于执行上述方法实施例二提供的响应写请求的方法的各功能单元。应知,本可选方式对各功能单元的划分方式在此不做限定。
下面提供一种与上述方法实施例二提供的响应写请求的方法对应的功能单元作为举例,参见图6,所述装置600包括接收单元601、排列单元602、响应单元603和发送单元604。
接收单元601,用于接收第一写请求和第二写请求,所述第一写请求为客户端向所述第一节点发送的写请求,所述第二写请求为所有第二节点向所述第一节点发送的写请求,所述第二节点为所述多个节点中除了所述第一节点以外的任一节点;
排列单元602,用于将所述第一写请求和所述第二写请求连续排列,得到连续排列的多个写请求;
响应单元603,用于将预设时间段内的所述连续排列的多个写请求写入第一节点的编辑日志;
发送单元604,用于若所述第一节点接收到所述预设时间段内的所述第一写请求,则所述第一节点将预设时间段内的所述第一写请求向所有第三节点发送,所述第三节点用于将所述第一写请求写入本节点的编辑日志,所述所有第三节点中的每个所述第三节点为所述所有第二节点中的一个节点。
可选地,所述排列单元602,用于将所述第一写请求和所述第二写请求连续排列,包括:
所述排列单元602,用于根据所述第一写请求的接收时间和所述第二写请求的接收时间,按照接收时间的先后顺序将所述第一写请求和所述第二写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
可选地,所述接收单元601,用于接收客户端发送的读请求;
所述排列单元602,用于将所述读请求添加入所述第一节点的读请求队列;
所述响应单元603,用于响应所述第一节点的读请求队列中的读请求。
可选地,所述第二节点用于将本节点的所述第一写请求写入本节点的编辑日志。
第一节点的硬件实施例
分布式对象存储系统部署在多个节点上。具体执行方法实施例一或方法实施例二提供的响应写请求的方法的硬件主体是该多个节点中的任一第一节点;或者,部署上述装置实施例一或装置实施例二提供的响应写请求的装置的硬件主体可以是该第一节点。该第一节点在图7中示意为第一节点700。
参见图7,第一节点700包括至少一个处理器701、存储器702和通信接口703;所述至少一个处理器701、所述存储器702和所述通信接口703均通过总线704连接;
所述存储器702,用于存储计算机执行指令;
所述至少一个处理器701,用于执行所述存储器702存储的计算机执行指令,使得所述第一节点700通过所述通信接口703与分布式对象存储系统中的其它节点进行数据交互来执行上述方法实施例提供的响应写请求的方法,或者使得所述第一节点700通过所述通信接口703与分布式对象存储系统中的其它节点进行数据交互来实现响应写请求的装置的部分或者全部功能。
至少一个处理器701,可以包括不同类型的处理器701,或者包括相同类型的处理器701;处理器701可以是以下的任一种:中央处理器(Central Processing Unit,简称CPU)、ARM处理器、现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、专用处理器等具有计算处理能力的器件。一种可选实施方式,所述至少一个处理器701还可以集成为众核处理器。
存储器702可以是以下的任一种或任一种组合:随机存取存储器(Random Access Memory,简称RAM)、只读存储器(read only memory,简称ROM)、非易失性存储器(non-volatile memory,简称NVM)、固态硬盘(Solid State Drives,简称SSD)、机械硬盘、磁盘、磁盘整列等存储介质。
通信接口703用于第一节点700与其它设备(例如分布式对象存储系统中的其它节点)进行数据交互。通信接口703可以是以下的任一种或任一种组合:网络接口(例如以太网接口)、无线网卡等具有网络接入功能的器件。
该总线704可以包括地址总线、数据总线、控制总线等,为便于表示,图7用一条粗线表示该总线。总线704可以是以下的任一种或任一种组合:工业标准体系结构(Industry Standard Architecture,简称ISA)总线、外设组件互连标准(Peripheral Component Interconnect,简称PCI)总线、扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等有线数据传输的器件。
分布式对象存储系统的实施例
本实施例提供一种分布式对象存储系统,该分布式对象存储系统可以是方法实施例一所适用的分布式对象存储系统,如图1所示。可选地,该分布式对象存储系统中的第一节点执行方法实施例一提供的响应写请求的方法。可选地,在该分布式对象存储系统中的第一节点上部署有装置实施例一提供的响应写请求的装置。
本实施例提供一种分布式对象存储系统,该分布式对象存储系统可以是方法实施例二所适用的分布式对象存储系统,如图2所示。可选地,该分布式对象存储系统中的第一节点执行方法实施例二提供的响应写请求的方法。可选地,在该分布式对象存储系统 中的第一节点上部署有装置实施例二提供的响应写请求的装置。
应当理解,上述“第一节点”中的“第一”,上述“第二节点”中的“第二”,上述“第三节点”中的“第三”,上述“第四节点”中的“第四”,仅用于相互区分;类似地,上述“第一写请求”中的“第一”,上述“第二写请求”中的“第二”,上述“第三写请求”中的“第三”,上述“第四写请求”中的“第四”,也仅用于相互区分。即,“第一”、“第二”,“第三”和“第四”并不代表特指,也不代表它们之间存在顺序关系。在不脱离本发明实施例保护范围的情况下,可以对互换名称或者改名称。例如,“第一节点”、“第二节点”互换名称,或者将“第一节点”改称为“第五节点”和将“第二节点”改称为“第六节点”。
以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的保护范围。

Claims (23)

  1. 一种响应写请求的方法,应用于分布式对象存储系统,所述分布式对象存储系统包括多个节点,所述多个节点包括至少一个第一节点和至少一个第二节点;其特征在于,所述方法包括:
    所述第一节点接收多个写请求;
    所述第一节点将所述多个写请求连续排列;
    所述多个写请求连续排列后,所述第一节点将第一写请求向所有所述第二节点发送,所述第二节点用于将所述第一写请求写入本节点的编辑日志,所述第一写请求为连续排列的所述多个写请求中属于预设时间段内的所有写请求。
  2. 根据权利要求1所述的方法,其特征在于,所述第一节点将所述多个写请求连续排列,包括:
    所述第一节点按照所述多个写请求各自的接收时间的先后顺序,将所述多个写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    若所述第一节点属于响应所述第一写请求的一个节点,则所述第一节点将所述第一写请求写入本节点的编辑日志。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述第一节点接收多个写请求,包括:
    所述第一节点接收多个客户端中的任一客户端发送的第二写请求;和/或,所述第一节点接收第三节点转发的第三写请求,所述第三节点为所述多个节点中除所述第一节点以外的任一节点,所述第三写请求由所述多个客户端中的任一客户端向所述第三节点发送;
    其中,所述第二写请求与所述第三写请求为不同写请求。
  5. 根据权利要求4所述的方法,其特征在于,所述第三节点具有写请求队列;
    所述第三节点用于将所述多个客户端向所述第三节点发送的所述第三写请求添加到所述第三节点的写请求队列,以及将所述第三节点的写请求队列中的所述第三写请求向所述第一节点发送。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述方法还包括:
    所述第一节点接收多个客户端发送的读请求;
    所述第一节点将所述读请求添加入所述第一节点的读请求队列;
    所述第一节点响应所述第一节点的读请求队列中的读请求。
  7. 一种响应写请求的方法,应用于分布式对象存储系统,所述分布式对象存储系统包括多个节点;其特征在于,所述方法包括:
    所述第一节点接收第一写请求和第二写请求,所述第一写请求为客户端向所述第一节点发送的写请求,所述第二写请求为所有第二节点向所述第一节点发送的写请求,所述第一节点为所述多个节点中的任一节点,所述第二节点为所述多个节点中除了所述第一节点以外的任一节点;
    所述第一节点将所述第一写请求和所述第二写请求连续排列,得到连续排列的多个写请求;
    所述第一节点将预设时间段内的所述连续排列的多个写请求写入第一节点的编辑 日志;
    若所述第一节点接收到所述预设时间段内的所述第一写请求,则所述第一节点将预设时间段内的所述第一写请求向所有第三节点发送,所述第三节点用于将所述第一写请求写入本节点的编辑日志,所述所有第三节点中的每个所述第三节点为所述所有第二节点中的节点。
  8. 根据权利要求7所述的方法,其特征在于,所述第一节点将所述第一写请求和所述第二写请求连续排列,包括:
    所述第一节点根据所述第一写请求的接收时间和所述第二写请求的接收时间,按照接收时间的先后顺序将所述第一写请求和所述第二写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
  9. 根据权利要求7或8所述的方法,其特征在于,所述方法还包括:
    所述第一节点接收客户端发送的读请求;
    所述第一节点将所述读请求添加入所述第一节点的读请求队列;
    所述第一节点响应所述第一节点的读请求队列中的读请求。
  10. 根据权利要求7至9任一项所述的方法,其特征在于,所述第二节点用于将本节点的所述第一写请求写入本节点的编辑日志。
  11. 一种响应写请求的装置,应用于分布式对象存储系统,所述分布式对象存储系统包括多个节点,所述多个节点包括至少一个第一节点和至少一个第二节点,所述装置部署在所述第一节点;其特征在于,所述装置包括:
    接收单元,用于接收多个写请求;
    排列单元,用于将所述多个写请求连续排列;
    发送单元,用于在所述多个写请求连续排列后,将第一写请求向所有所述第二节点发送,所述第二节点用于将所述第一写请求写入本节点的编辑日志,所述第一写请求为连续排列的所述多个写请求中属于预设时间段内的所有写请求。
  12. 根据权利要求11所述的装置,其特征在于,所述排列单元,用于将所述多个写请求连续排列,包括:
    所述排列单元,用于按照所述多个写请求各自的接收时间的先后顺序,将所述多个写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
  13. 根据权利要求11或12所述的装置,其特征在于,所述装置还包括:
    响应单元,用于若所述第一节点属于响应所述第一写请求的一个节点,则将所述第一写请求写入本节点的编辑日志。
  14. 根据权利要求11至13任一项所述的装置,其特征在于,所述接收单元,用于接收多个写请求,包括:
    所述接收单元,用于接收多个客户端中的任一客户端发送的第二写请求;和/或,用于接收第三节点转发的第三写请求,所述第三节点为所述多个节点中除所述第一节点以外的任一节点,所述第三写请求由所述多个客户端中的任一客户端向所述第三节点发送;
    其中,所述第二写请求与所述第三写请求为不同写请求。
  15. 根据权利要求14所述的装置,其特征在于,所述第三节点具有写请求队列;
    所述第三节点用于将所述多个客户端向所述第三节点发送的所述第三写请求添加到所述第三节点的写请求队列,以及将所述第三节点的写请求队列中的所述第三写请求向所述第一节点发送。
  16. 根据权利要求11至15任一项所述的装置,其特征在于,
    所述接收单元,还用于接收多个客户端发送的读请求;
    所述排列单元,用于将所述读请求添加入所述第一节点的读请求队列;
    所述装置包括:响应单元,用于响应所述第一节点的读请求队列中的读请求。
  17. 一种响应写请求的装置,应用于分布式对象存储系统,所述分布式对象存储系统包括多个节点,第一节点为所述多个节点中的任一节点,所述装置部署在所述第一节点;其特征在于,所述装置包括:
    接收单元,用于接收第一写请求和第二写请求,所述第一写请求为客户端向所述第一节点发送的写请求,所述第二写请求为所有第二节点向所述第一节点发送的写请求,所述第二节点为所述多个节点中除了所述第一节点以外的任一节点;
    排列单元,用于将所述第一写请求和所述第二写请求连续排列,得到连续排列的多个写请求;
    响应单元,用于将预设时间段内的所述连续排列的多个写请求写入第一节点的编辑日志;
    发送单元,用于若所述第一节点接收到所述预设时间段内的所述第一写请求,则所述第一节点将预设时间段内的所述第一写请求向所有第三节点发送,所述第三节点用于将所述第一写请求写入本节点的编辑日志,所述所有第三节点中的每个所述第三节点为所述所有第二节点中的节点。
  18. 根据权利要求17所述的装置,其特征在于,所述排列单元,用于将所述第一写请求和所述第二写请求连续排列,包括:
    所述排列单元,用于根据所述第一写请求的接收时间和所述第二写请求的接收时间,按照接收时间的先后顺序将所述第一写请求和所述第二写请求依次添加到所述第一节点的写请求队列,所述第一节点的写请求队列用于缓存写请求。
  19. 根据权利要求17或18所述的装置,其特征在于,
    所述接收单元,用于接收客户端发送的读请求;
    所述排列单元,用于将所述读请求添加入所述第一节点的读请求队列;
    所述响应单元,用于响应所述第一节点的读请求队列中的读请求。
  20. 根据权利要求17至19任一项所述的装置,其特征在于,所述第二节点用于将本节点的所述第一写请求写入本节点的编辑日志。
  21. 一种第一节点,其特征在于,其特征在于,包括至少一个处理器、存储器和通信接口;所述至少一个处理器、所述存储器和所述通信接口均通过总线连接;
    所述存储器,用于存储计算机执行指令;
    所述至少一个处理器,用于执行所述存储器存储的计算机执行指令,使得所述第一节点通过所述通信接口与分布式对象存储系统中的其它节点进行数据交互来执行权利要求1至6任一项所述的拨测方法,所述分布式对象存储系统包括所述第一节点。
  22. 一种第一节点,其特征在于,其特征在于,包括至少一个处理器、存储器和通信接口;所述至少一个处理器、所述存储器和所述通信接口均通过总线连接;
    所述存储器,用于存储计算机执行指令;
    所述至少一个处理器,用于执行所述存储器存储的计算机执行指令,使得所述第一节点通过所述通信接口与分布式对象存储系统中的其它节点进行数据交互来执行权利要求7至10任一项所述的拨测方法,所述分布式对象存储系统包括所述第一节点。
  23. 一种分布式对象存储系统,其特征在于,所述分布式对象存储系统为权利要求1至22任一项所述的分布式对象存储系统。
PCT/CN2017/087198 2016-11-07 2017-06-05 响应写请求的方法和装置 WO2018082302A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610988392.6 2016-11-07
CN201610988392.6A CN106557282B (zh) 2016-11-07 2016-11-07 响应写请求的方法和装置

Publications (1)

Publication Number Publication Date
WO2018082302A1 true WO2018082302A1 (zh) 2018-05-11

Family

ID=58444103

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/087198 WO2018082302A1 (zh) 2016-11-07 2017-06-05 响应写请求的方法和装置

Country Status (2)

Country Link
CN (1) CN106557282B (zh)
WO (1) WO2018082302A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865769A (zh) * 2018-08-28 2020-03-06 阿里巴巴集团控股有限公司 处理读/写请求的方法、网络存储系统及电子设备

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557282B (zh) * 2016-11-07 2019-08-23 华为技术有限公司 响应写请求的方法和装置
CN110278008B (zh) 2018-03-16 2021-05-04 华为技术有限公司 一种电力线通信方法、装置及计算机存储介质
CN112395243B (zh) * 2019-08-16 2023-04-28 上海寒武纪信息科技有限公司 处理器的访问方法及装置
CN112395245B (zh) * 2019-08-16 2023-04-28 上海寒武纪信息科技有限公司 处理器的访问装置、方法及计算机设备
CN112395244B (zh) * 2019-08-16 2023-04-28 上海寒武纪信息科技有限公司 处理器的访问装置及方法
CN113253924A (zh) * 2021-04-28 2021-08-13 百果园技术(新加坡)有限公司 数据处理方法、装置、电子设备及计算机可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662459A (zh) * 2012-04-22 2012-09-12 复旦大学 利用固态硬盘与机械硬盘混合存储减少服务器能源消耗的方法
CN103023805A (zh) * 2012-11-22 2013-04-03 北京航空航天大学 一种MapReduce系统
CN103631624A (zh) * 2013-11-29 2014-03-12 华为技术有限公司 读写请求的处理方法和装置
CN103986694A (zh) * 2014-04-23 2014-08-13 清华大学 分布式计算机数据存储系统中多副本一致性的控制方法
US20150058291A1 (en) * 2013-08-26 2015-02-26 Vmware, Inc. Log-structured storage device format
CN106557282A (zh) * 2016-11-07 2017-04-05 华为技术有限公司 响应写请求的方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268318B (zh) * 2013-04-16 2016-04-13 华中科技大学 一种强一致性的分布式键值数据库系统及其读写方法
CN105262680A (zh) * 2015-10-21 2016-01-20 浪潮(北京)电子信息产业有限公司 一种应用于云存储系统的多线程nas网关

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662459A (zh) * 2012-04-22 2012-09-12 复旦大学 利用固态硬盘与机械硬盘混合存储减少服务器能源消耗的方法
CN103023805A (zh) * 2012-11-22 2013-04-03 北京航空航天大学 一种MapReduce系统
US20150058291A1 (en) * 2013-08-26 2015-02-26 Vmware, Inc. Log-structured storage device format
CN103631624A (zh) * 2013-11-29 2014-03-12 华为技术有限公司 读写请求的处理方法和装置
CN103986694A (zh) * 2014-04-23 2014-08-13 清华大学 分布式计算机数据存储系统中多副本一致性的控制方法
CN106557282A (zh) * 2016-11-07 2017-04-05 华为技术有限公司 响应写请求的方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865769A (zh) * 2018-08-28 2020-03-06 阿里巴巴集团控股有限公司 处理读/写请求的方法、网络存储系统及电子设备
CN110865769B (zh) * 2018-08-28 2023-06-20 阿里巴巴集团控股有限公司 处理读/写请求的方法、网络存储系统及电子设备

Also Published As

Publication number Publication date
CN106557282A (zh) 2017-04-05
CN106557282B (zh) 2019-08-23

Similar Documents

Publication Publication Date Title
WO2018082302A1 (zh) 响应写请求的方法和装置
US11099752B1 (en) Application performance in replication environments
WO2018076759A1 (zh) 基于区块链的多链管理方法、系统、电子装置及存储介质
US10785350B2 (en) Heartbeat in failover cluster
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
WO2018058998A1 (zh) 一种数据加载方法、终端和计算集群
WO2014101044A1 (zh) 分布式存储系统中的分区平衡方法、装置及服务器
US20090292953A1 (en) Modifying connection records
WO2021082401A1 (zh) 一种数据的上传方法、系统、装置及电子设备
CN106815251A (zh) 分布式数据库系统、数据库访问方法及装置
KR20170013319A (ko) 데이터 관리 방법, 노드, 그리고 데이터베이스 클러스터를 위한 시스템
WO2017096942A1 (zh) 一种文件存储系统、数据调度方法及数据节点
WO2020256831A1 (en) Smart contract information redirect to updated version of smart contract
CN104317716A (zh) 分布式节点间的数据传输方法及分布式节点设备
WO2018157605A1 (zh) 一种集群文件系统中消息传输的方法及装置
CN106547477A (zh) 用于在线地减少缓存设备的方法和装置
KR102031589B1 (ko) 관계 체인 처리 방법 및 시스템, 그리고 저장 매체
CN105991633B (zh) 会话日志处理方法及装置
WO2017054714A1 (zh) 磁盘阵列的读方法及装置
WO2019223445A1 (zh) 硬盘读写控制方法、装置、电子设备及存储介质
WO2012171363A1 (zh) 分布式缓存系统中的数据操作方法和装置
US9626444B2 (en) Continuously blocking query result data for a remote query
WO2022160206A1 (zh) 一种片上系统异常处理方法、片上系统及其装置
WO2018077123A1 (zh) 内存访问方法及多处理器系统
US9716660B2 (en) Hierarchical enforcement of service flow quotas

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: 17867624

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: 17867624

Country of ref document: EP

Kind code of ref document: A1