Data processing method and device and electronic equipment

By determining the virtual node migration subset when the node is expanded in the distributed storage system, processing the write data request and flushing the disk after completion, the performance degradation problem caused by the node expansion is solved and the data processing efficiency and consistency are improved.

CN118869786AActive Publication Date: 2024-10-29XINHUASAN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202410867110.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-29
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

During the node expansion process of the distributed storage system, the mapping relationship between virtual nodes and physical nodes changes, resulting in a decrease in data writing performance. The existing technology needs to wait for the data flushing of the virtual node to be completed before processing the write data request, resulting in a long time. IO drops to zero and performance degrades.

Method used

By determining the virtual node migration subset during node expansion, unprocessed write data requests are recorded to the first processing linked list, and write data requests in the virtual node migration subset wait for write-time redirection processing until the first processing linked list is completed. , flush the cached data to the set stop condition to avoid waiting for the virtual node flush to complete.

Benefits of technology

It effectively avoids performance degradation when node expansion occurs, improves data processing efficiency, reduces IO zero time, and ensures data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869786A_ABST
    Figure CN118869786A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device and electronic equipment. According to the embodiment of the invention, when node expansion occurs in the distributed storage system, the virtual node migration subset corresponding to the node is determined firstly, and then, for the received write data request of the corresponding virtual node not in the virtual node migration subset, the write data request is added to the second processing chain table to wait for normal processing. In this way, the problem that the performance of the distributed storage system is reduced during node capacity expansion can be effectively avoided, and the data processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device and electronic device. Background Art

[0002] When the usage capacity of the distributed storage system reaches a certain threshold, data cannot be written. Therefore, in order to maintain the availability of the distributed storage system, node expansion is required. Node expansion will cause the mapping relationship between virtual nodes and physical nodes to change, that is, some virtual nodes are mapped to new physical nodes. To ensure that after the node expansion is completed, the data of these virtual nodes mapped to the new physical nodes will not appear in the original corresponding physical nodes to ensure data consistency, it is necessary to flush the data in the cache of these virtual nodes and delete the corresponding log records.

[0003] At present, in actual applications, when a node is expanded, the received write data request will be inserted into the cache queue, and after the data in the cache of the virtual node is flushed to the disk, the write data request in the cache queue will be directly transparently transmitted to the write-time redirection module for write-time redirection processing. However, in the above process, if the flushing time is long, the received write data request will not be processed for a long time, which will cause the performance of the distributed storage system to deteriorate. Summary of the invention

[0004] In view of this, the present application provides a data processing method, device and electronic device to avoid the performance degradation problem of a distributed storage system when node expansion occurs.

[0005] The embodiment of the present application provides a data processing method, which is applied to any designated storage node in a distributed storage system; the designated storage node refers to a storage node included in the distributed storage system before the current node expansion; the method includes:

[0006] Obtain a virtual node migration set, and determine a virtual node migration subset corresponding to the node according to the virtual node migration set; and record information of at least one data processing request that has been received and not processed before the current time point into a first processing linked list; the virtual node migration set is composed of at least one virtual node mapped to a newly added storage node during the current node expansion;

[0007] A data processing request is received. When the data processing request is a write data request, the write data request indicates a node identifier corresponding to a virtual node that matches a storage location to which the data is to be written; if it is determined that the virtual node corresponding to the node identifier is in the virtual node migration subset, the write data request is added to a cache queue for caching write data requests that require write-time redirection processing; otherwise, information about the write data request is added to a second processing linked list until it is found that all data processing requests in the first processing linked list have been processed;

[0008] When it is found that all write data requests in the second processing list have been processed, the cache data corresponding to the write data requests in the current disk flushing list are flushed until the set disk flushing stop condition is reached; the set disk flushing stop condition means that: the target log object is deleted; the target log object records the operation log corresponding to the last processed write data request in the first processing list.

[0009] The embodiment of the present application further provides a data processing device, which is configured in any designated storage node in the distributed storage system; the designated storage node refers to the storage node included in the distributed storage system before the current node expansion; the device includes:

[0010] The acquisition module is used to obtain a virtual node migration set, determine a virtual node migration subset corresponding to the node according to the virtual node migration set; and record information of at least one data processing request received and not processed before the current time point into a first processing linked list; the virtual node migration set is composed of at least one virtual node mapped to a newly added storage node during the current node expansion;

[0011] A receiving module, used for receiving a data processing request, where the data processing request is a write data request, the write data request indicates a node identifier corresponding to a virtual node matching a storage location to which the data is to be written; if it is determined that the virtual node corresponding to the node identifier is in the virtual node migration subset, the write data request is added to a cache queue for caching write data requests that require write-time redirection processing; otherwise, the write data request information is added to a second processing linked list until it is found that all data processing requests in the first processing linked list have been processed;

[0012] The disk flushing module is used to flush the cached data corresponding to the write data request in the current disk flushing list when it is found that all the write data requests in the second processing list have been processed, until the set disk flushing stop condition is reached; the set disk flushing stop condition means: the target log object is deleted; the target log object records the operation log corresponding to the last processed write data request in the first processing list.

[0013] The present application also provides an electronic device, the electronic device comprising:

[0014] Processor; and

[0015] A memory, in which computer program instructions are stored, and when the computer program instructions are executed by a processor, the processor executes the steps of the above method.

[0016] An embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the above method.

[0017] It can be seen from the above technical scheme that in the embodiment of the present application, when a node expansion occurs in the distributed storage system, the virtual node migration subset corresponding to the node is first determined. Then, for the received write data request whose corresponding virtual node is not in the virtual node migration subset, the write data request is added to the second processing linked list and waits for normal processing. There is no need to wait for the virtual node to be flushed before processing. This can effectively avoid the performance degradation problem of the distributed storage system when node expansion occurs and improve data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.

[0019] Figure 1 A flow chart of the method provided in an embodiment of the present application.

[0020] Figure 2 A schematic diagram of the interactive process of the data processing method provided in an embodiment of the present application.

[0021] Figure 3 A schematic diagram of cache processing provided in an embodiment of the present application.

[0022] Figure 4 Another cache processing schematic diagram provided for an embodiment of the present application.

[0023] Figure 5 Another cache processing schematic diagram provided for an embodiment of the present application.

[0024] Figure 6 Another cache processing schematic diagram provided for an embodiment of the present application.

[0025] Figure 7 Another cache processing schematic diagram provided for an embodiment of the present application.

[0026] Figure 8 Another cache processing schematic diagram provided for an embodiment of the present application.

[0027] Fig. 9A schematic diagram of the device structure provided in an embodiment of the present application.

[0028] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] To facilitate understanding of the present solution, before describing the present solution, the technical problems existing in the existing distributed storage system involved in the embodiments of the present application are described first:

[0030] As time goes by, the available capacity of the distributed storage system gradually decreases. When the used capacity of the distributed storage system reaches a certain threshold, data cannot be written. Therefore, in order to maintain the availability of the distributed storage system, node expansion is required (i.e., adding new physical nodes, where physical nodes can be considered as storage nodes). Distributed storage systems usually use cache technology to improve performance. In specific implementations, for example, for data processing requests from clients, first record an operation log corresponding to the data processing request (the operation log may include information such as the operation type, data content, and storage location of the data processing request); then, if the data processing request is a write data request, the data to be written corresponding to the write data request is written into the cache (here, the data to be written corresponding to the write data request written into the cache can be recorded as the cache data corresponding to the write data request), insert the write data request into the disk flushing linked list, and return a response to the client to indicate that the write data request has been processed; if the data processing request is a read data request, the data to be read corresponding to the read data request is directly returned to the client. The above-mentioned data cache mode can also be considered as a normal mode.

[0031] Node expansion will cause the mapping relationship between virtual nodes and physical nodes to change, that is, some virtual nodes are mapped to new physical nodes, and these virtual nodes mapped to new physical nodes can be recorded as migration virtual nodes. To ensure that after the node expansion is completed, the data of the migration virtual nodes will not appear in the original corresponding physical nodes, in order to ensure the consistency of the data, it is necessary to complete the disk flushing of the data of these migration virtual nodes in the cache, and delete the corresponding log records at the same time. At present, when the node expansion occurs, the full-transparent mode is usually adopted to process the received write data request, specifically for example, the write data request is inserted into the cache queue, and after the data of the above-mentioned migration virtual node in the cache is completed, the write data request (which can be recorded as write IO request) in the cache queue is directly transparently transmitted to the write-time redirection module for write-time redirection processing, and all subsequent new write IO requests will also be directly transparently transmitted to the write-time redirection module for processing. However, in the above process, if the disk flushing time is long, the received write data requests will not be processed for a long time, that is, there will be a long IO drop time; and after the disk flushing is completed, the write IO request will be directly passed to the write-time redirection module for processing, which will also cause the performance of the distributed storage system to deteriorate.

[0032] Among them, the above-mentioned redirect on write (ROW) refers to a technology that converts random writes into sequential writes and aggregates small IOs into large IOs, thereby improving the system write performance. The basic implementation principle of redirect on write is as follows: multiple small IOs are first stored in a buffer, and when the buffer reaches a certain capacity, they are written to a persistent storage medium (such as a disk) at one time. The above-mentioned virtual node refers to a distributed storage system. When data is distributed to different physical nodes, a hash algorithm is usually used to map the key of the data to the virtual node, and then the virtual node is mapped to a specific physical node; this ensures that the data is evenly distributed between physical nodes, thereby improving the performance and scalability of the system. Here, the key of the data can be, for example, the storage location (such as a logical address) of the data operation.

[0033] To solve the above technical problems, the present application embodiment provides a data processing method. In order to enable those skilled in the art to better understand the technical solution provided by the present application embodiment, and to make the above-mentioned purposes, features and advantages of the present application embodiment more obvious and easy to understand, the technical solution in the present application embodiment is further described in detail below in conjunction with the accompanying drawings.

[0034] See also Figure 1 , Figure 1A flow chart of a method provided in an embodiment of the present application. The method is applied to any designated storage node in a distributed storage system; here, the designated storage node refers to the storage node included in the distributed storage system before the current node expansion. As an embodiment, the storage node may refer to an electronic device such as a server.

[0035] like Figure 1 As shown, the process may include the following steps:

[0036] Step 101, obtain a virtual node migration set, determine a virtual node migration subset corresponding to the node according to the virtual node migration set, and record information of at least one data processing request received and not processed before the current time point into a first processing linked list.

[0037] In this embodiment, the virtual node migration set is composed of at least one virtual node (recorded as a migration virtual node) mapped to the newly added storage node during the current node expansion.

[0038] As an embodiment, the virtual node migration set in this step is determined by the target storage node based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion; here, the target storage node refers to the designated storage node that detects the node expansion event. After determining the virtual node migration set, the target storage node will send the virtual node migration set to each designated storage node respectively. After that, this node can obtain the virtual node migration set and determine the virtual node migration subset corresponding to this node based on the virtual node migration set. As for how to determine the virtual node migration set based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion, the following will be described with examples, which will not be repeated here.

[0039] In this embodiment, the above-mentioned detection of the node expansion event includes: when receiving a node expansion indication sent by the client, determining that the node expansion event is detected. The node expansion indication here is initiated by the client when receiving a node expansion instruction triggered by the user on the client interface.

[0040] As an embodiment, the above-mentioned determination of the virtual node migration subset corresponding to the current node based on the virtual node migration set may be specifically implemented as follows: first, a virtual node mapping table in the local storage is obtained, and the virtual node mapping table indicates at least one virtual node mapped to the current node before the current node expansion; then, for each virtual node in the virtual node mapping table, based on the node identifier corresponding to the virtual node (such as the node number, etc.), check whether the virtual node is in the virtual node migration set; if so, determine that the virtual node is the migration virtual node corresponding to the current node; finally, construct the virtual node migration subset corresponding to the current node based on all the determined migration virtual nodes.

[0041] In this embodiment, the current time point can be considered to refer to the time point corresponding to when the virtual node migration subset corresponding to the node is determined. Based on this, the data processing request that has been received and not processed before the current time point can be considered to refer to the data processing request that has been received before the current time point but has not yet been returned to the client for response. Optionally, the data processing request here can include, for example, a read data request and a write data request.

[0042] Step 102, receiving a data processing request. When the data processing request is a write data request, the write data request indicates a node identifier corresponding to a virtual node that matches the storage location to which the data is to be written. If it is determined that the virtual node corresponding to the node identifier is in the virtual node migration subset, the write data request is added to a cache queue for caching write data requests that require write-time redirection processing. Otherwise, the write data request information is added to the second processing linked list until it is found that all data processing requests in the first processing linked list have been processed.

[0043] In this embodiment, for the data processing request received after determining the virtual node migration subset corresponding to this node, when the data processing request is a write data request, if it is determined that the virtual node corresponding to the node identifier indicated by the data request is in the virtual node migration subset, the write data request is added to the cache queue used to cache write data requests that need to be redirected during write processing; otherwise, the information of the write data request is added to the second processing linked list until it is found that all data processing requests in the first processing linked list have been processed.

[0044] It should be noted that the data processing requests in the first processing linked list and the second processing linked list will be processed normally in the order in which they are written into the linked lists; here, normal processing refers to cache processing according to the cache technology method described above.

[0045] It should also be noted that, when it is found that all data processing requests in the first processing linked list have been processed, the information of the received write data request is stopped from being added to the second processing linked list to avoid the second processing linked list from being unable to be cleared forever; then, in this embodiment, the read data request received after it is found that all data processing requests in the first processing linked list have been processed is processed normally; and for the received write data request, it is also determined whether the virtual node corresponding to the write data request is in the virtual node migration set. If so, the write data request is added to the cache queue for caching write data requests that need to be redirected during write processing, otherwise the information of the write data request is added to the pre-configured cache processing linked list, waiting for cache processing.

[0046] Step 103, when it is found that all write data requests in the second processing linked list have been processed, the cache data corresponding to the write data requests in the current flushing linked list are flushed until the set flushing stop condition is reached.

[0047] In this embodiment, when it is found that all write data requests in the second processing linked list have been processed, it may indicate that all write data requests in the current first processing linked list have been inserted into the disk flushing linked list to wait for disk flushing processing. At this time, the cache data corresponding to the write data requests in the current disk flushing linked list can be flushed until the set disk flushing stop condition is reached.

[0048] In this embodiment, the above-mentioned disk flushing refers to writing the cached data to a persistent storage medium (such as a disk, etc.). Setting the disk flushing stop condition means: the target log object is deleted; the target log object records the operation log corresponding to the last processed write data request in the first processing list. The target log object here is deleted (that is, the disk flushing stop condition is reached), which indicates that the cached data corresponding to all write data requests in the first processing list have been flushed. As for how to determine the target log object, it will be described with examples below, which will not be repeated here.

[0049] So far, completed Figure 1 The process shown.

[0050] pass Figure 1 It can be seen from the shown process that in the embodiment of the present application, when a node expansion occurs in the distributed storage system, the virtual node migration subset corresponding to the node is first determined, and then, for a received write data request whose corresponding virtual node is not in the virtual node migration subset, the write data request is added to the second processing linked list and waits for normal processing, without having to wait for the virtual node to be flushed before processing. This can effectively avoid the performance degradation problem of the distributed storage system when node expansion occurs, and improve data processing efficiency.

[0051] The following describes how to determine the virtual node migration set in the above step 101 based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion:

[0052] As an embodiment, there are many ways to implement the above-mentioned method of determining the virtual node migration set based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the current node expansion. For example, first, based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the current node expansion, determine at least one virtual node corresponding to each storage node, and record the virtual node mapping table composed of at least one virtual node corresponding to each storage node as the new virtual node mapping table corresponding to the storage node; then, determine the virtual nodes corresponding to each newly added storage node after the current node expansion as migration virtual nodes; finally, construct a virtual node migration set based on the determined migration virtual nodes.

[0053] In this embodiment, based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion, at least one virtual node corresponding to each storage node is determined. In the specific implementation, for example, for each virtual node among all virtual nodes, a modulo operation is first performed on the node identifier (such as the node number, etc.) of the virtual node and the total number of storage nodes to obtain a modulo result, such as the modulo result of the node identifier 1 and the total number of storage nodes 4 is 1; then, the storage node corresponding to the storage node identifier matching the modulo result is determined as the storage node mapped to the virtual node, such as the storage node 1 matching the above modulo result 1 is the storage node mapped to the virtual node 1.

[0054] The virtual node migration subset of the node in step 101 is described below:

[0055] As an embodiment, this node preconfigures N threads for processing data processing requests, where N is greater than 1, for concurrent processing of data processing requests to improve data processing efficiency. Each thread corresponds to a partial virtual node migration subset; the partial virtual node migration subsets corresponding to each thread are different; and the partial virtual node migration subsets corresponding to each thread constitute a virtual node migration subset.

[0056] In this embodiment, there are many specific implementation methods for determining the partial virtual node migration subset corresponding to each thread. For example, for each migration virtual node in the virtual node migration subset corresponding to the present node, first calculate the remainder value between the node identifier corresponding to the migration virtual node and the total number of threads, then determine the thread corresponding to the thread identifier (such as the thread number, etc.) matching the remainder value as the thread assigned to the migration virtual node; finally, construct the partial virtual node migration subset corresponding to each thread based on at least one migration virtual node assigned to the thread.

[0057] Based on the above description, as an embodiment, after receiving a data processing request, this node will allocate the data processing request to a thread matching the virtual node identifier for processing based on the virtual node identifier indicated by the data processing request.

[0058] The following describes how to determine the target log object in step 103 above:

[0059] As an embodiment, the above-mentioned determination of the target log object can be specifically implemented as follows: when it is found that all data processing requests in the first processing list have been processed, it indicates that the operation logs corresponding to the various write data requests in the current first processing list have been recorded in the corresponding log objects. Therefore, at this time, the currently used log object can be obtained from the multiple log objects configured for recording the operation logs corresponding to the write data requests as the target log object. The target log object must record the operation log corresponding to the last processed write data request in the first processing list.

[0060] As an embodiment, for any used log object, only after the cache data corresponding to the write data request corresponding to all operation logs in the used log object have been flushed, can the used log object be deleted accordingly. Therefore, if the operation logs recorded in the used log object are fewer, the earlier it is deleted. Based on this, in order to ensure that the target log object can be deleted as soon as possible in the future, so as to reach the flushing stop condition as soon as possible, here, after determining the target log object, the target log object can be stopped to avoid having new operation logs recorded in the target log object, but the next unused log object in the configured log object is used as the log object currently in use.

[0061] The following describes the log object processing operation in step 103 after completing the disk flushing of the cache data corresponding to each write data request in the current disk flushing chain list:

[0062] As an embodiment, for each write data request in the current disk flushing linked list, after completing the disk flushing of the cached data corresponding to the write data request, it can be checked whether the log object recording the operation log corresponding to the write data request also contains the operation log corresponding to the write data request of the incomplete disk flushing; if not, the log object recording the operation log corresponding to the write data request can be deleted.

[0063] The following further describes the processing process after the set disk brushing stop condition is reached in step 103:

[0064] As an embodiment, when it is found that the set disk flushing stop condition is reached, it can be determined that the cache data corresponding to each virtual node in the virtual node migration subset has completed disk flushing, and a disk flushing completion event indicating that the cache data has completed disk flushing is reported to the target storage node;

[0065] Among them, after receiving the disk flushing completion event reported by all designated storage nodes, the target storage node sends the virtual node mapping table update event corresponding to the storage node to each storage node included in the distributed storage system after the node expansion, so as to instruct the storage node to update the local historical virtual node mapping table to the new virtual node mapping table indicated by the virtual node mapping table update event. The new virtual node mapping table here is determined based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion.

[0066] As for how to determine the new virtual node mapping table based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after this node expansion, please refer to the above description of determining the virtual node migration set, which will not be repeated here.

[0067] In order to facilitate understanding of the specific implementation process of the above data processing method, a specific embodiment is described below by way of example.

[0068] See also Figure 2 As shown, the data processing method includes the following steps:

[0069] S201, the main monitoring service module sends a virtual node migration set to the data processing service module of each designated storage node.

[0070] In this embodiment, the node deployed with the main monitoring service module refers to the above-mentioned target storage node; here, when the node deployed with the main monitoring service module detects a node expansion event, it generates a corresponding virtual node migration set and sends the virtual node migration set to the data processing service instance of each designated storage node.

[0071] The node where the main monitoring service module is deployed here refers to the above-mentioned target storage node. This embodiment does not limit the specific functions of the main monitoring service module, for example, it can be used to detect whether there is a capacity expansion event, generate a virtual node migration set, collect disk flushing completion events, etc.

[0072] S202: The data processing service module processes the received virtual node migration set and sends the virtual node migration set to the cache control module.

[0073] Here, there is no specific limitation on how the data processing service instance processes the received virtual node migration set. For example, the virtual node migration set may be recorded in a specified data structure.

[0074] S203: The cache control module calculates a virtual node migration subset based on the virtual node migration set, and uses the first IO count to count the IO requests in flight.

[0075] Here, the in-flight IO request refers to an IO request that has been received but not processed before the current time point. The IO request here can be considered to refer to the above-mentioned data processing request.

[0076] S204: The cache control module switches the cache state to a state of waiting for the first IO count to be cleared.

[0077] The cache control module switches the cache state from the default state to the state of waiting for the first IO count to be cleared, so as to wait for the first IO count to be cleared. The default state here can be considered to refer to the cache state corresponding to the above-mentioned normal mode. For the specific implementation principle of the normal mode, please refer to the above description, which will not be repeated here.

[0078] S205: The cache control module processes the write IO request based on a determination result of whether the virtual node corresponding to the received write IO request is in the virtual node migration subset.

[0079] In a specific implementation, for example, the cache control module receives an IO request. If the IO request is a write IO request, it determines whether the virtual node corresponding to the virtual node identifier indicated by the write IO request is in the virtual node migration subset. If so, the write IO request is added to the specified cache queue to be transparently transmitted to the write-time redirection module for processing after the subsequent disk flushing is completed; otherwise, the write IO request is counted in the second IO count.

[0080] Here, the designated cache queue refers to a cache queue used to cache write data requests that need to be redirected during write processing. The above-mentioned use of the second IO count to count the write IO requests received after the state switching is to prevent the first IO count from being unable to be cleared.

[0081] S206: After finding that the first IO count is cleared, the cache control module obtains the currently used log object from the cache log module as the target log object.

[0082] S207, the cache control module notifies the cache log module to replace the currently used log object with the next unused log object.

[0083] S208: The cache control module switches the cache state to a state of waiting for the second IO count to be cleared.

[0084] The cache control module switches the cache state from the state of waiting for the first IO count to be cleared to the state of waiting for the second IO count to be cleared, so as to wait for the second IO count to be cleared.

[0085] S209: The cache control module processes the write IO request based on a determination result of whether the virtual node corresponding to the received write IO request is in the virtual node migration subset.

[0086] In a specific implementation, for example, the cache control module receives an IO request. If the IO request is a write IO request, it determines whether the virtual node corresponding to the virtual node identifier indicated by the write IO request is in the virtual node migration subset. If so, the write IO request is added to the specified cache queue to be transparently transmitted to the write-time redirection module for processing after the subsequent disk flushing is completed; otherwise, the write IO request is counted in the first IO count.

[0087] Here, the write IO request received after the first IO count statistical state is continuously multiplexed is to prevent the second IO count from being unable to be cleared.

[0088] S210, after discovering that the second IO count is cleared, the cache control module notifies the cache flushing module to switch the flushing mode to the forced flushing mode.

[0089] After discovering that the second IO count is cleared, the cache control module notifies the cache flushing module to switch the flushing mode to the forced flushing mode to force flushing the flushing units in the current flushing list. The flushing unit here can be considered to refer to a unit that contains a write IO request. Flushing the flushing unit can be understood as writing the cache data corresponding to the write IO request corresponding to the flushing unit to a persistent storage medium (such as a disk).

[0090] S211, when the cache control module finds that the disk flushing units corresponding to all write IO requests in any used log object have been flushed, it notifies the cache log module to delete the log object.

[0091] It should be noted that after notifying the cache log module to delete the log object, if it is found that the deletion is not successful, the cache log module will be notified to delete the log object multiple times until the deletion is successful.

[0092] S212, when the cache control module finds that all the disk flushing units corresponding to the target log object have been flushed, the cache state is switched to the disk flushing completion state.

[0093] S213, the cache control module notifies the data processing service module that the disk flushing is completed.

[0094] S214, the data processing service module reports the disk flushing completion event to the main monitoring service module.

[0095] S215, after receiving the disk flushing completion events reported by all designated storage nodes, the main monitoring service module sends the new virtual node mapping table to the data processing service module on each storage node.

[0096] S216, the data processing service module updates the historical virtual node mapping table to the received new virtual node mapping table, and notifies the cache control module that the virtual node mapping table has been updated.

[0097] S217, the cache control module switches the cache state to a default state.

[0098] The above describes the data processing interaction process provided by this embodiment. The following further describes the data processing interaction process with examples in conjunction with the implementation diagram of write IO request cache processing:

[0099] First, if Figure 3 As shown, it is assumed that the IO requests counted by the first IO count are 3 write IO requests; at the current moment, the state of waiting for the first IO count to be cleared is that the first IO count is 3, and the second IO count is 0. Among them, write IO request 20 has entered the processing linked list of the cache log module, and write IO request 21 and write IO request 22 have entered the processing linked list of the cache IO processing module. At this time, the write IO request is to be written into the log object 11 (that is, the log object currently in use). Since no write IO request has been processed at this time, the disk flushing linked list in the cache disk flushing module is empty (that is, NULL). Here, after the write IO request is inserted into the disk flushing linked list, the client response will be returned immediately to indicate that the write IO request has been processed, and at this time the write IO request has been processed.

[0100] In the next moment, see Figure 4 As shown, write IO requests 20 to write IO request 22 all enter the processing linked list of the cache log module, where write IO requests 20 and 22 have been written into log object 11. At this time, log object 11 is full, and write IO request 22 is about to be written into log object 12, that is, the log object currently in use becomes log object 12.

[0101] Then, when the first IO count is cleared, the cache IO processing module notifies the cache control module; the cache control module obtains the log object currently in use by the cache log module as the target log object, and requires the cache log module to forcibly replace the currently in use log object with the next unused log object. Figure 5As shown, the log object currently in use is switched from log object 12 to log object 13; after the log object is switched, the cache control module switches the cache state to the state of waiting for the second IO count to be cleared, to wait for the second IO count to be cleared. In this state of waiting for the second IO count to be cleared, it is necessary to judge each received write IO request. If the virtual node to which the object to which it operates belongs is in the virtual node migration subset, the write IO request is inserted into the IO cache queue, and after the disk flushing is completed, it is transparently transmitted to the write-time redirection module for processing. Otherwise, the write IO request is processed normally, and the write IO request count is added to the first IO count (i.e., the first IO count is reused) to avoid the second IO count being unable to be cleared.

[0102] Then as Figure 5 As shown, write IO requests 20, 21, and 22 return a successful response to the client, which means that write IO requests 20, 21, and 22 are processed and completed, and the first IO count is equal to 0. While waiting for the first IO count to be cleared, write IO requests 23 and 24 arrive at the cache log module. The write IO requests 23 and 24 are still mapped to log object 12. At this time, the currently used log object obtained is log object 12 as the target log object; after the cache log module replaces the log object, the currently used log object is switched to log object 13, thereby ensuring that subsequent write IO requests will no longer write to log object 12. At this moment, the write IO requests 20, 21, and 22 in the cache disk flushing module's disk flushing linked list have not completed the disk flushing, so the log object 11 is not deleted.

[0103] After that, when the second IO count is cleared, the cache control module will use the previously acquired target log object ID to modify the log object ID of the last flush unit in the cache flush module flush list. The non-zero number below the flush unit means that the current log object is full, and subsequent write IO requests will be written to the new log object. For example, see Figure 6 As shown, write IO requests 23 and 24 return successfully, and the second IO count is equal to 0. While waiting for the second IO count to be cleared, write IO requests 25, 26, and 27 arrive at the cache log module. Since the cache log module changes the log object, write IO requests 25, 26, and 27 are mapped to log object 13. At the same time, the log object ID of the last disk flushing unit (i.e., disk flushing unit 24) in the disk flushing list of the cache disk flushing module is modified to 12.

[0104] After that, the cache control module changes the flushing mode of the cache flushing module to forced flushing and waits for the flushing to be completed. Figure 7 As shown, the condition for disk flushing to be completed is that the disk flushing unit with log object ID 12 (ie, disk flushing unit 24) flushes the disk successfully.

[0105] The cache control module uses synchronous deletion to delete the log objects that have been flushed to disk. If it fails, it will keep retrying until the deletion succeeds. For example, Figure 8 After the disk flushing unit 24 in the log object 12 completes the disk flushing, since the write IO request 24 corresponding to the disk flushing unit 24 is the last write IO request to be processed by the disk flushing in the log object 12, after the disk flushing unit corresponding to the write IO request 24 is completed, it indicates that the disk flushing units corresponding to all write IO requests in the log object 12 have completed the disk flushing, and the log object 12 can be deleted synchronously at this time. After the deletion is successful, the cache control module will set the cache state to the disk flushing completion state. In this state, it is still necessary to judge each received write IO request. If the corresponding virtual node is in the virtual node migration subset, the write IO request is transparently transmitted to the write-time redirection module for processing, otherwise the write IO request is processed normally.

[0106] It should be noted that if Figure 8 As shown, after the log object 12 containing the last write IO request 22 suspected to be corresponding to the migration virtual node is deleted, the subsequent log objects no longer contain the data of the migration virtual node. Therefore, after the log object 12 is deleted, it can be indicated that the cache data corresponding to the migration virtual node has been flushed to the disk, and the flushing can be stopped at this time.

[0107] Finally, after discovering that the cache flushing module has stopped flushing, the cache control module notifies the data processing service module that the flushing is complete; the data processing service module notifies the main monitoring service module that the flushing is complete. When the main monitoring service module finds that all designated storage nodes have completed flushing, the main monitoring service module will send the new virtual node mapping table to the data processing service of each storage node. The data processing service module that receives the new virtual node mapping table notifies the cache control module that the virtual node mapping table has changed, instructing the cache control module to reset the cache state to the default state, and the cache processing expansion is completed.

[0108] In the embodiment of the present application, when the cache is flushed, for the write IO requests corresponding to the virtual nodes that are not migrated, the cache can continue to be used to process the write IO requests normally to reduce the time of IO dropping to zero; only the write IO requests corresponding to the migrated virtual nodes need to be transparently passed to the write-time redirection module for processing, which can effectively reduce the impact on the performance of the distributed storage system compared with the full-transparent mode. Among them, when entering the expansion state, since the write IO requests of the virtual nodes to be migrated will be transparently passed to the write-time redirection module for processing, no new logs will be generated in the cache. Therefore, as long as the log objects corresponding to the IO in flight at this time are deleted, it can be ensured that after the expansion is completed, there are no log objects of the migrated virtual nodes in the original physical node.

[0109] At this point, the description of the method provided in the embodiment of the present application is completed. The following is a description of the device provided in the embodiment of the present application:

[0110] As an embodiment, this embodiment also provides a data processing device. Fig. 9 , Fig. 9 This is a schematic diagram of the device structure provided in the embodiment of the present application. Fig. 9 As shown, the device 900 includes:

[0111] The acquisition module 901 is used to obtain a virtual node migration set, determine a virtual node migration subset corresponding to the current node according to the virtual node migration set; and record information of at least one data processing request that has been received and not processed before the current time point into a first processing linked list; the virtual node migration set is composed of at least one virtual node mapped to a newly added storage node during the current node expansion;

[0112] The receiving module 902 is used to receive a data processing request. When the data processing request is a write data request, the write data request indicates a node identifier corresponding to a virtual node that matches a storage location to which the data is to be written; if it is determined that the virtual node corresponding to the node identifier is in the virtual node migration subset, the write data request is added to a cache queue for caching write data requests that need to be redirected during write processing; otherwise, the write data request information is added to the second processing linked list until it is found that all data processing requests in the first processing linked list have been processed;

[0113] The disk flushing module 903 is used to flush the cached data corresponding to the write data request in the current disk flushing list when it is found that all the write data requests in the second processing list have been processed, until the set disk flushing stop condition is reached; the set disk flushing stop condition means: the target log object is deleted; the target log object records the operation log corresponding to the last processed write data request in the first processing list.

[0114] As an embodiment, the virtual node migration set is determined by the target storage node based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion; the target storage node refers to the designated storage node that detects the node expansion event.

[0115] As an embodiment, this node preconfigures N threads for processing data processing requests, where N is greater than 1; each thread corresponds to a partial virtual node migration subset; the partial virtual node migration subsets corresponding to each thread are different; the partial virtual node migration subsets corresponding to each thread constitute the virtual node migration subset.

[0116] As an embodiment, the target log object is determined in the following manner: when it is found that all data processing requests in the first processing linked list have been processed, the currently used log object is obtained as the target log object from multiple log objects configured for recording operation logs corresponding to write data requests.

[0117] As an embodiment, after obtaining the currently used log object as the target log object, the device further includes: a determination module, configured to use the next unused log object among the configured log objects as the currently used log object.

[0118] As an embodiment, the disk flushing module 903 is further used to: for each write data request in the current disk flushing linked list, after completing the disk flushing of the cached data corresponding to the write data request, check whether the log object recording the operation log corresponding to the write data request also contains the operation log corresponding to the write data request of the incomplete disk flushing; if not, delete the log object recording the operation log corresponding to the write data request.

[0119] As an embodiment, the disk flushing module 903 is further used to: when it is found that the set disk flushing stop condition is reached, determine that the cache data corresponding to each virtual node in the virtual node migration subset has completed disk flushing, and report a disk flushing completion event indicating that the cache data has completed disk flushing to the target storage node;

[0120] Among them, after receiving the disk flushing completion event reported by all designated storage nodes, the target storage node sends the virtual node mapping table update event corresponding to the storage node to each storage node included in the distributed storage system after this node expansion, so as to instruct the storage node to update the local historical virtual node mapping table to the new virtual node mapping table indicated by the virtual node mapping table update event; the new virtual node mapping table is determined based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after this node expansion. At this point, the completion Fig. 9 Structural description of the device shown.

[0121] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0122] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0123] See also Fig.10, is a schematic diagram of the hardware structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device may include a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004. The processor 1001, the communication interface 1002 and the memory 1003 communicate with each other through the communication bus 1004. Among them, the memory 1003 stores computer program instructions; the processor 1001 can execute the steps of the method described in the above embodiment by executing the computer program instructions stored in the memory 1003. The electronic device may also include other hardware according to the actual function of the electronic device, which will not be described in detail.

[0124] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a number of computer program instructions are stored. When the computer program instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0125] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof. The processor and memory may be supplemented by or incorporated into a dedicated logic circuit.

[0126] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A data processing method, characterized in that: The method is applied to any designated storage node in a distributed storage system; the designated storage node refers to a storage node included in the distributed storage system before the current node expansion; the method includes: Obtain a virtual node migration set, and determine a virtual node migration subset corresponding to the node according to the virtual node migration set; and record information of at least one data processing request that has been received and not processed before the current time point into a first processing linked list; the virtual node migration set is composed of at least one virtual node mapped to a newly added storage node during the current node expansion; Receive a data processing request, when the data processing request is a write data request, the write data request indicates a node identifier corresponding to a virtual node matching a storage location to which data is to be written; if it is determined that the virtual node corresponding to the node identifier is in the virtual node migration subset, add the write data request to a cache queue for caching write data requests that require write-time redirection processing; otherwise, add information about the write data request to a second processing linked list until it is found that all data processing requests in the first processing linked list have been processed; When it is found that all the write data requests in the second processing linked list have been processed, the cached data corresponding to the write data requests in the current disk flushing linked list are flushed until the set disk flushing stop condition is reached; the set disk flushing stop condition means that: the target log object is deleted; the target log object records the operation log corresponding to the last processed write data request in the first processing linked list.

2. The method according to claim 1, characterized in that The virtual node migration set is determined by the target storage node based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion; The target storage node refers to a designated storage node where a node expansion event is detected.

3. The method according to claim 1, characterized in that This node is pre-configured with N threads for processing data processing requests, where N is greater than 1; each thread corresponds to a partial virtual node migration subset; each thread corresponds to a different partial virtual node migration subset; Part of the virtual node migration subsets corresponding to each thread constitutes the virtual node migration subset.

4. The method according to claim 1, characterized in that The target log object is determined in the following way: When it is found that all the data processing requests in the first processing linked list have been processed, a currently used log object is obtained from a plurality of log objects configured for recording operation logs corresponding to the data writing request as a target log object.

5. The method according to claim 4, characterized in that After obtaining the log object currently being used as the target log object, the method further includes: The next unused log object among the configured log objects is used as the currently used log object.

6. The method according to claim 1, characterized in that The method further comprises: For each write data request in the current disk flushing linked list, after completing the disk flushing of the cached data corresponding to the write data request, check whether the log object recording the operation log corresponding to the write data request also contains the operation log corresponding to the write data request that has not completed the disk flushing; If not, the log object recording the operation log corresponding to the write data request is deleted.

7. The method according to claim 2, characterized in that: The method further comprises: When it is found that the set disk flushing stop condition is met, it is determined that the cache data corresponding to each virtual node in the virtual node migration subset has completed disk flushing, and a disk flushing completion event indicating that the cache data has completed disk flushing is reported to the target storage node; Among them, after receiving the disk flushing completion event reported by all designated storage nodes, the target storage node sends a virtual node mapping table update event corresponding to the storage node to each storage node included in the distributed storage system after this node expansion, so as to instruct the storage node to update the local historical virtual node mapping table to the new virtual node mapping table indicated by the virtual node mapping table update event; the new virtual node mapping table is determined based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after this node expansion.

8. A data processing device, characterized in that: The device is configured at any designated storage node in the distributed storage system; the designated storage node refers to the storage node included in the distributed storage system before the current node expansion; the device includes: The acquisition module is used to obtain a virtual node migration set, determine a virtual node migration subset corresponding to the node according to the virtual node migration set; and record information of at least one data processing request received and not processed before the current time point into a first processing linked list; the virtual node migration set is composed of at least one virtual node mapped to a newly added storage node during the current node expansion; A receiving module, used for receiving a data processing request, wherein when the data processing request is a write data request, the write data request indicates a node identifier corresponding to a virtual node matching a storage location to which data is to be written; if it is determined that the virtual node corresponding to the node identifier is in the virtual node migration subset, the write data request is added to a cache queue for caching write data requests that require write-time redirection processing; otherwise, information about the write data request is added to a second processing linked list until it is found that all data processing requests in the first processing linked list have been processed; A disk flushing module is used to flush the cached data corresponding to the write data request in the current disk flushing list when it is found that all write data requests in the second processing linked list have been processed, until the set disk flushing stop condition is reached; the set disk flushing stop condition means: the target log object is deleted; the target log object records the operation log corresponding to the last processed write data request in the first processing linked list.

9. The device according to claim 8, characterized in that The virtual node migration set is determined by the target storage node based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after the node expansion; The target storage node refers to the designated storage node where the node expansion event is detected; and / or, This node is pre-configured with N threads for processing data processing requests, where N is greater than 1; each thread corresponds to a partial virtual node migration subset; The partial virtual node migration subsets corresponding to each thread are different; the partial virtual node migration subsets corresponding to each thread constitute the virtual node migration subset; and / or, The target log object is determined in the following manner: when it is found that all data processing requests in the first processing linked list have been processed, a currently used log object is obtained from a plurality of log objects configured for recording operation logs corresponding to the write data request as the target log object; and / or, After obtaining the currently used log object as the target log object, the device further comprises: a determination module, configured to use the next unused log object among the configured log objects as the currently used log object; and / or, The disk flushing module is further used to: for each write data request in the current disk flushing linked list, after completing the disk flushing of the cache data corresponding to the write data request, check whether the log object recording the operation log corresponding to the write data request also contains the operation log corresponding to the write data request that has not completed the disk flushing; if not, delete the log object recording the operation log corresponding to the write data request; and / or, The disk flushing module is further used to: when it is found that the set disk flushing stop condition is reached, determine that the cache data corresponding to each virtual node in the virtual node migration subset has completed disk flushing, and report the disk flushing completion event indicating that the cache data has completed disk flushing to the target storage node; wherein, after receiving the disk flushing completion events reported by all designated storage nodes, the target storage node sends the virtual node mapping table update event corresponding to each storage node included in the distributed storage system after this node expansion to the storage node, so as to instruct the storage node to update the local historical virtual node mapping table to the new virtual node mapping table indicated by the virtual node mapping table update event; the new virtual node mapping table is determined based on all pre-configured virtual nodes and all storage nodes included in the distributed storage system after this node expansion.

10. An electronic device, characterized in that: The electronic device includes: Processor; and A memory, wherein computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the processor is caused to perform the steps in any one of the methods of claims 1 to 7.

Citation Information

Patent Citations

  • Distributed storage method and distributed storage system

    CN106161610A

  • Data writing and expansion method and device of distributed caching system

    CN108810041A

  • Method, device, equipment and system for sharing and storing synchronous data and storage medium

    CN111966652A

  • Capacity expansion method and device of storage node

    CN115268777A

  • Data disk writing method of database, storage medium and equipment

    CN115599756A

Cited By

  • A cache identification and update method and system for a distributed storage node

    CN122733738A