Method and apparatus for managing blocks in a storage system

CN115421653BActive Publication Date: 2026-08-07BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING OCEANBASE TECHNOLOGY CO LTD
Filing Date
2022-08-25
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

然而,在存储系统中一个主控服务器需要同时关联多台块服务器,如果在分配块的过程中,每个块服务器都与主控服务器进行交互,会导致主控服务器的负载较大

Benefits of technology

[0046]在块分配过程中,主控服务器通过将第一映射关系发送给客户端,并由客户端将第一映射关系发送给目标块服务器,以减少分配块的过程中主控服务器与块服务器之间的交互,降低分配块的过程中主控服务器的负载。避免了传统的块分配过程中,需要由主控服务器将第一映射关系发送给块服务器,导致主控服务器的负载较高。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421653B_ABST
    Figure CN115421653B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for managing blocks in a storage system. A storage space in the storage system is divided into at least one block, and the method comprises: sending an allocation request to a master server in the storage system, the allocation request being used to request allocation of a target block for a client of the storage system from the at least one block; receiving a first response message sent by the master server in response to the allocation request, the first response message containing a first mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block; and sending the first mapping relationship to a block server to which the target block belongs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of storage system technology, and specifically to a method and apparatus for managing blocks in a storage system. Background Technology

[0002] In traditional block allocation, when a client requests a block from the master server, the master server needs to interact with block servers to create the block. However, in a storage system, a master server needs to be associated with multiple block servers simultaneously. If each block server interacts with the master server during the block allocation process, it will result in a high load on the master server. Summary of the Invention

[0003] In view of this, the present disclosure aims to provide a method, apparatus and native distributed storage system for managing blocks in a storage system.

[0004] In a first aspect, a method for managing blocks in a storage system is provided, wherein the storage space in the storage system is divided into at least one block, the method comprising: sending an allocation request to a master server in the storage system, the allocation request being used to request the allocation of a target block from the at least one block for a client of the storage system; receiving a first response message sent by the master server in response to the allocation request, the first response message containing a first mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block; and sending the first mapping relationship to a block server to which the target block belongs.

[0005] In one possible implementation, the first response message further includes first indication information, which indicates a first release count, the number of times the target block has been released before it is allocated to the client.

[0006] In one possible implementation, the method further includes sending the first indication information to the block server to which the target block belongs.

[0007] In one possible implementation, the first mapping relationship and / or the first indication information are carried in a write request, which is used to request the writing of first data into the target block.

[0008] In one possible implementation, the method further includes: sending a release request to the master control server, the release request being used to request the release of the target block; and receiving a second response message sent by the master control server in response to the release request, the second response message being used to indicate whether the master control server releases the target block.

[0009] In one possible implementation, the method includes: after the master server releases the target block, sending a read request to the block server to which the target block belongs, the read request being used to request reading data from the client from the target block.

[0010] In one possible implementation, before the client sends the first mapping relationship to the block server to which the target block belongs, the mapping relationship of the target block recorded by the block server to which the target block belongs is different from the first mapping relationship.

[0011] In a second aspect, a block management method is provided in a storage system. The method is applied to a storage system in which storage space is divided into at least one block. The method includes: receiving an allocation request sent by a client, the allocation request being used to request the allocation of a target block for the client from the at least one block; and in response to the allocation request, sending a first response message to the client, the first response message containing a first mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block.

[0012] In one possible implementation, the first response message further includes first indication information, which indicates a first release count, the number of times the target block has been released before it is allocated to the client.

[0013] In one possible implementation, the method further includes: receiving a release request sent by the client, the release request being used to request the release of the target block; and in response to the release request, sending a second response message to the client, the second response message being used to indicate whether the master server releases the target block.

[0014] Thirdly, a method for managing blocks in a storage system is provided, wherein the storage space in the storage system is divided into at least one block, the at least one block including a target block, the method comprising: receiving a first mapping relationship sent by a client, the first mapping relationship being a mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block; and recording the first mapping relationship.

[0015] In one possible implementation, the method further includes: after the master server releases the target block, receiving a read request sent by the client, the read request being used to request reading the client's data from the target block.

[0016] In one possible implementation, the method further includes: receiving first indication information sent by the client, the first indication information indicating a first release count, the first release count being the number of times the target block has been released before the target block is allocated to the client.

[0017] In one possible implementation, the first mapping relationship and / or the first indication information are carried in a write request, which is used to request the writing of first data to the target block.

[0018] In one possible implementation, if the write request includes the first mapping relationship and the first indication information, the block server to which the target block belongs records a second mapping relationship of the target block and a second release count of the target block, wherein the second release count is the number of times the target block is released when the block server to which the target block belongs records the second mapping relationship, and recording the first mapping relationship includes: if the first release count is higher than the second release count, writing the first data to the target block and updating the second mapping relationship to the first mapping relationship.

[0019] In one possible implementation, the method further includes: if the first release count is lower than the second release count, then the second mapping relationship is not updated, and the first data is not written to the target block; and / or, if the first release count is the same as the second release count, then the first data is written to the target block, and the second mapping relationship is not updated to the first mapping relationship.

[0020] Fourthly, a block management apparatus in a storage system, wherein the storage space in the storage system is divided into at least one block, the apparatus comprising: a sending unit configured to send an allocation request to a master server in the storage system, the allocation request being used to request the allocation of a target block from the at least one block for a client of the storage system; a receiving unit configured to receive a first response message sent by the master server in response to the allocation request, the first response message containing a first mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block; the sending unit further configured to send the first mapping relationship to a block server to which the target block belongs.

[0021] In one possible implementation, the first response message further includes first indication information, which indicates a first release count, the number of times the target block has been released before it is allocated to the client.

[0022] In one possible implementation, the apparatus further includes sending the first indication information to the block server to which the target block belongs.

[0023] In one possible implementation, the first mapping relationship and / or the first indication information are carried in a write request, which is used to request the writing of first data into the target block.

[0024] In one possible implementation, the apparatus further includes: sending a release request to the master control server, the release request being used to request the release of the target block; and receiving a second response message sent by the master control server in response to the release request, the second response message being used to indicate whether the master control server releases the target block.

[0025] In one possible implementation, the apparatus includes: after the master server releases the target block, sending a read request to the block server to which the target block belongs, the read request being used to request reading data from the client from the target block.

[0026] In one possible implementation, before the client sends the first mapping relationship to the block server to which the target block belongs, the mapping relationship of the target block recorded by the block server to which the target block belongs is different from the first mapping relationship.

[0027] Fifthly, a block management apparatus is provided for a storage system. The apparatus is applied to the storage system, wherein the storage space in the storage system is divided into at least one block. The apparatus includes: a receiving unit for receiving an allocation request sent by a client, the allocation request being for requesting the allocation of a target block for the client from the at least one block; and a sending unit for responding to the allocation request by sending a first response message to the client, the first response message containing a first mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block.

[0028] In one possible implementation, the first response message further includes first indication information, which indicates a first release count, the number of times the target block has been released before it is allocated to the client.

[0029] In one possible implementation, the apparatus further includes: the receiving unit, which is further configured to receive a release request sent by the client, the release request being used to request the release of the target block; and the sending unit, which is further configured to send a second response message to the client in response to the release request, the second response message being used to indicate whether the master control server releases the target block.

[0030] In one possible implementation, before the client sends the first mapping relationship to the block server to which the target block belongs, the mapping relationship of the target block recorded by the block server to which the target block belongs is different from the first mapping relationship.

[0031] A sixth aspect provides a block management device for a storage system, wherein the storage space in the storage system is divided into at least one block, the at least one block including the target block, the device comprising: a receiving unit for receiving a first mapping relationship sent by a client, the first mapping relationship being a mapping relationship between a logical block identifier of the target block and a physical block identifier of the target block; and a processing unit for recording the first mapping relationship.

[0032] In one possible implementation, the receiving unit is further configured to: after the master server releases the target block, receive a read request sent by the client, the read request being used to request to read the client's data from the target block.

[0033] In one possible implementation, the receiving unit is further configured to: receive first indication information sent by the client, the first indication information being used to indicate a first release count, the first release count being the number of times the target block was released before the first mapping relationship was established.

[0034] In one possible implementation, the first mapping relationship and / or the first indication information are carried in a write request, which is used to request the writing of first data to the target block.

[0035] In one possible implementation, if the write request includes the first mapping relationship and the first indication information, and the block server to which the target block belongs records the second mapping relationship of the target block and the second release count of the target block, wherein the second release count is the number of times the target block is released when the block server to which the target block belongs records the second mapping relationship, the processing unit is further configured to: if the first release count is higher than the second release count, write the first data to the target block and update the second mapping relationship to the first mapping relationship.

[0036] In one possible implementation, if the first release count is lower than the second release count, then the second mapping relationship is not updated, and the first data is not written to the target block; and / or, if the first release count is the same as the second release count, then the first data is written to the target block, and the second mapping relationship is not updated to the first mapping relationship.

[0037] In a seventh aspect, a client is provided, which has the functions of the method design described in the first aspect. These functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.

[0038] Eighthly, a master control server is provided, which has the functions of the method design described in the second aspect above. These functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.

[0039] Ninthly, a block server is provided, which has the functions of the method design described in the third aspect above. These functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the functions described above.

[0040] In a tenth aspect, a client is provided, including an input / output device, a processor, and a memory. The processor controls the input / output device to send and receive information, the memory stores a computer program, and the processor retrieves and runs the computer program from the memory, causing the client to perform the method described in the first aspect.

[0041] Eleventhly, a master control server is provided, including input / output devices, a processor, and a memory. The processor is used to control the input / output devices to send and receive information, the memory is used to store computer programs, and the processor is used to retrieve and run the computer programs from the memory, causing the master control server to perform the method in the second aspect.

[0042] In a twelfth aspect, a block server is provided, including input / output devices, a processor, and a memory. The processor controls the input / output devices to send and receive information, the memory stores computer programs, and the processor retrieves and runs the computer programs from the memory, causing the main control server to perform the method in the third aspect.

[0043] In a thirteenth aspect, a storage system is provided, which may include one or more of a client, a master server, and a block server to perform the methods of the above aspects.

[0044] In a fourteenth aspect, a computer program product is provided, the computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the methods described in the foregoing aspects.

[0045] In a fifteenth aspect, a computer-readable medium is provided that stores program code, which, when run on a computer, causes the computer to perform the methods described in the preceding aspects.

[0046] During block allocation, the master server sends the first mapping relationship to the client, which then forwards it to the target block server. This reduces the interaction between the master server and the block server, lowering the load on the master server during allocation. This avoids the high load on the master server that occurs in traditional block allocation processes where the master server must send the first mapping relationship to the block server. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the architecture of a storage system to which embodiments of this disclosure apply.

[0048] Figure 2 This is a flowchart of the block allocation method in a traditional storage system.

[0049] Figure 3 This is a flowchart of a block management method in a storage system according to an embodiment of the present disclosure.

[0050] Figure 4 A schematic diagram illustrating the mapping relationship of an embodiment of this disclosure is shown.

[0051] Figure 5 This is a flowchart of the block release method in a traditional storage system.

[0052] Figure 6 This is a flowchart of a block management method in a storage system according to another embodiment of the present disclosure.

[0053] Figure 7 This is a schematic diagram of a block management device in a storage system according to an embodiment of the present disclosure.

[0054] Figure 8 This is a schematic diagram of a block management device in a storage system according to another embodiment of the present disclosure.

[0055] Figure 9 This is a schematic diagram of a block management device in a storage system according to another embodiment of the present disclosure.

[0056] Figure 10 This is a schematic block diagram of an apparatus according to another embodiment of the present disclosure. Detailed Implementation

[0057] The technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments.

[0058] For ease of understanding, the following text will first combine... Figure 1 This disclosure describes the architecture of a storage system to which embodiments of the present disclosure are applicable. In some scenarios, Figure 1 The storage system shown can be a distributed storage system.

[0059] Figure 1 The storage system 100 shown includes a client 110, a master server 120, and a chunk server 130.

[0060] Block server 130 is used to provide storage space for users and can be understood as a storage node in the storage system.

[0061] Typically, a storage system can contain one or more block servers, and the storage space within each block server can be divided into units of chunks. For example, a block server may have 1TB of storage space, while a single chunk may have 1MB of storage space. Accordingly, the block server can provide block access (e.g., read / write) functionality.

[0062] In some implementations, clients can access blocks based on their logical block IDs. Therefore, block server 130 stores a mapping between physical block IDs and logical block IDs, also known as "chunk mapping." This allows block server 130 to determine the physical block ID corresponding to the logical block ID sent by the client, and ultimately identify the block the client wishes to access, based on the aforementioned mapping.

[0063] The aforementioned logical block identifier can be a logical address of the block or a logical index of the block. Typically, after a block is allocated, a logical block identifier is assigned to that block. This logical block identifier can uniquely identify a block.

[0064] The physical block identifier mentioned above can be the physical address of the block or the physical index of the block. Assuming that the storage space of a block server is 1TB and the storage space of a block is 1MB, then the range of the physical block identifiers of the blocks contained in the block server is [1, 1024*1024].

[0065] In other implementations, the above mapping relationship can be stored in the tail storage space of the corresponding block, for example, in the last 4K of the storage space of the corresponding block.

[0066] Client 110 allows users of the storage system to access block server 130 and / or master server 120. In some implementations, the client can manage blocks through a block management interface. This block management interface may include, for example, one or more of the following: block allocation interface, block release interface, block write interface, and block read interface.

[0067] The block allocation interface mentioned above can be represented as "alloc_chunk". Accordingly, users can request the allocation of a block (hereinafter referred to as "target block") through the block allocation interface to store the data to be written.

[0068] The block release interface mentioned above can be represented as "free_chunk". Accordingly, users can request to release allocated blocks through this interface. Upon successful release, the allocated block becomes a free block. In subsequent allocation processes, free blocks can be allocated.

[0069] The write interface for the aforementioned block can be represented as "write_chunk". Accordingly, users can write data to the block through this write interface. The block can be a block allocated to the user via the aforementioned allocation interface (e.g., the target block). Typically, users can write data to the block using an append-write method.

[0070] The read interface for the aforementioned block can be represented as "read_chunk". Accordingly, users can read data from the block through this interface. Typically, users can use the read_chunk interface to send the logical block identifier of the block containing the data to be read to the block server, indicating the block containing the data. Furthermore, during the data reading process, users can perform random reads of data of any size.

[0071] In some scenarios, the database can act as a user of the storage system, interacting with it through a client. This database can be, for example, a "native distributed database," which is a self-developed database that does not rely on known databases; for example, it is not obtained through secondary development or repackaging of a known database. Of course, the database applicable to this disclosure can also be other known databases. In other scenarios, the users of the storage system can be other users with specific needs, and this disclosure does not limit this.

[0072] The master control server 120 is used to manage some or all of the block servers in the storage system.

[0073] In some implementations, the master server 120 can store the block allocation information of the managed block servers. This allocation information can be represented by the mapping relationship described above.

[0074] In some implementations, the master server 120 can also record free blocks in the managed block servers. For example, the logical block identifiers of free blocks can be recorded in the form of a list. In this case, this list can be called a "freelist".

[0075] To facilitate understanding, the block partitioning process is described below. Typically, this block partitioning process is executed by the master server during the block server's initialization process. Once the block server comes online and enters the initialization process, it reports its total storage space to the master server. The master server then partitions the total storage space according to the fixed block size. For example, if the block server has a total storage space of 1TB and each block has a storage space of 1MB, the master server can partition the block server's storage space into 1024*1024 blocks.

[0076] After successful block partitioning, the client can request block allocation. The following text uses... Figure 1 Taking the aforementioned storage system as an example, combined with Figure 2 This section introduces the traditional block allocation process. Figure 2 The method shown includes steps S210 to S240.

[0077] In step S210, the client sends allocation request 1 to the master server, which requests the master server to allocate a block to the client.

[0078] In step S220, the master server sends request 1 to block server 1 to request block server 1 to create block 1.

[0079] Typically, the master server retrieves the logical block identifier of block 1 from the free list, and then sends the mapping relationship between the logical block identifier of block 1 and the physical block identifier of block 1 to block server 1 so that block server 1 can create block 1.

[0080] In step S230, in response to request 1, block server 1 sends response message 1 to master server to indicate whether block 1 was created successfully or failed to create.

[0081] In step S240, if block server 1 successfully creates block 1, the master server sends the logical block identifier of block 1 to the client.

[0082] As can be seen from the traditional block allocation process described above, when a client requests block allocation, the master server needs to interact with the block servers (i.e., steps S220 and S230) to create the block. However, in a storage system, a master server needs to be associated with multiple block servers simultaneously. If each block server interacts with the master server during the block allocation process, it will result in a large load on the master server.

[0083] Therefore, in order to avoid the above problems, this disclosure provides a block management method in a storage system to reduce the interaction between the master server and the block server during the block allocation process and reduce the load on the master server during the block allocation process.

[0084] The following text combines Figure 3 This disclosure introduces a method for managing blocks in a storage system according to embodiments of the present disclosure. Figure 3 This is a flowchart of a block management method in a storage system according to an embodiment of this disclosure. It should be understood that... Figure 3 The method shown can be applied to Figure 1 The storage system shown. Figure 3 The method includes steps S310 to S340.

[0085] In step S310, the client sends an allocation request to the master server.

[0086] The allocation request is used to request the allocation of a target block to the client.

[0087] In step S320, the master server selects the target block from the free blocks.

[0088] As described above, the master control server can store a free list containing records of free blocks. This allows the master control server to query the free list and select a target block that can be allocated to the client. It should be noted that the master control server can also manage free blocks in other ways, and this embodiment does not limit this approach.

[0089] In step S330, the master server sends a first response message to the client in response to the allocation request.

[0090] The first response message contains a first mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block.

[0091] In step S340, the client sends the first mapping relationship to the block server (also known as the "target block server") to which the target block belongs.

[0092] In the block allocation process of this embodiment, the master control server sends a first mapping relationship to the client, and the client then sends the first mapping relationship to the target block server. This reduces the interaction between the master control server and the block server during block allocation, thereby lowering the load on the master control server. This avoids the high load on the master control server that occurs in traditional block allocation processes where the master control server needs to send the first mapping relationship to the block server.

[0093] On the other hand, reducing the interaction between the master server and the block server during the block allocation process reduces the load on the master server during block allocation, which helps to increase the number of block servers managed by the master server, thereby improving the scalability of the storage system.

[0094] It should be noted that the above Figure 3 The method shown takes the allocation of a target block as an example. In this embodiment of the disclosure, the master server can also allocate multiple blocks to the client at the same time. The specific allocation process is similar to the process of allocating the target block described above, and will not be repeated here for the sake of brevity.

[0095] In some situations, after a client requests a target block, it typically writes data to that block (also known as "first data"). To reduce the number of interactions between the client and the block server and thus lower the block server's load, the client can send the first mapping relationship to the target block server only when it needs to write data to the target block. That is, the aforementioned first mapping relationship is carried in the write request sent by the client to the target block server, which is used to request the writing of the first data to the target block.

[0096] In some scenarios, to improve storage space utilization in a storage system, the master server performs block reclamation and reallocates the reclaimed blocks. In this situation, two clients might simultaneously write data to the same block, causing the block server to be unsure which client's request should be written to the block. For example, after the master server allocates block 1 to client A, client A doesn't write any data to it. Then, the master server reclaims block 1 and reassigns it to client B. Client A, unaware that block 1 has been reassigned to client B, continues to write data 1 to block 1, while client B also writes data 2. In this case, the block server containing block 1 is unsure whether to write data 1 or data 2 to block 1.

[0097] To avoid the above problems, the master server can also record the number of times a block is released and send the number of releases to the client. In this way, before the client writes data to the target block, it can send the first number of releases to the block server. Accordingly, the block server can determine which client the block has been allocated to based on the number of releases sent by the client and write the data of that client to the target block.

[0098] That is, the above method further includes: the master server sending first indication information to the client, the first indication information indicating a first release count, wherein the first release count is the number of times the target block was released before the target block was allocated to the client. Alternatively, the first release count is the number of times the target block was released before the master server established the first mapping relationship for the target block. Accordingly, the client sends the aforementioned first release count to the block server where the target block resides.

[0099] The first release count mentioned above can represent the total number of times the target block is released. Each time the target block is released, it can be understood that the target block is updated to a new version. Therefore, the first release count mentioned above can also be called the target block's version number (Chunk Version).

[0100] In some implementations, to reduce the number of interactions between the master server and the client, the aforementioned first indication information can be carried in the first response message and sent to the client along with the first mapping relationship. Of course, in other implementations, the aforementioned first indication information and the first mapping relationship can also be sent separately, and this disclosure does not limit this.

[0101] For ease of management, the master server can store the first release count as a field in the first mapping relationship. Figure 4 A schematic diagram illustrating the mapping relationships of embodiments of this disclosure is shown. See also... Figure 4 The first mapping relationship 400 may include the logical block identifier 410 of the target block, the physical block identifier 420 of the target block, and the first release count 430. Of course, in this embodiment of the disclosure, for example, the version number of the target block may also be independent of the first mapping relationship. This embodiment of the disclosure does not limit this.

[0102] Furthermore, as mentioned above, not only does the master server need to maintain the block mapping relationship, but the block server also needs to maintain the block mapping relationship. Therefore, the mapping relationship maintained in the block server can also be... Figure 4The structure is shown. It should be noted that before the client sends the first mapping relationship and the target block's version number to the block server, the target block's mapping relationship stored on the block server is different from the first mapping relationship. Furthermore, the version number of the target block stored on the block server is also different from the version number of the target block sent by the client. In other words, the target block's mapping relationship and version number stored on the block server can be the old mapping relationship and version number before the target block was assigned to the client.

[0103] There are many ways for the master server to maintain the version number of the target block. In some implementations, the master server can directly maintain the number of times the target block is released; that is, after each release, the master server increments the version number of the target block. For example, the master server can preset the initial value of the version number of each block to 0. After the first release of the target block, the version number can be version 1. After the second release, the version number can be version 2. In this way, if two clients simultaneously want to write data to the target block, the target block server can write the data to be written by the client with the higher version number based on the version numbers sent by the two clients.

[0104] In other implementations, the master server can indirectly maintain the number of times the target block is released. That is, the master server can preset the initial value of the version number of each block to the maximum value. After each release of the target block, the master server can decrement the version number of the target block. For example, the master server can preset the initial value of the version number of each block to the maximum value 'max'. After the first release of the target block, the version number of the target block can be 'max-1'. After the second release of the target block, the version number of the target block can be 'max-2'. Thus, if two clients simultaneously want to write data to the target block, the target block server can, based on the version numbers sent by the two clients, write the data to be written by the client with the lower version number.

[0105] To reduce the number of interactions between the client and the target block server, the first release count can be included in the write request. Of course, if the number of interactions between the client and the target block server is not considered, the first release count can also be sent separately from the write request.

[0106] The following describes a method for writing data to a target block in this embodiment of the present disclosure, using three scenarios as an example where the client sends a write request to the target block server carrying the aforementioned first mapping relationship and the first release count. It should be noted that the three scenarios described below can be used in combination in a storage system. Alternatively, the three scenarios can be used individually in a storage system, or any two of the three scenarios can be used in combination in a storage system. This embodiment of the present disclosure does not limit this approach.

[0107] Assume that the target block mapping relationship recorded in the target block server is the second mapping relationship, and the recorded number of times the target block has been released is the second release count. The second release count can be understood as the number of times the target block has been released when the target block server records the target block mapping relationship as the second mapping relationship.

[0108] In case 1, if the first release count is higher than the second release count, the target block server can write the first data into the target block and update the second mapping relationship to the first mapping relationship.

[0109] The fact that the first release count is higher than the second release count can be understood as follows: the first mapping corresponding to the first release count is a currently valid mapping, while the second mapping corresponding to the second release count is an invalid mapping. Alternatively, the establishment time of the second mapping corresponding to the second release count is earlier than the establishment time of the first mapping corresponding to the first release count. Therefore, when a client requests to write the first data to the target block, the target block server can write the first data to the target block and modify the second mapping of the target block to the first mapping.

[0110] In case 2, if the first release count is lower than the second release count, the target block server will not update the second mapping relationship and will not write the first data to the target block.

[0111] In some scenarios, after the master server allocates a target block to client A, client A does not write any data to the target block, and the information recorded by client A for the target block is the first mapping relationship and the first release count. Then, the master server reclaims the target block and reassigns it to client B. At this time, client B records the target block information as the second mapping relationship and the second release count.

[0112] After client B has written data to the target block, the target block server stores the target block information as the second mapping relationship and the second free count. At this time, client A is unaware that the target block has been reassigned to client B and continues to write data to the target block. In this case, the first free count received by the target block server from client A will be lower than the second free count. Therefore, the target block server does not update the second mapping relationship and does not write the first data to the target block.

[0113] Therefore, the fact that the first release count is lower than the second release count can be understood as follows: the first mapping relationship corresponding to the first release count is a currently invalid mapping relationship, while the second mapping relationship corresponding to the second release count is a currently valid mapping relationship. Alternatively, the establishment time of the second mapping relationship corresponding to the second release count is later than the establishment time of the first mapping relationship corresponding to the first release count. Therefore, when a client requests to write the first data to the target block, the target block server can refuse to write the first data to the target block and refuse to update the second mapping relationship of the target block to the first mapping relationship.

[0114] In this embodiment of the disclosure, when the first release count is lower than the second release count, the target block server can refuse to write the first data to the target block and update the mapping relationship of the target block, which helps to block the writing of old data to the target block and ensure the consistency of data in the storage system.

[0115] In case 3, if the first release count is the same as the second release count, the target block server can write the first data to the target block, but will not update the second mapping relationship to the first mapping relationship.

[0116] Typically, after a client writes data to the target block, the target block server sends the length of the successfully written data to the client. If the data written by the client via write request 1 does not fill the target block's storage space, the client can continue writing data. In this case, the number of times the target block is freed (also known as the "first free count") when the client continues writing data is the same as the number of times the target block is freed when the client first writes data (also known as the "second free count"). At this point, the target block server can write the first piece of data to the target block. Furthermore, since the first and second free counts are the same, the target block server does not need to update the target block's mapping.

[0117] In some implementations, the process of the client continuing to write data to the target block can be implemented in the form of append write (or "incremental write").

[0118] As mentioned above, to improve the utilization of storage space in a storage system, the master server releases allocated blocks, making them free. The following section combines... Figure 5 This section uses a client 1 requesting the release of block 2 as an example to illustrate the traditional block release process. (See also...) Figure 5 The traditional block release process may include steps S510 to S530.

[0119] In step S510, client 1 sends release request 1 to master server 1 to request the release of block 2.

[0120] In step S520, the master server 1 calls the background program to notify the block server 2 where block 2 is located to release block 2.

[0121] In some implementations, master server 1 can periodically call a background program to notify block server 2 to release block 2. Furthermore, the master server will only execute its local block 2 release process after block server 2 has successfully released block 2.

[0122] In step S530, the master server 1 sends a response message 1 to the client 1 to inform the client 1 whether block 2 has been successfully released by both the master server and the block server 2.

[0123] As can be seen from the traditional block release process described above, when a client requests to release a block, the master server needs to interact with the block server (i.e., step S520) to release the block. However, in a storage system, a master server needs to be associated with multiple block servers simultaneously. If each block server interacts with the master server during the block release process, it will result in a large load on the master server.

[0124] Therefore, to avoid the above-mentioned problems, another embodiment of this disclosure provides a block management scheme in a storage system. In this scheme, the master control server only needs to release the target block requested by the client, without notifying the target block server to release the block. This reduces the interaction between the master control server and the target block server during the block release process, thereby reducing the load on the master control server. That is, see [link to relevant documentation]. Figure 6 The method includes steps S610 to S630.

[0125] In step S610, the client sends a release request to the master server, which is used to request the release of the target block.

[0126] In step S620, the master server releases the target block.

[0127] In some implementations, the master server can record the target block in a free list to mark it as a free block. At this point, the master server releases the target block. Of course, in this embodiment, the master server can also use other methods to release the target block, and this embodiment does not limit this approach.

[0128] In step S630, the master server sends a second response message to the client in response to the release request. The second response message is used to indicate whether the master server should release the target block.

[0129] When the master server successfully releases the target block, the second response message indicates that the target block has been successfully released. When the master server fails to release the target block, the second response message indicates that the target block has not been successfully released. In other words, the second response message only indicates whether the master server has successfully released the target block, and does not concern itself with whether the target block server has released the target block.

[0130] It should be noted that the above Figure 6 The method shown takes the release of the target block as an example. In this embodiment of the disclosure, the master server can also release multiple blocks at the same time. The specific release process is similar to the process of releasing the target block above. For the sake of brevity, it will not be described again here.

[0131] The release process of this disclosure can be used alone in the storage system, or it can be used in conjunction with the block allocation process described above. Of course, the above release process can also be used in conjunction with the data writing process described above. This disclosure does not limit this.

[0132] When the above release process is used in conjunction with the data writing process, the solution described in Case 1 above can be understood as helping the target block server complete the target block release process. Because, if the first release count is higher than the second release count, it can be understood that the target block has been released in the master server. At this time, the target block server will update the target block's mapping relationship from the second mapping relationship corresponding to the second release count to the first mapping relationship corresponding to the first release count, indicating that the target block server has also released the target block.

[0133] In some scenarios, if the master server releases the target block but does not reassign it to other clients, the client can still read data from the target block because the target block server is unaware that it has been released. That is, Figure 6 The method also includes sending a read request to the block server to which the target block belongs after the master server releases the target block. The read request is used to request the client to read data from the target block.

[0134] The above text combined Figures 1 to 6 The present disclosure describes in detail the method embodiments, which are then combined with the following. Figures 7 to 10 The present disclosure provides a detailed description of the apparatus embodiments. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be found in the foregoing method embodiments.

[0135] Figure 7 This is a schematic diagram of a block management device in a storage system according to an embodiment of the present disclosure. Figure 7 The apparatus 700 shown includes a transmitting unit 710 and a receiving unit 720.

[0136] The sending unit 710 is used to send an allocation request to the master server in the storage system, the allocation request being used to request the allocation of a target block from the at least one block for the client of the storage system;

[0137] The receiving unit 720 is configured to receive a first response message sent by the master control server in response to the allocation request, wherein the first response message contains a first mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block;

[0138] The sending unit 710 is further configured to send the first mapping relationship to the block server to which the target block belongs.

[0139] In one possible implementation, the first response message further includes first indication information, which indicates a first release count, the number of times the target block has been released before it is allocated to the client.

[0140] In one possible implementation, the sending unit is further configured to: send the first indication information to the block server to which the target block belongs.

[0141] In one possible implementation, the first mapping relationship and / or the first indication information are carried in a write request, which is used to request the writing of first data into the target block.

[0142] In one possible implementation, the sending unit is further configured to: send a release request to the master control server, the release request being used to request the release of the target block; the receiving unit is further configured to: receive a second response message sent by the master control server in response to the release request, the second response message being used to indicate whether the master control server releases the target block.

[0143] In one possible implementation, the sending unit is further configured to: after the master control server releases the target block, send a read request to the block server to which the target block belongs, the read request being used to request to read the client's data from the target block.

[0144] In one possible implementation, before the client sends the first mapping relationship to the block server to which the target block belongs, the mapping relationship of the target block recorded by the block server to which the target block belongs is different from the first mapping relationship.

[0145] Figure 8 This is a schematic diagram of a block management device in a storage system according to another embodiment of the present disclosure. Figure 8 The apparatus 800 shown includes a receiving unit 810 and a transmitting unit 820.

[0146] The receiving unit 810 is configured to receive an allocation request sent by a client, the allocation request being used to request the allocation of a target block for the client from the at least one block;

[0147] The sending unit 820 is configured to send a first response message to the client in response to the allocation request. The first response message contains a first mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block.

[0148] In one possible implementation, the first response message further includes first indication information, which indicates a first release count, the number of times the target block has been released before it is allocated to the client.

[0149] In one possible implementation, the apparatus further includes: the receiving unit, which is further configured to receive a release request sent by the client, the release request being used to request the release of the target block; and the sending unit, which is further configured to send a second response message to the client in response to the release request, the second response message being used to indicate whether the master control server releases the target block.

[0150] In one possible implementation, before the client sends the first mapping relationship to the block server to which the target block belongs, the mapping relationship of the target block recorded by the block server to which the target block belongs is different from the first mapping relationship.

[0151] Figure 9 This is a schematic diagram of a block management device in a storage system according to another embodiment of the present disclosure. Figure 9 The apparatus 900 shown includes a receiving unit 910 and a processing unit 920.

[0152] The receiving unit 910 is used to receive a first mapping relationship sent by the client, wherein the first mapping relationship is a mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block;

[0153] Processing unit 920 is used to record the first mapping relationship.

[0154] In one possible implementation, the receiving unit is further configured to: after the master server releases the target block, receive a read request sent by the client, the read request being used to request to read the client's data from the target block.

[0155] In one possible implementation, the receiving unit is further configured to: receive first indication information sent by the client, the first indication information being used to indicate a first release count, the first release count being the number of times the target block was released before the first mapping relationship was established.

[0156] In one possible implementation, the first mapping relationship and / or the first indication information are carried in a write request, which is used to request the writing of first data to the target block.

[0157] In one possible implementation, if the write request includes the first mapping relationship and the first indication information, and the block server to which the target block belongs records the second mapping relationship of the target block and the second release count of the target block, wherein the second release count is the number of times the target block is released when the block server to which the target block belongs records the second mapping relationship, the processing unit is further configured to: if the first release count is higher than the second release count, write the first data to the target block and update the second mapping relationship to the first mapping relationship.

[0158] In one possible implementation, if the first release count is lower than the second release count, then the second mapping relationship is not updated, and the first data is not written to the target block; and / or, if the first release count is the same as the second release count, then the first data is written to the target block, and the second mapping relationship is not updated to the first mapping relationship.

[0159] In an optional embodiment, the transmitting unit 710 may be an input / output interface 1030, and the receiving unit 720 may be an input / output interface 1030. The device may also include a processor 1020 and a memory 1010, specifically as follows: Figure 10 As shown.

[0160] In an optional embodiment, the receiving unit 810 may be an input / output interface 1030, and the transmitting unit 820 may be an input / output interface 1030. The device may also include a processor 1020 and a memory 1010, specifically as follows: Figure 10 As shown.

[0161] In an optional embodiment, the receiving unit 910 may be an input / output interface 1030, the processing unit 920 may be a processor 1020, and the device may further include a memory 1010, specifically as follows: Figure 10 As shown.

[0162] Figure 10 This is a schematic block diagram of an apparatus according to another embodiment of the present disclosure. Figure 10The illustrated device 1000 may include a memory 1010, a processor 1020, and an input / output interface 1030. The memory 1010, processor 1020, and input / output interface 1030 are connected via internal interconnections. The memory 1010 stores instructions, and the processor 1020 executes the instructions stored in the memory 1020 to control the input / output interface 1030 to receive input data and information, output operation results, and control the transceiver 1040 to send signals.

[0163] It should be understood that in the embodiments of this disclosure, the processor 1020 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs in order to implement the technical solutions provided in the embodiments of this disclosure.

[0164] It should also be understood that transceiver 1040, also known as a communication interface, uses transceiver devices such as, but not limited to, transceivers to enable communication between terminal 1000 and other devices or communication networks.

[0165] The memory 1010 may include read-only memory and random access memory, and provides instructions and data to the processor 1020. A portion of the processor 1020 may also include non-volatile random access memory. For example, the processor 1020 may also store device type information.

[0166] In implementation, each step of the above method can be completed by the integrated logic circuitry of the hardware in the processor 1020 or by instructions in software form. The method for requesting uplink transmission resources disclosed in this embodiment can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 1010, and the processor 1020 reads the information in memory 1010 and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.

[0167] It should be understood that in the embodiments of this disclosure, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0168] It should be understood that in the embodiments of this disclosure, "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.

[0169] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0170] It should be understood that in the various embodiments of this disclosure, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.

[0171] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0172] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0173] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0174] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can read or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs, DVDs) or semiconductor media (e.g., solid-state disks, SSDs), etc.

[0175] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A method for managing blocks in a storage system, wherein the storage space in the storage system is divided into at least one block, the method comprising: Send an allocation request to the master server in the storage system, the allocation request being used to request the allocation of a target block from the at least one block to the client of the storage system; The system receives a first response message sent by the master control server in response to the allocation request. The first response message contains a first mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block. The first response message also includes first indication information, which is used to indicate a first release count. The first release count is the number of times the target block has been released before the target block is allocated to the client. The first mapping relationship is sent to the block server to which the target block belongs, so that the block server provides the client with access to the target block based on the first mapping relationship.

2. The method of claim 1, further comprising: Send the first indication information to the block server to which the target block belongs.

3. The method of claim 2, wherein the first mapping relationship and / or the first indication information are carried in a write request, the write request being used to request writing first data to the target block.

4. The method of claim 1, further comprising: Send a release request to the master control server, the release request being used to request the release of the target block; The system receives a second response message from the master control server in response to the release request. The second response message is used to indicate whether the master control server should release the target block.

5. The method of claim 4, wherein the method comprises: After the master control server releases the target block, it sends a read request to the block server to which the target block belongs. The read request is used to request to read the client's data from the target block.

6. The method as described in claim 2 or 3, wherein before the client sends the first mapping relationship to the block server to which the target block belongs, the mapping relationship of the target block recorded by the block server to which the target block belongs is different from the first mapping relationship.

7. A method for managing blocks in a storage system, the method being applied to the storage system, wherein storage space in the storage system is divided into at least one block, the method comprising: Receive an allocation request sent by a client, the allocation request being used to request the allocation of a target block for the client from the at least one block; In response to the allocation request, a first response message is sent to the client. The first response message contains a first mapping relationship between the logical block identifier and the physical block identifier of the target block. The first response message is sent by the client to the block server to which the target block belongs, so that the block server provides the client with access to the target block based on the first mapping relationship. The first response message also includes first indication information, which indicates a first release count, which is the number of times the target block has been released before it is allocated to the client.

8. The method of claim 7, further comprising: Receive a release request sent by the client, the release request being used to request the release of the target block; In response to the release request, a second response message is sent to the client, which instructs the master server whether to release the target block.

9. A method for managing blocks in a storage system, wherein storage space in the storage system is divided into at least one block, the at least one block including a target block, the method comprising: The client sends a first mapping relationship, which is a mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block. Record the first mapping relationship, and provide the client with access to the target block based on the first mapping relationship; The method further includes: The system receives a first indication message sent by the client, the first indication message indicating a first release count, the first release count being the number of times the target block was released before it was allocated to the client.

10. The method of claim 9, further comprising: After the master server releases the target block, it receives a read request sent by the client, which is used to request to read the client's data from the target block.

11. The method of claim 9, wherein the first mapping relationship and / or the first indication information are carried in a write request, the write request being used to request writing first data to the target block.

12. The method of claim 11, wherein if the write request includes the first mapping relationship and the first indication information, the block server to which the target block belongs records a second mapping relationship of the target block and a second release count of the target block, wherein, The second release count is the number of times the target block was released when the block server to which the target block belongs recorded the second mapping relationship. The recording of the first mapping relationship includes: If the first release count is higher than the second release count, write the first data into the target block and update the second mapping relationship to the first mapping relationship.

13. The method of claim 12, further comprising: If the first release count is lower than the second release count, then the second mapping relationship is not updated, and the first data is not written to the target block; and / or If the first release count is the same as the second release count, then write the first data into the target block, and do not update the second mapping relationship to the first mapping relationship.

14. A block management apparatus in a storage system, wherein storage space in the storage system is divided into at least one block, the apparatus comprising: A sending unit is configured to send an allocation request to the master server in the storage system, the allocation request being used to request the allocation of a target block from the at least one block for the client of the storage system; The receiving unit is configured to receive a first response message sent by the master control server in response to the allocation request. The first response message contains a first mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block. The first response message also includes first indication information, which is used to indicate a first release count. The first release count is the number of times the target block has been released before the target block is allocated to the client. The sending unit is further configured to send the first mapping relationship to the block server to which the target block belongs, so that the block server provides the client with access to the target block based on the first mapping relationship.

15. A block management apparatus for a storage system, the apparatus being applied to the storage system, wherein storage space in the storage system is divided into at least one block. A receiving unit is configured to receive an allocation request sent by a client, the allocation request being used to request the allocation of a target block for the client from the at least one block; A sending unit is configured to send a first response message to the client in response to the allocation request. The first response message contains a first mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block. The first response message is sent by the client to the block server to which the target block belongs, so that the block server provides the client with access to the target block based on the first mapping relationship. The first response message also includes first indication information, which indicates a first release count, the first release count being the number of times the target block has been released before it is allocated to the client.

16. The apparatus of claim 15, wherein the receiving unit is configured to receive a release request sent by the client, the release request being used to request the release of the target block; The sending unit is configured to send a second response message to the client in response to the release request, the second response message being used to indicate whether the master server releases the target block.

17. A block management apparatus in a storage system, wherein storage space in the storage system is divided into at least one block, the at least one block including a target block, the apparatus comprising: A receiving unit is configured to receive a first mapping relationship sent by a client, wherein the first mapping relationship is a mapping relationship between the logical block identifier of the target block and the physical block identifier of the target block; A processing unit is configured to record the first mapping relationship and provide the client with access to the target block based on the first mapping relationship; The receiving unit is also used for: The system receives a first indication message sent by the client, the first indication message indicating a first release count, the first release count being the number of times the target block was released before it was allocated to the client.

18. The apparatus of claim 17, wherein if the first mapping relationship and the first indication information are carried in a write request, and the write request is used to request writing first data to the target block, the block server to which the target block belongs records a second mapping relationship of the target block and a second release count of the target block, wherein, The second release count is the number of times the target block was released when the block server to which the target block belongs recorded the second mapping relationship. The processing unit is further configured to: If the first release count is higher than the second release count, write the first data into the target block and update the second mapping relationship to the first mapping relationship.

19. The apparatus of claim 18, wherein the processing unit is further configured to: If the first release count is lower than the second release count, then the second mapping relationship is not updated, and the first data is not written to the target block; and / or If the first release count is the same as the second release count, then write the first data into the target block, and do not update the second mapping relationship to the first mapping relationship.

Citation Information

Patent Citations

  • Block storage system and method applied to cloud computing

    CN106302607A