Storage system, request processing method, and switch
A storage system includes a switch and a plurality of storage nodes. The switch is configured to receive a first request from a client. The first request includes an identifier of a storage partition. The switch queries an entry in a forwarding table based on the identifier to determine a target storage node in the plurality of storage nodes. The entry includes a mapping relationship between the identifier and the target storage node. The switch sends the first request to the target storage node. The target storage node is configured to receive the first request from the switch.
1 . A storage system comprising:
a plurality of storage nodes comprising a target storage node;
a switch configured to:
receive a first request from a client, wherein the first request comprises an identifier of a storage partition;
query an entry in a forwarding table based on the identifier to determine the target storage node in the plurality of storage nodes, wherein the entry comprises a mapping relationship between the identifier and the target storage node; and
send the first request to the target storage node; and
a controller configured to:
receive a second request from the client;
determine the target storage node in the plurality of storage nodes based on the second request; and
send the second request to the target storage node,
wherein the target storage node is configured to:
receive the second request from the controller;
generate the identifier of the storage partition based on the second request; and
send the identifier to the controller,
wherein the controller is further configured to:
receive the identifier from the target storage node; and
send the entry that comprises the mapping relationship between the identifier and
the target storage node to the switch, and
wherein the switch is further configured to:
receive the entry from the controller; and
update the forwarding table based on the entry.
2 . The storage system of claim 1 , wherein the target storage node is configured to:
receive the first request from the switch;
generate a request processing result based on the first request; and
send the request processing result to the switch, and
wherein the switch is further configured to:
receive the request processing result; and
send the request processing result to the client.
3 . The storage system of claim 1 , wherein the target storage node is further configured to:
allocate a storage resource from a server partition corresponding to the identifier of the storage partition based on the first request when the first request is a data write request; and
send an address of the target storage node to the switch;
and the switch is further configured to:
receive the address of the target storage node; and
send a response message comprising the address of the target storage node to the client.
4 . The storage system of claim 1 , wherein the controller is further configured to update a partition mapping table in the controller based on the mapping relationship.
5 . The storage system of claim 1 , wherein the controller is further configured to update a storage node status table in the controller based on the mapping relationship.
6 . A request processing method implemented by a storage system comprising a switch and a plurality of storage nodes, wherein the plurality of storage nodes comprises a target storage node, and wherein the request processing method comprises:
receiving, by the switch, a first request from a client, wherein the first request comprises an identifier of a storage partition;
querying, by the switch, an entry in a forwarding table based on the identifier to determine the target storage node in the plurality of storage nodes, wherein the entry comprises a mapping relationship between the identifier and the target storage node;
sending, by the switch, the first request to the target storage node;
receiving, by the target storage node, the first request from the switch;
receiving, by a controller of the storage system, a second request from the client;
determining, by the controller, the target storage node in the plurality of storage nodes based on the second request;
sending, by the controller, the second request to the target storage node;
receiving, by the target storage node, the second request from the controller;
generating, by the target storage node, the identifier of the storage partition based on the second request;
sending, by the target storage node, the identifier to the controller;
receiving, by the controller, the identifier from the target storage node;
sending, by the controller, the entry that comprises the mapping relationship between the identifier and the target storage node to the switch; and
receiving, by the switch, the entry from the controller, and updating the forwarding table based on the entry.
7 . The request processing method of claim 6 , further comprising:
generating, by the target storage node, a request processing result based on the first request;
sending, by the target storage node, the request processing result to the switch; and
receiving, by the switch, the request processing result, and sending the request processing result to the client.
8 . The request processing method of claim 6 , further comprising:
allocating, by the target storage node, a storage resource from a server partition corresponding to the identifier of the storage partition based on the first request when the first request is a data write request;
sending, by the target storage node, an address of the target storage node to the switch;
receiving, by the switch, the address of the target storage node; and
sending, by the switch, a response message comprising the address of the target storage node to the client.
9 . The request processing method of claim 8 , further comprising updating, by the controller, a partition mapping table in the controller based on the mapping relationship.
10 . The request processing method of claim 8 , further comprising updating, by the controller, a storage node status table in the controller based on the mapping relationship.
11 . The storage system of claim 1 , wherein the target storage node is further configured to:
read data from the storage partition based on the first request to obtain read data when the first request is a data read request; and
send the read data to the switch.
12 . The storage system of claim 3 , wherein the switch is further configured to:
receive a data write command from the client, wherein the data write command comprises to-be-written data; and
send the data write command to the target storage node based on the forwarding table.
13 . The storage system of claim 12 ,
wherein the target storage node is further configured to:
write the to-be-written data to the storage resource based on the data write command; and
send a data write result to the switch; and
wherein the switch is further configured to:
receive the data write result; and
send the data write result to the client.
14 . The storage system of claim 4 , wherein the controller has a function of a name server, and wherein the partition mapping table comprises a mapping relationship between a virtual name server and a storage node.
15 . The storage system of claim 1 , wherein the entry in the forwarding table further comprises an input port and an output port corresponding to the target storage node.
16 . The request processing method of claim 6 , wherein the target storage node is further configured to:
read data from the storage partition based on the first request to obtain read data when the first request is a data read request; and
send the read data to the switch.
17 . The request processing method of claim 8 , wherein the switch is further configured to:
receive a data write command from the client, wherein the data write command comprises to-be-written data; and
send the data write command to the target storage node based on the forwarding table.
18 . The request processing method of claim 17 , wherein
the target storage node is further configured to:
write the to-be-written data to the storage resource based on the data write command; and
send a data write result to the switch; and
wherein the switch is further configured to:
receive the data write result; and
send the data write result to the client.
19 . The request processing method of claim 9 , wherein the controller has a function of a name server, and wherein the partition mapping table comprises a mapping relationship between a virtual name server and a storage node.
20 . The request processing method of claim 6 , wherein the entry in the forwarding table further comprises an input port and an output port corresponding to the target storage node.