Data processing method, device, equipment and storage medium
By caching metadata in the computing cluster and generating invalidation messages in a distributed database that separates computing and storage, the problem of low service efficiency of the metadata cluster is solved and the operating efficiency and data consistency of the database are improved.
Patent Information
- Application Number
- CN202111583625.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In distributed databases where computing and storage are separated, the service efficiency of the metadata cluster is not high, especially in high concurrency and high load scenarios, resulting in a decrease in database operating efficiency.
By caching metadata in the computing cluster, generating invalidation messages in the metadata cluster, and sending invalidation messages to the computing cluster according to its subscription range, the cached metadata can be updated in a timely manner to ensure data consistency between the metadata cluster and the computing cluster. .
It improves the service efficiency of the metadata cluster, improves the operating efficiency of the database, and reduces the load of the metadata cluster and the information processing volume of the computing cluster.
Smart Images

Figure CN114238518B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and storage medium. Background Art
[0002] With the development of big data computing, the separation of computing and storage has become the mainstream direction of distributed database development. Separating computing from storage can improve the flexibility of computing resource expansion on the one hand, and on the other hand, different computing services can share storage data, reduce data redundancy, and solve various problems caused by data islands.
[0003] There are also shortcomings in the separation of computing and storage: in the solution of separation of computing and storage, metadata is stored in the metadata cluster, and the computing layer needs to request metadata from the metadata cluster through the network. Affected by factors such as network bandwidth and network latency, the remote access efficiency of metadata is significantly lower than the traditional local storage mode of metadata, which leads to a decrease in database operation efficiency. One way to solve this problem is to use the subtree lock mechanism in Lustre to optimize lock permissions and conflicting access. When a small number of file access conflicts occur, only the metadata cache of the conflicting files in the current directory is withdrawn, instead of withdrawing the metadata of all files in the entire directory. The overhead is small and the access efficiency of metadata is improved. However, in database scenarios, it is often necessary to read the same table and the same data repeatedly in a short period of time. If the above method is used, a large number of locking and withdrawal operations will be generated, and the overhead will increase sharply, which is particularly obvious in high-concurrency scenarios, reducing the service efficiency of metadata.
[0004] Metadata clusters are widely used in distributed storage, but in distributed databases based on the separation of computing and storage, especially in high concurrency and high load scenarios, there is a lack of application cases for metadata clusters. Therefore, with the continuous increase in computing clusters and the continuous increase in concurrency, metadata changes are increasing. How to solve the problem of low service efficiency of metadata clusters has become one of the key technical bottlenecks to improve the efficiency of the entire distributed database. Summary of the invention
[0005] The present application provides a data processing method, apparatus, device and storage medium to solve the problem of low service efficiency of metadata cluster in a distributed database with separated computing and storage.
[0006] In a first aspect, the present application provides a data processing method, which is applied to a distributed database system in which computing and storage are separated, the distributed database system comprising a metadata cluster and a computing cluster, wherein metadata from the metadata cluster is cached in the computing cluster;
[0007] On the metadata cluster side, the data processing method includes:
[0008] In response to a change in target metadata in the metadata cluster, generating a target invalidation message, the target invalidation message indicating that the target metadata cached by the computing cluster is invalid;
[0009] The target invalidation message is sent to the computing cluster according to an invalidation message subscription scope corresponding to the computing cluster, where the invalidation message subscription scope is a scope in which the computing cluster monitors metadata changes in the metadata cluster.
[0010] In a feasible implementation, a metadata service for managing metadata changes is deployed on the metadata cluster, and the generating of a target invalidation message in response to a change in metadata in the metadata cluster includes:
[0011] The target invalidation message is generated when the metadata service changes the target metadata in response to the metadata change request of the computing cluster.
[0012] In a feasible implementation, an invalidation message service for managing invalidation messages of metadata is further deployed on the metadata cluster, and when the metadata service changes the target metadata in response to the metadata change request of the computing cluster, generating the target invalidation message includes:
[0013] In a case where the metadata service changes the target metadata in response to the metadata change request of the computing cluster, transmitting the change information of the target metadata to the invalidation message service through the metadata service;
[0014] In the invalidation message service, the target invalidation message is added to the invalidation message queue according to the change information of the target metadata.
[0015] In a feasible implementation, the invalidation message queue includes invalidation messages received by the invalidation message service within a time period, and sending the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster includes:
[0016] Based on the invalidation message subscription range, the target invalidation message is sent to the computing cluster through the invalidation message service according to the time period.
[0017] In a feasible implementation, sending the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster includes:
[0018] Determining, in the computing cluster, a target computing cluster that caches the target metadata according to the invalidation message subscription scope;
[0019] The target failure message is sent to the target computing cluster.
[0020] In a feasible implementation, the target invalidation message includes an identifier of the target metadata, the invalidation message range includes an identifier of the metadata cached by the computing cluster, and determining, in the computing cluster according to the invalidation message subscription range, a target computing cluster that caches the target metadata includes:
[0021] Determining a target scope including an identifier of the target metadata in the invalidation message subscription scope;
[0022] The target computing cluster is determined to be a computing cluster corresponding to the target range.
[0023] In a feasible implementation, sending the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster includes:
[0024] In response to the invalidation message acquisition request from the target computing cluster, the target invalidation message is sent to the target computing cluster according to the invalidation message subscription range corresponding to the target computing cluster.
[0025] In a second aspect, the present application provides a data processing method, which is applied to a distributed database system in which computing and storage are separated, the distributed database system comprising a metadata cluster and a computing cluster, wherein metadata from the metadata cluster is cached in the computing cluster;
[0026] On the computing cluster side, the data processing method includes:
[0027] receiving a target invalidation message from the metadata cluster;
[0028] According to the target invalidation message, updating the target metadata cached by the computing cluster;
[0029] The target invalidation message indicates that the target metadata cached by the computing cluster is invalid.
[0030] In a feasible implementation, the computing cluster includes a management node and multiple computing nodes, and the receiving of a target invalidation message from the metadata cluster includes:
[0031] Receiving the target failure message through the management node;
[0032] The target failure message is forwarded to the multiple computing nodes through the management node.
[0033] In a feasible implementation, the present invention further includes:
[0034] In response to a received metadata access request from a terminal, determining whether the metadata to be accessed is metadata cached by the computing cluster;
[0035] If the metadata to be accessed is metadata cached by the computing cluster, reading the metadata to be accessed from the cache of the computing cluster;
[0036] If the metadata to be accessed is not metadata cached by the computing cluster, a request is made to the metadata cluster to obtain the metadata to be accessed.
[0037] In a feasible implementation manner, before receiving the target invalidation message from the metadata cluster, the method further includes:
[0038] Determine, according to the metadata cache range of the computing cluster, the invalidation message subscription range corresponding to the computing cluster, and send an invalidation message subscription request to the metadata cluster;
[0039] The invalidation message subscription request includes the invalidation message subscription range.
[0040] In a third aspect, the present application provides a data processing device, which is applied to a distributed database system in which computing and storage are separated, wherein the distributed database system includes a metadata cluster and a computing cluster, wherein metadata from the metadata cluster is cached in the computing cluster;
[0041] On the metadata cluster side, the data processing device includes:
[0042] A generating module, configured to generate a target invalidation message in response to a change in the target metadata in the metadata cluster, wherein the target invalidation message indicates that the target metadata cached by the computing cluster is invalidated;
[0043] The sending module is used to send the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster, and the invalidation message subscription range is the range in which the computing cluster monitors metadata changes in the metadata cluster.
[0044] In a fourth aspect, the present application provides a data processing device, which is applied to a distributed database system in which computing and storage are separated, wherein the distributed database system includes a metadata cluster and a computing cluster, wherein metadata from the metadata cluster is cached in the computing cluster;
[0045] On the computing cluster side, the data processing device includes:
[0046] A receiving module, used for receiving a target invalidation message from the metadata cluster;
[0047] An updating module, configured to update the target metadata cached by the computing cluster according to the target invalidation message;
[0048] The target invalidation message indicates that the target metadata cached by the computing cluster is invalid.
[0049] In a fifth aspect, the present application provides an electronic device, comprising: at least one processor and a memory;
[0050] The memory stores computer-executable instructions;
[0051] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the data processing method as described in the first aspect or any feasible implementation of the first aspect, or so that the at least one processor executes the data processing method as described in the second aspect or any feasible implementation of the second aspect.
[0052] In a sixth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the data processing method as described in the first aspect or any feasible implementation of the first aspect, or, when the computer execution instructions are executed by a processor, they are used to implement the data processing method as described in the second aspect or any feasible implementation of the second aspect.
[0053] In the seventh aspect, the present application provides a computer program product, which, when executed by a processor, implements the data processing method as described in the first aspect or any feasible implementation of the first aspect, or, when executed by a processor, implements the data processing method as described in the second aspect or any feasible implementation of the second aspect.
[0054] The data processing method, device, equipment and storage medium provided by the present application are applied to a distributed database system with separated computing and storage. In the distributed data system, a metadata cluster and a computing cluster are included, and metadata from the metadata cluster is cached in the computing cluster. On the metadata cluster side, when the metadata in the metadata cluster changes, an invalidation message is generated to indicate that the changed metadata is invalid in the cache of the computing cluster, and an invalidation message is sent to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster, so that the computing cluster can update the changed metadata in time.
[0055] Therefore, by utilizing metadata caching, invalidation message generation, invalidation message subscription, and validity message sending, the service efficiency of the metadata cluster is improved, and the operation efficiency of the database is improved, while ensuring that the metadata cached by the computer is consistent with the corresponding metadata on the metadata cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0057] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0058] Figure 2 A flowchart of a data processing method provided in one embodiment of the present application;
[0059] Figure 3 A flowchart of a data processing method provided by another embodiment of the present application;
[0060] Figure 4 This is a flowchart of a data processing method provided by another embodiment of the present application;
[0061] Figure 5 A schematic diagram of the structure of a distributed database system provided in one embodiment of the present application;
[0062] Figure 6 A schematic diagram of the structure of a data processing device provided in one embodiment of the present application;
[0063] Figure 7 A schematic diagram of the structure of a data processing device provided in another embodiment of the present application;
[0064] Figure 8 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0067] First, the terms used in this application are explained:
[0068] Metadata (also known as intermediate data): refers to data used to describe data, such as information used to describe data attributes.
[0069] Metadata cluster (also called metadata server cluster): In a distributed database system where computing and storage are separated, the metadata cluster provides a unified metadata access portal. The metadata on the computing cluster is obtained through the metadata cluster. Specifically, the metadata cluster acts as a storage layer and provides metadata services to the computing cluster as a computing layer, such as metadata reading, storage, and modification services.
[0070] Computing cluster: includes multiple computing nodes. In a distributed database system where computing and storage are separated, the computing cluster serves as the computing layer and is used to perform corresponding computing tasks.
[0071] Next, the application scenarios involved in this application are described.
[0072] The data processing method provided in this application can be applied to Figure 1 The application scenario shown in Figure 1. Figure 1 As shown, the application scenario includes a distributed database system with separated computing and storage, and the distributed database system includes a storage layer and a computing layer. The storage layer includes a metadata cluster 110 for storing metadata and providing metadata services, and the computing layer includes a computing cluster 120, which includes multiple computing nodes for executing corresponding computing tasks.
[0073] In a distributed database system where computing and storage are separated, the computing layer needs to request metadata from the storage layer through the network. Affected by factors such as network bandwidth and network latency, the efficiency of metadata services and database operation efficiency decreases. This shortcoming is particularly evident in high-concurrency and high-load scenarios.
[0074] To solve the above problems, the inventor proposes to improve the access efficiency of metadata by caching metadata in a computing cluster. At the same time, considering the continuous increase in computing clusters, the continuous increase in concurrency, and the increasing number of metadata changes, in the way of caching metadata in a computing cluster, how to ensure the consistency of the metadata cached by the computing cluster and the corresponding metadata in the metadata cluster, the inventor proposes to generate corresponding invalidation messages for the changed metadata in the metadata cluster, and inform the computing cluster through the invalidation message that its cached metadata is invalid due to changes on the metadata cluster side. The computing cluster updates the cached metadata in a timely manner based on the invalidation message.
[0075] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0076] Exemplarily, each method embodiment in the present application is applied to a distributed database system with separated computing and storage, wherein the distributed database system includes a computing cluster and a metadata cluster, and the computing cluster caches metadata from the metadata cluster. Optionally, the computing cluster can cache its own frequently used metadata according to the frequency of metadata use, which can not only improve the efficiency of the computing cluster in reading metadata, but also prevent the metadata from occupying too much storage space of the computing cluster.
[0077] refer to Figure 2 , Figure 2 The following is a flow chart of a data processing method provided by an embodiment of the present application. Figure 2 As shown, the data processing method includes:
[0078] S201 . In response to a change in target metadata in a metadata cluster, the metadata cluster generates a target invalidation message, where the target invalidation message indicates that the target metadata cached by the computing cluster is invalid.
[0079] The target metadata is the metadata that has changed in the metadata cluster, and the target invalidation message is the invalidation message corresponding to the target metadata. Different invalidation messages can be generated for different metadata.
[0080] The change of the target metadata may include at least one of the following: the target metadata is deleted, and the target metadata is modified.
[0081] In this embodiment, when the target metadata in the metadata cluster is changed, if the target metadata is cached in the computing cluster, the target metadata in the computing cluster is inconsistent with the changed target metadata in the metadata cluster, so the target metadata cached by the computing cluster has lost its function. Therefore, a target invalidation message can be generated in the metadata cluster for the changed target metadata.
[0082] S202: According to the invalidation message subscription range corresponding to the computing cluster, the metadata cluster sends a target invalidation message to the computing cluster.
[0083] Among them, the invalidation message subscription scope corresponding to the computing cluster is the scope of the computing cluster's monitoring (or attention) of metadata changes in the metadata cluster, that is, the computing cluster needs to monitor which metadata changes in the computing cluster, which can also be understood as the invalidation messages of which metadata the computing cluster subscribes to.
[0084] Among them, in a distributed database system where computing and storage are separated, a metadata cluster can provide metadata services for multiple computing clusters. Different computing clusters perform different computing tasks and may require different metadata. Considering that the metadata required by each computing cluster is generally relatively fixed, and metadata within a relatively fixed range is usually cached, it is meaningless and a waste of computing resources for the computing cluster to receive and process invalidation messages of all metadata. Therefore, by subscribing to the invalidation information range corresponding to the computing cluster, each computing cluster can subscribe to the invalidation messages of its commonly used metadata, reducing the load of the metadata cluster, and also reducing the number of invalidation messages that the computing cluster needs to receive and process.
[0085] In this embodiment, after the target invalidation message is generated, for each computing cluster, it can be determined whether the computing cluster subscribes to the invalidation message of the target metadata, that is, whether it subscribes to the target invalidation message, based on the invalidation message subscription range corresponding to the computing cluster. If the computing cluster subscribes to the target invalidation message, the target invalidation message is sent to the computing cluster, otherwise, the target invalidation message is not sent to the computing cluster. Compared with the method of sending the target invalidation message to all computing clusters, the method of sending the target message to the computing cluster based on the invalidation message subscription range corresponding to the computing cluster in this embodiment can reduce the amount of information sent by the metadata cluster, reduce the load of the metadata cluster, and improve the efficiency of the metadata cluster.
[0086] S203: According to the target invalidation message, the computing cluster updates the cached target metadata.
[0087] In this embodiment, after receiving the target invalidation message, the computing cluster can know that the target metadata cached by itself has expired, and can request the metadata cluster to obtain the changed target metadata, and update the target metadata cached in the computing cluster to ensure the consistency between the target metadata cached by the computing cluster and the target metadata in the metadata cluster.
[0088] In the embodiment of the present application, in a distributed database system where computing and storage are separated, the computing cluster caches metadata from the metadata cluster. When the metadata changes, the metadata cluster generates an invalidation message indicating that the metadata cached by the computing cluster is invalidated due to the change, and sends the invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster. Thus, by caching metadata in the computing cluster, the computing cluster is prevented from frequently reading metadata remotely, and the metadata service efficiency is improved. At the same time, by monitoring the changes in metadata, the corresponding computing cluster is promptly reminded of the invalidation of the metadata cached, ensuring the consistency of the metadata cached by the computing cluster with the metadata in the metadata cluster.
[0089] In some embodiments, the invalidation message may include an identifier of the changed metadata, that is, the target invalidation message may include an identifier of the target metadata, thereby facilitating the computing cluster to determine the invalidated target metadata in the cached metadata according to the metadata identifier in the invalidation message.
[0090] Among them, different metadata have different identifiers.
[0091] Optionally, the metadata identifier includes the metadata ID and / or the metadata storage address, etc.
[0092] In some embodiments, the invalidation message subscription scope may include an identification scope of metadata.
[0093] The metadata identification range may be reflected as one or more metadata identifications, or as a value range of metadata identifications. For example, the invalidation message subscription range corresponding to the computing cluster includes metadata identifications a1 and a2, indicating that the computing cluster is concerned about changes in metadata with identifications a1 and a2; for another example, the invalidation message subscription range corresponding to the computing cluster includes metadata identification value range a1 to a3, indicating that the computing cluster is concerned about changes in metadata with identifications within the range a1 to a3.
[0094] In this embodiment, in the process of the metadata cluster sending the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster, for each computing cluster, it can be determined whether the identifier of the target metadata is within the invalidation message subscription range corresponding to the computing cluster. If so, it is determined that the computing cluster has subscribed to the target invalidation message, and the target invalidation message is sent to the computing cluster; otherwise, it is determined that the computing cluster has not subscribed to the target invalidation message, and the target invalidation message is not sent to the computing cluster.
[0095] In some embodiments, one or more services may be deployed in the metadata cluster to be responsible for managing metadata changes and / or invalidation messages in the metadata cluster.
[0096] Deploy one or more services in the metadata cluster, including at least one of the following implementations:
[0097] In a possible implementation, a metadata service is deployed on the metadata cluster, and the metadata service is used to manage changes to metadata in the metadata cluster. When the metadata service is deployed on the metadata cluster, the metadata cluster can generate a target invalidation message when the metadata service changes the target metadata in response to a metadata change request of the computing cluster.
[0098] The metadata change request is used to request to change the target metadata.
[0099] In this implementation, the metadata cluster can receive a metadata change request from the computing cluster through the metadata service. In the metadata service, in response to the metadata change request, the target metadata in the metadata cluster is changed, and then a target invalidation message is generated to record the change of the target metadata.
[0100] Optionally, in addition to metadata changes, the metadata service can also be responsible for metadata search in the metadata cluster, providing a unified metadata "add, delete, modify, and query" service for the computing cluster.
[0101] In another possible implementation, in addition to the metadata service, an invalidation message service is also deployed on the metadata cluster, and the invalidation message service is used to manage the invalidation message of the metadata. The management of the invalidation message of the metadata includes collating and sending the invalidation message of the metadata. Therefore, the metadata service can pass the target invalidation message to the invalidation message service, and the invalidation message service forwards the target invalidation message to the computing cluster that subscribes to the target invalidation message.
[0102] refer to Figure 3 , Figure 3 FIG. 1 is a flow chart of a data processing method provided by another embodiment of the present application. Figure 3 As shown, when a metadata service and an invalidation message service are deployed on a metadata cluster, the data processing method provided in this embodiment includes:
[0103] S301 . When the metadata service changes target metadata in response to a metadata change request from a computing cluster, the metadata cluster transmits target metadata change information to an invalidation message service through the metadata service.
[0104] In this embodiment, the metadata cluster receives the metadata change request of the computing cluster through the metadata service, and the metadata service can change the target metadata stored in the metadata cluster in response to the metadata change request. After the target metadata stored in the metadata cluster is changed, the metadata service can generate a corresponding target invalidation message according to the identifier of the target metadata, and transmit the change information of the target metadata to the invalidation message service by sending the target invalidation message to the invalidation message service.
[0105] The target invalidation message includes an identifier of the target metadata.
[0106] S302: In the invalidation message service, the metadata cluster adds a target invalidation message to the invalidation message queue according to the change information of the target metadata.
[0107] In this embodiment, in the invalidation message service, invalidation messages from the metadata service are sorted to obtain an invalidation message queue, which may include one or more invalidation messages. In the invalidation message service, after obtaining the target invalidation message from the metadata service, the target metadata is learned to have changed based on the target invalidation message, and the target invalidation message is added to the invalidation message queue according to the time when the target metadata is changed or the time when the target invalidation message is received.
[0108] In some embodiments, the invalidation message queue includes invalidation messages received by the invalidation message service within a time period. For example, the time period is 1 second, and in this case, the invalidation message queue includes invalidation messages received by the invalidation message service within the last 1 second. The time period can also be called a unit time window, and the invalidation message service registers invalidation messages received within the unit time window, that is, the invalidation message service registers metadata change information within the unit time window to obtain an invalidation message queue.
[0109] S303: In the invalidation message service, the metadata cluster sends a target invalidation message to the computing cluster according to the invalidation message subscription scope corresponding to the computing cluster.
[0110] In this embodiment, in the invalidation message service, the metadata cluster sends the invalidation message in the invalidation message queue to the computing cluster that has subscribed to the invalidation message according to the invalidation message subscription range corresponding to the computing cluster, including sending the target invalidation message to the computing cluster that has subscribed to the target invalidation message.
[0111] In a possible implementation, based on the invalidation message queue containing invalidation messages received by the invalidation message service within a time period, S303 includes: based on the invalidation message subscription range corresponding to the computing cluster, sending a target invalidation message to the computing cluster according to the time period through the invalidation message service.
[0112] In this implementation, the invalidation message service in the metadata cluster determines the computing cluster that has subscribed to the target invalidation message in the invalidation message queue according to the invalidation message range corresponding to the computing cluster, and sends the target invalidation message to the computing cluster according to the time period. Taking the time period of 1 second as an example, the invalidation message queue sends all invalidation messages in the invalidation message queue to the corresponding computing cluster every 1 second. In this way, it is ensured that the computing cluster receives the invalidation message in time, and it is avoided that too many invalidation messages in the invalidation message service bring a large load to the metadata cluster.
[0113] S304: According to the target invalidation message, the computing cluster updates the cached target metadata.
[0114] The implementation principle and technical effects of S304 may refer to the aforementioned embodiments and will not be described in detail.
[0115] In the embodiment of the present application, two main services are extended on the metadata cluster: metadata service and invalidation message service. In the metadata cluster, the metadata service monitors and records the changes of the target metadata in the metadata cluster, generates the corresponding target invalidation message, passes the target invalidation message to the invalidation message service, manages the target invalidation message in the invalidation message service by means of message queue, and sends the target invalidation message to the corresponding computing cluster. Thus, the efficiency of the metadata cluster service is improved by caching metadata in the computing cluster. At the same time, by extending the corresponding service on the metadata cluster, it is effectively ensured that the metadata cached by the computing cluster is consistent with the metadata in the metadata cluster.
[0116] Due to the use of a distributed architecture with separated computing and storage, the computing cluster scale of the metadata cluster service is much larger than that of a traditional distributed database, and the amount of metadata carried and the access load are also much larger than the metadata service of a traditional database. As the database scale increases, sending invalidation messages to all computing nodes will bring a large load to the network of the metadata cluster, which is easy to reduce the service efficiency of the metadata cluster. Therefore, in some embodiments, the computing cluster includes a management node and multiple computing nodes, and an invalidation message forwarding service is deployed on the management node. The management node in the computing cluster receives the target invalidation message from the metadata node and forwards it to the computing node in the computing cluster, so that, on the one hand, the invalidation message is used to keep the consistency between the local cache metadata of the computing cluster and the metadata on the metadata cluster; on the other hand, the invalidation message subscription, invalidation message forwarding and other methods are used to reduce the load of the metadata cluster. In this way, even if the scale of the metadata cluster increases, the metadata cluster can efficiently provide metadata services for the computing cluster and ensure the service efficiency of the entire database system.
[0117] In some embodiments, the invalidation message subscription scope corresponding to the computing cluster is the metadata cache scope of the computer cluster, wherein the metadata cache scope of the computing cluster refers to the scope of metadata cached by the computing cluster, and specifically may include an identifier of the metadata cached by the computing cluster.
[0118] Based on the invalidation message subscription range corresponding to the computing cluster being the metadata cache range of the computing cluster, optionally, on the computing cluster side, the invalidation message subscription range corresponding to the computing cluster is determined according to the metadata cache range of the computing cluster, and an invalidation message subscription request is sent to the metadata cluster. The invalidation message subscription request sent by the computing cluster includes the invalidation message subscription range corresponding to the computing cluster.
[0119] In this optional method, the computing cluster determines that its corresponding invalidation message subscription range is its own metadata cache range, and notifies the metadata cluster of its corresponding invalidation message subscription range by sending an invalidation message subscription request to the metadata cluster. After receiving the invalidation message subscription request, the metadata cluster obtains the invalidation message subscription range corresponding to the computing cluster from the invalidation message subscription request and saves it.
[0120] Based on the invalidation message subscription scope corresponding to the computing cluster being the metadata cache scope of the computer cluster, optionally, on the metadata cluster side, according to the invalidation message subscription scope corresponding to the computing cluster, a target invalidation message is sent to the computing cluster, including: the metadata cluster determines, according to the invalidation message subscription scope corresponding to the computing cluster, a target computing cluster that caches the target metadata in the computing cluster; the metadata cluster sends the target invalidation message to the target computing cluster.
[0121] In this optional method, the invalidation message subscription scope corresponding to the computing cluster may include the identifier of the metadata cached by the computing cluster, and the target invalidation message may include the identifier of the target metadata. Therefore, the target scope including the identifier of the target metadata can be determined in the invalidation message subscription scope corresponding to one or more computing clusters, and the target computing cluster is determined to be the computing cluster corresponding to the target scope. Described from another angle, for each computing cluster, it can be determined whether the invalidation message subscription scope corresponding to the computing cluster includes the identifier of the target metadata. If so, the computing cluster is determined to be a target computing cluster that has cached the target metadata. Otherwise, it is determined that the computing cluster does not cache the target metadata. In this way, one or more target computing clusters are determined, and the target invalidation message is sent to the target computing cluster.
[0122] Wherein, in the case where an invalidation message service is deployed on the metadata cluster, the invalidation message service may perform the above operation of determining the target computing cluster.
[0123] In some embodiments, in addition to the method provided in the above embodiments where the metadata cluster sends a target invalidation message to the computing cluster according to a time period, the computing cluster can also actively request a target invalidation message from the metadata cluster: in response to the invalidation message acquisition request from the target computing cluster, the metadata cluster sends a target invalidation message to the target computing cluster according to the invalidation message subscription range corresponding to the target computing cluster. The invalidation message acquisition request is used to request to obtain the target invalidation message.
[0124] Optionally, the computing cluster may periodically request target invalidation messages from the computing cluster.
[0125] Optionally, when receiving a request from a terminal to access metadata and determining that the metadata is metadata cached by itself, the computing cluster may request an invalidation message of the metadata to be accessed from the metadata cluster, thereby ensuring the accuracy of the metadata when the terminal accesses the metadata.
[0126] refer to Figure 4 , Figure 4 FIG. 1 is a flow chart of a data processing method provided by another embodiment of the present application. Figure 4 As shown, the data processing method provided in this embodiment includes:
[0127] S401: The computing cluster determines, in response to a metadata access request received from a terminal, whether metadata to be accessed is metadata cached by the computing cluster.
[0128] In this embodiment, the computing cluster can obtain the identifier of the metadata to be accessed from the metadata access request of the terminal, and based on the identifier of the metadata to be accessed, search whether the metadata to be accessed exists in the metadata cached by itself. If it exists, it is determined that the metadata to be accessed is the metadata cached by the computing cluster, and S402 is executed; otherwise, it is determined that the metadata to be accessed is not the metadata cached by the computing cluster, and S403 is executed.
[0129] Optionally, the request type of the metadata access request may be a Structured Query Language (SQL) request.
[0130] S402: If the metadata to be accessed is metadata cached by the computing cluster, the computing cluster reads the metadata to be accessed from the cached metadata.
[0131] In this embodiment, when the metadata to be accessed is metadata cached by the computing cluster, the metadata to be accessed may be directly read from the metadata cached by the computing cluster.
[0132] Optionally, if the computing cluster receives an invalidation message of the metadata to be accessed before reading the metadata to be accessed, the computing cluster first updates the metadata to be accessed in the cached metadata and then reads the metadata to be accessed to ensure the accuracy of the metadata to be accessed.
[0133] Optionally, before reading the metadata to be accessed, the computing cluster may request an invalidation message of the metadata to be accessed from the metadata cluster. If an invalidation message is received from the metadata cluster, the computing cluster first updates the metadata to be accessed in the cached metadata, and then reads the metadata to be accessed. If an invalidation message is not received from the metadata within a preset time, the metadata to be accessed is read from the metadata cached by the computing cluster. Thus, the accuracy of the metadata to be accessed is ensured.
[0134] S403: If the metadata to be accessed is not metadata cached by the computing cluster, the computing cluster requests the metadata cluster to obtain the metadata to be accessed.
[0135] In this embodiment, when the metadata to be accessed is not the metadata cached by the computing cluster, it is necessary to request the metadata to be accessed from the metadata cluster.
[0136] In the embodiment of the present application, under the premise that the computing cluster caches a part of the metadata, when the computing cluster receives a metadata access request, it adopts different reading measures by distinguishing whether the metadata to be accessed is the metadata cached by itself. It can be seen that by caching metadata in the computing cluster, the metadata reading efficiency is effectively improved, and the operating efficiency of the distributed data volume is improved.
[0137] refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a distributed database system provided by an embodiment of the present application, in which computing and storage are separated. Figure 5 As shown, the distributed database system includes: a metadata cluster 501 and a computing cluster 502. The computing cluster 502 includes multiple computing nodes ( Figure 5 In the example of two computing nodes, the computing node includes a metadata cache, and the metadata cache includes multiple metadata.
[0138] In this embodiment, in response to the change of the target metadata in the metadata cluster 501, a target invalidation message is generated, and the metadata cluster 501 sends the target invalidation message to the computing cluster 502, so that the computing cluster 502 can update the target metadata in the cache in time. Thus, while improving the metadata service efficiency by caching metadata in the computing cluster, the consistency of the metadata cached in the computing cluster and the metadata in the metadata cluster is ensured. The specific process can refer to the above embodiment.
[0139] In some embodiments, a metadata service is deployed on the metadata cluster 501, and the metadata service is used to manage changes in metadata in the metadata cluster 501. Specifically, the metadata service can change the target metadata in response to a metadata change request from the computing cluster 502, and generate a target invalidation message when the target metadata changes.
[0140] In some embodiments, an invalidation message service for managing invalidation messages of metadata is also deployed on the metadata cluster 501. The metadata service can transmit the change information of the target metadata to the invalidation message service, and the invalidation message service adds the target invalidation message to the invalidation message queue based on the change information of the metadata, and then sends the target invalidation message to the computing cluster 502 according to the invalidation message subscription range corresponding to the computing cluster 502.
[0141] In some embodiments, the computing cluster 502 includes a management node, and an invalidation message forwarding service is deployed on the management node. The metadata cluster 501 can send a target invalidation message to the management node in the computing cluster 502, and the management node forwards the target invalidation message to each computing node in the computing cluster 502 based on the message forwarding service, thereby reducing the burden of the metadata cluster 501.
[0142] It is worth noting that the distributed database system provided in the above embodiment can be used to execute each step in the data processing method provided in any of the above embodiments. The specific implementation method and technical effect are similar and will not be repeated here.
[0143] The following are device embodiments of the present application, which can be used to execute the corresponding method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the corresponding method embodiments of the present application.
[0144] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application, wherein the data processing device is applied to a distributed database system with separated computing and storage, the distributed database system includes a metadata cluster and a computing cluster, and the computing cluster caches metadata from the metadata cluster. Figure 6 As shown, on the metadata cluster side, the data processing device 600 provided in this embodiment includes:
[0145] A generating module 601 is used to generate a target invalidation message in response to a change in target metadata in the metadata cluster, where the target invalidation message indicates that the target metadata cached by the computing cluster is invalid;
[0146] The sending module 602 is used to send a target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster. The invalidation message subscription range is the range in which the computing cluster monitors metadata changes in the metadata cluster.
[0147] In a feasible implementation, a metadata service for managing metadata changes is deployed on the metadata cluster, and the generation module 601 is specifically used to generate a target invalidation message when the metadata service changes the target metadata in response to the metadata change request of the computing cluster.
[0148] In a feasible implementation, an invalidation message service for managing invalidation messages of metadata is also deployed on the metadata cluster, and the generation module 601 is specifically used to: when the metadata service changes the target metadata in response to the metadata change request of the computing cluster, the change information of the target metadata is transmitted to the invalidation message service through the metadata service; in the invalidation message service, according to the change information of the target metadata, the target invalidation message is added to the invalidation message queue.
[0149] In a feasible implementation, the invalidation message queue contains invalidation messages received by the invalidation message service within a time period, and the sending module 602 is specifically used to send target invalidation messages to the computing cluster according to the time period through the invalidation message service based on the invalidation message subscription range.
[0150] In a feasible implementation, the sending module 602 is specifically used to: determine a target computing cluster that caches the target metadata in the computing cluster according to the invalidation message subscription range; and send a target invalidation message to the target computing cluster.
[0151] In a feasible implementation, the target invalidation message includes an identifier of the target metadata, the invalidation message scope includes an identifier of the metadata cached by the computing cluster, and the sending module 602 is specifically used to: determine the target scope including the identifier of the target metadata in the invalidation message subscription scope; determine the target computing cluster as the computing cluster corresponding to the target scope.
[0152] In a feasible implementation, the sending module 602 is specifically configured to: in response to an invalidation message acquisition request from a target computing cluster, send a target invalidation message to the target computing cluster according to an invalidation message subscription range corresponding to the target computing cluster.
[0153] Figure 7 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application, wherein the data processing device is applied to a distributed database system with separated computing and storage, the distributed database system includes a metadata cluster and a computing cluster, and the computing cluster caches metadata from the metadata cluster. Figure 7 As shown, on the computing cluster side, the data processing device 700 provided in this embodiment includes:
[0154] Receiving module 701, used to receive a target invalidation message from a metadata cluster;
[0155] The updating module 702 is used to update the target metadata cached by the computing cluster according to the target invalidation message; wherein the target invalidation message indicates that the target metadata cached by the computing cluster is invalid.
[0156] In a feasible implementation, the computing cluster includes a management node and multiple computing nodes, and the receiving module 701 is specifically used to: receive a target invalidation message through the management node; and forward the target invalidation message to the multiple computing nodes through the management node.
[0157] In a feasible implementation, the data processing device 700 also includes an access unit 703, which is used to: in response to a metadata access request received from a terminal, determine whether the metadata to be accessed is metadata cached by a computing cluster; if the metadata to be accessed is metadata cached by the computing cluster, read the metadata to be accessed from the cache of the computing cluster; if the metadata to be accessed is not metadata cached by the computing cluster, request the metadata cluster to obtain the metadata to be accessed.
[0158] In a feasible implementation, the data processing device 700 also includes a subscription unit 704, which is used to: determine the invalidation message subscription range corresponding to the computing cluster according to the metadata cache range of the computing cluster, and send an invalidation message subscription request to the metadata cluster; wherein the invalidation message subscription request includes the invalidation message subscription range.
[0159] The above-mentioned device embodiments provided in the present application are merely illustrative, and the module division therein is merely a logical function division, and there may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system. The coupling between the modules may be achieved through some interfaces, which are usually electrical communication interfaces, but it is not excluded that they may be mechanical interfaces or other forms of interfaces. Therefore, the modules described as separate components may or may not be physically separated, and may be located in one place or distributed to different locations of the same or different devices.
[0160] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 may include: at least one processor 801 and a memory 802 . Figure 8 An electronic device is shown using a processor as an example.
[0161] The memory 802 is used to store the program of the processor 801. Specifically, the program may include program code, and the program code includes computer operation instructions.
[0162] The memory 802 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0163] The processor 801 is configured to execute the computer program stored in the memory 802 to implement each step in the data processing method in the above method embodiments.
[0164] The processor 801 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0165] Optionally, the memory 802 can be independent or integrated with the processor 801. When the memory 802 is a device independent of the processor 801, the electronic device 800 may further include: a bus 803 for connecting the processor 801 and the memory 802. The bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0166] Optionally, in a specific implementation, if the memory 802 and the processor 801 are integrated on a chip, the memory 802 and the processor 801 can communicate through an internal interface.
[0167] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, a computer program is stored in the computer-readable storage medium. When at least one processor of an electronic device executes the computer program, the electronic device executes the various steps of the data processing method provided in the above-mentioned various embodiments.
[0168] The present application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device implements the various steps of the data processing method provided in the various embodiments described above.
[0169] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0170] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: A distributed database system for separating computing and storage is applied, the distributed database system comprising a metadata cluster and a computing cluster, the computing cluster comprising a plurality of computing nodes, the plurality of computing nodes cache metadata from the metadata cluster, and the computing nodes are used to execute computing tasks; On the metadata cluster side, the data processing method includes: In response to a change in target metadata in the metadata cluster, generating a target invalidation message, the target invalidation message indicating that the target metadata cached by the computing cluster is invalid; According to the invalidation message subscription scope corresponding to the computing cluster, a target computing cluster that caches the target metadata is determined in the computing cluster, and the target invalidation message is sent to multiple computing nodes of the target computing cluster, where the invalidation message subscription scope is the scope in which the computing cluster monitors metadata changes in the metadata cluster, wherein the multiple computing nodes are specifically used to update the cached target metadata according to the target invalidation message.
2. The data processing method according to claim 1, characterized in that: A metadata service for managing metadata changes is deployed on the metadata cluster, and generating a target invalidation message in response to a change in metadata in the metadata cluster includes: The target invalidation message is generated when the metadata service changes the target metadata in response to the metadata change request of the computing cluster.
3. The data processing method according to claim 2, characterized in that: The metadata cluster is also deployed with an invalidation message service for managing invalidation messages of metadata. When the metadata service changes the target metadata in response to the metadata change request of the computing cluster, generating the target invalidation message includes: In a case where the metadata service changes the target metadata in response to the metadata change request of the computing cluster, transmitting the change information of the target metadata to the invalidation message service through the metadata service; In the invalidation message service, the target invalidation message is added to the invalidation message queue according to the change information of the target metadata.
4. The data processing method according to claim 3, characterized in that: The invalidation message queue includes invalidation messages received by the invalidation message service within a time period, and sending the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster includes: Based on the invalidation message subscription range, the target invalidation message is sent to the computing cluster through the invalidation message service according to the time period.
5. The data processing method according to any one of claims 1 to 4, characterized in that: The target invalidation message includes an identifier of the target metadata, the invalidation message range includes an identifier of the metadata cached by the computing cluster, and determining, in the computing cluster according to the invalidation message subscription range, a target computing cluster that caches the target metadata includes: Determining a target scope including an identifier of the target metadata in the invalidation message subscription scope; The target computing cluster is determined to be a computing cluster corresponding to the target range.
6. The data processing method according to any one of claims 1 to 3, characterized in that: The sending the target invalidation message to the computing cluster according to the invalidation message subscription range corresponding to the computing cluster includes: In response to the invalidation message acquisition request from the target computing cluster, the target invalidation message is sent to the target computing cluster according to the invalidation message subscription range corresponding to the target computing cluster.
7. A data processing method, characterized in that: A distributed database system for separating computing and storage is applied, the distributed database system comprising a metadata cluster and a computing cluster, the computing cluster comprising a plurality of computing nodes, the plurality of computing nodes cache metadata from the metadata cluster, and the computing nodes are used to execute computing tasks; The computing cluster is a computing cluster that caches target metadata and is determined according to an invalidation message subscription range, wherein the invalidation message subscription range is a range in which the computing cluster monitors metadata changes in the metadata cluster, wherein the multiple computing nodes are specifically used to update the cached target metadata according to the target invalidation message; For the multiple computing nodes, the data processing method includes: receiving a target invalidation message from the metadata cluster; According to the target invalidation message, updating the target metadata cached by the computing cluster; The target invalidation message indicates that the target metadata cached by multiple computing nodes of the computing cluster is invalid.
8. The data processing method according to claim 7, characterized in that: The computing cluster further includes a management node, and the receiving of the target invalidation message from the metadata cluster includes: Receiving the target failure message through the management node; The target failure message is forwarded to the multiple computing nodes through the management node.
9. The data processing method according to claim 7, characterized in that: Also includes: In response to a received metadata access request from a terminal, determining whether the metadata to be accessed is metadata cached by the computing cluster; If the metadata to be accessed is metadata cached by the computing cluster, reading the metadata to be accessed from the cache of the computing cluster; If the metadata to be accessed is not metadata cached by the computing cluster, a request is made to the metadata cluster to obtain the metadata to be accessed.
10. The data processing method according to any one of claims 7 to 9, characterized in that: Before receiving the target invalidation message from the metadata cluster, the method further includes: Determine, according to the metadata cache range of the computing cluster, the invalidation message subscription range corresponding to the computing cluster, and send an invalidation message subscription request to the metadata cluster; The invalidation message subscription request includes the invalidation message subscription range.
11. A data processing device, characterized in that: A distributed database system for separating computing and storage is applied, the distributed database system comprising a metadata cluster and a computing cluster, the computing cluster comprising a plurality of computing nodes, the plurality of computing nodes cache metadata from the metadata cluster, and the computing nodes are used to execute computing tasks; On the metadata cluster side, the data processing device includes: A generating module, configured to generate a target invalidation message in response to a change in the target metadata in the metadata cluster, wherein the target invalidation message indicates that the target metadata cached by the computing cluster is invalidated; A sending module is used to determine a target computing cluster that caches target metadata in the computing cluster according to the invalidation message subscription range corresponding to the computing cluster, and send the target invalidation message to multiple computing nodes of the target computing cluster. The invalidation message subscription range is the range in which the computing cluster monitors metadata changes in the metadata cluster. The multiple computing nodes are used to update the cached target metadata according to the target invalidation message.
12. A data processing device, characterized in that: A distributed database system for separating computing and storage is applied, the distributed database system comprising a metadata cluster and a computing cluster, the computing cluster comprising a plurality of computing nodes, the plurality of computing nodes cache metadata from the metadata cluster, and the computing nodes are used to execute computing tasks; The computing cluster is a computing cluster that caches target metadata and is determined based on an invalidation message subscription range, wherein the invalidation message subscription range is a range in which the computing cluster monitors metadata changes in the metadata cluster; For the plurality of computing nodes, the data processing device comprises: A receiving module, used for receiving a target invalidation message from the metadata cluster; An updating module, configured to update target metadata cached by multiple computing nodes of the computing cluster according to the target failure message; The target invalidation message indicates that the target metadata cached by the computing cluster is invalid.
13. An electronic device comprising: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the data processing method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the data processing method according to any one of claims 1 to 10.
15. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the data processing method according to any one of claims 1 to 10 is implemented.
