CN117827474A - Data processing method and related equipment - Google Patents

Data processing method and related equipment Download PDF

Info

Publication number
CN117827474A
CN117827474A CN202211195959.6A CN202211195959A CN117827474A CN 117827474 A CN117827474 A CN 117827474A CN 202211195959 A CN202211195959 A CN 202211195959A CN 117827474 A CN117827474 A CN 117827474A
Authority
CN
China
Prior art keywords
database
computing node
resource metadata
shared memory
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211195959.6A
Other languages
Chinese (zh)
Inventor
王伟
史玉玲
任仁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202211195959.6A priority Critical patent/CN117827474A/en
Publication of CN117827474A publication Critical patent/CN117827474A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data processing method which is applied to a database cluster, wherein the database cluster comprises a first computing node and a second computing node, database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, and the database resource metadata is managed by a database process in the first computing node. In this way, when the database process of the first computing node is abnormal, the database resource metadata stored in the shared memory can still be obtained, so that the first computing node can send the database resource metadata stored in the shared memory to the second computing node with no abnormality in the database process after the corresponding database process is abnormal, so that the second computing node can receive the database resource metadata, and therefore, the recovery of the database resource metadata is not required to take a great deal of time, and the processing efficiency of abnormal database tasks is greatly improved.

Description

Data processing method and related equipment
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a data processing method and related devices.
Background
Currently, to alleviate the rapidly growing traffic pressures, database clusters are often employed to implement database functions. A plurality of compute nodes may be included in a database cluster to provide data services through the plurality of compute nodes.
In order to facilitate the search and management of database resources during the application process, database resource metadata describing the database resources is typically generated, and the database resource metadata is split and distributed to different computing nodes for storage and management.
When an abnormality occurs in a certain computing node during the process of executing a database task, the database information in the computing node is usually lost, and the database resource metadata stored in the computing node with the abnormality needs to be recovered according to the related database information on other computing nodes for recovering the related database task. As the number of computing nodes in the database cluster increases, the data resource increases continuously, and a great amount of time is generally consumed in the data recovery process, so that the time required for recovering the abnormal database task is longer, and the processing efficiency is lower.
Disclosure of Invention
The application provides a data processing method for solving the problem that the processing efficiency of abnormal database tasks is low due to long time consumption of a process of recovering database resource metadata stored in an abnormal computing node. The application also provides corresponding apparatus, devices, computer readable storage media, computer program products, etc.
The first aspect of the present application provides a data processing method, where the data processing method is applied to a database cluster, where the database cluster includes a first computing node and a second computing node, and database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, where the database resource metadata is managed by a database process in the first computing node; the method comprises the following steps: after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node; the second computing node receives the database resource metadata, wherein no anomaly occurs in the database process of the second computing node.
In the first aspect, the database resource metadata corresponding to the first computing node is stored in the shared memory of the first computing node, so that when the database process in the first computing node is abnormal, the database resource metadata stored in the shared memory is not lost along with the abnormality of the database process, the first computing node can still acquire the database resource metadata from the shared memory, and therefore, the first computing node can send the database resource metadata to the second computing node, in which the abnormality of the database process does not occur, so that the second computing node can efficiently and quickly acquire the database resource metadata of the first computing node, and the database resource metadata can be recovered according to the database resource information in the computing node, in which the abnormality of the database process does not occur, without spending long time, thereby facilitating the subsequent quick recovery of the abnormal database task in the first computing node, and greatly improving the processing efficiency of the abnormal database task.
In a possible implementation manner of the first aspect, the database resource metadata includes role information and a lock mode corresponding to the related database resource.
In a possible implementation manner of the first aspect, the method further includes: the first computing node writes the database resource metadata into the shared memory through a database process.
In a possible implementation manner of the first aspect, the method further includes: when the first computing node creates a database process, mapping a memory corresponding to the database process to a shared memory.
In this possible implementation manner, the first computing node may register the shared memory when creating the database process, and map the memory corresponding to the database process to the shared memory. Alternatively, the first computing node may register the shared memory prior to creating the database process (e.g., at the start of the operating system of the first computing node); and then, when the first computing node creates the database process, mapping the memory corresponding to the database process of the first computing node to the shared memory.
In a possible implementation manner of the first aspect, the first computing node runs a daemon, and both the database process and the daemon have access to the shared memory; the steps are as follows: after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node, and the method comprises the following steps: after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node through the daemon.
In this possible implementation, the daemon process is a different process than the database process. When the database process is abnormal, the daemon process can still access the shared memory, so that the database resource metadata is obtained from the shared memory and is sent to the second computing node, and the second computing node which is not abnormal in the database process is not required to spend a great deal of time for recovering the database resource metadata, so that the processing efficiency of abnormal database tasks is greatly improved.
In a possible implementation manner of the first aspect, during the running of the database process by the first computing node, the daemon is in a running state.
In this possible implementation, as long as at least one process in the processes associated with the shared memory is still in a surviving state, the shared memory will exist, and the information stored in the shared memory will be retained. Therefore, after the database process is abnormal, the daemon is still in an operation state because the daemon is not abnormal, so that the shared memory still exists, the first database resource metadata stored in the shared memory is not lost, and the database resource metadata can be efficiently and quickly obtained through the daemon so as to be conveniently sent to the second computing node in time.
In a possible implementation manner of the first aspect, after the second computing node receives the database resource metadata, the method further includes: and the second computing node determines the distribution mode of the database resource metadata in the computing nodes with no abnormality of the database process in the database cluster.
In this possible implementation manner, after obtaining the database resource metadata, the second computing node may redetermine an allocation manner of the database resource metadata in the computing nodes where no abnormality occurs in the database process in the database cluster, so that the database resource metadata is allocated to the computing nodes where no abnormality occurs in the database process for storage, and may recover, according to the database resource metadata, the database task where the abnormality occurs in the first computing node.
In a possible implementation manner of the first aspect, the steps are as follows: after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node, and the method comprises the following steps: after the database process of the first computing node is abnormal, the first computing node sends notification information to the second computing node, wherein the notification information is used for indicating the database process of the first computing node to be abnormal; after receiving the notification information, the second computing node sends request information to the first computing node, wherein the request information is used for requesting the metadata of the database resources; after receiving the request information, the first computing node sends the database resource metadata stored in the shared memory to the second computing node.
In this possible implementation manner, the first computing node sends the notification information so that the computing node where no abnormality occurs to each database process knows that the database process in the first computing node is abnormal. And then, the second computing node sends the request information to the first computing node, so that the first computing node can determine the computing node with no abnormality in the database process in the database cluster, and can send the first database resource metadata to the computing node with no abnormality in the database process, so that the computing node with no abnormality in the database process can efficiently and quickly obtain the database resource metadata.
In a possible implementation manner of the first aspect, the steps are as follows: after the database process of the first computing node is abnormal, the first computing node sends notification information to the second computing node, and the notification information comprises: after an abnormality occurs in the database process of the first computing node, the first computing node broadcasts notification information.
In this possible implementation manner, the first computing node may broadcast the notification information, so that the second computing nodes in the database cluster, where no abnormality occurs in the database process, may receive the notification information efficiently and quickly.
In one possible implementation manner of the first aspect, the database resource metadata is stored to the first computing node based on an allocation algorithm; after the second computing node receives the notification information, the steps are as follows: the second computing node determining a distribution mode of the database resource metadata in the computing nodes with no abnormality of the database process in the database cluster, comprising: updating an allocation algorithm by the second computing node; and the second computing node determines the distribution mode of the database resource metadata in the computing nodes with no abnormality of the database process in the database cluster according to the updated distribution algorithm.
The second aspect of the present application provides a data processing method, where the data processing method is applied to a first computing node, where the first computing node belongs to a database cluster, the database cluster further includes a second computing node, database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, and the database resource metadata is managed by a database process in the first computing node; the method comprises the following steps: and after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node, wherein the database process of the second computing node is not abnormal.
In a possible implementation manner of the second aspect, the database resource metadata includes role information and a lock mode corresponding to the relevant database resource.
In a possible implementation manner of the second aspect, the method further includes: and writing the metadata of the database resources into the shared memory through a database process.
In a possible implementation manner of the second aspect, the method further includes: when the database process is created, mapping the memory corresponding to the database process to the shared memory.
In a possible implementation manner of the second aspect, the first computing node runs a daemon, and both the database process and the daemon have access to the shared memory; the steps are as follows: after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node, wherein the method comprises the following steps: and after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node through the daemon.
In a possible implementation manner of the second aspect, during the running of the database process by the first computing node, the daemon is in a running state.
In a possible implementation manner of the second aspect, the steps are as follows: after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node, wherein the method comprises the following steps: after the database process of the first computing node is abnormal, sending notification information to the second computing node, wherein the notification information is used for indicating the database process of the first computing node to be abnormal; and after receiving the request information from the second computing node, sending the database resource metadata stored in the shared memory to the second computing node, wherein the request information is generated by the second computing node according to the notification information, and the request information is used for requesting the database resource metadata.
In a possible implementation manner of the second aspect, the steps are as follows: after the database process of the first computing node is abnormal, sending notification information to the second computing node, wherein the notification information comprises the following steps: after an anomaly occurs in the database process of the first computing node, notification information is broadcast.
The third aspect of the present application provides a data processing method, where the data processing method is applied to a second computing node, where the second computing node belongs to a database cluster, where the database cluster further includes a first computing node, and database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, where the database resource metadata is managed by a database process in the first computing node; the method comprises the following steps: and receiving the database resource metadata sent by the first computing node, wherein the database process of the first computing node is abnormal, and the database process of the second computing node is not abnormal.
In a possible implementation manner of the third aspect, after receiving the database resource metadata, the method further includes: and determining the distribution mode of the database resource metadata in the computing nodes in which the database processes in the database cluster are not abnormal.
In one possible implementation manner of the third aspect, the database resource metadata is stored to the first computing node based on an allocation algorithm; the steps are as follows: determining an allocation mode of the database resource metadata in a computing node in which no abnormality occurs in a database process in a database cluster, including: receiving notification information sent by a first computing node, wherein the notification information is used for indicating that the database process of the first computing node is abnormal; updating an allocation algorithm according to the notification information; and determining the distribution mode of the database resource metadata in the computing nodes with no abnormality of the database process in the database cluster according to the updated distribution algorithm.
A fourth aspect of the present application provides a data processing apparatus for use in a first computing node, the apparatus having functionality to implement a method of the second aspect or any one of the possible implementations of the second aspect. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above, such as: a sending module and a processing module.
A fifth aspect of the present application provides a first computing node comprising at least one processor, memory and computer-executable instructions stored in the memory and executable on the processor, the processor performing a method as described above in relation to any one of the possible implementations of the second aspect or the second aspect when the computer-executable instructions are executed by the processor.
A sixth aspect of the present application provides a computer readable storage medium storing one or more computer executable instructions which, when executed by a processor, perform a method as in the second aspect or any one of the possible implementations of the second aspect.
A seventh aspect of the present application provides a computer program product storing one or more computer-executable instructions which, when executed by a processor, perform a method as described above in the second aspect or any one of the possible implementations of the second aspect.
An eighth aspect of the present application provides a chip system comprising a processor for supporting a first computing node to implement the functionality referred to in the second aspect or any one of the possible implementations of the second aspect. In one possible design, the chip system may further include a memory to hold program instructions and data. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
A ninth aspect of the present application provides a data processing apparatus, applicable to a second computing node, having the functionality to implement the method of the third aspect or any one of the possible implementations of the third aspect. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above, such as: the device comprises a receiving module, a processing module and a sending module.
A tenth aspect of the present application provides a second computing node comprising at least one processor, a memory and computer-executable instructions stored in the memory and executable on the processor, the processor performing the method as described above in the third aspect or any one of the possible implementations of the third aspect when the computer-executable instructions are executed by the processor.
An eleventh aspect of the present application provides a computer readable storage medium storing one or more computer executable instructions which, when executed by a processor, perform a method as described above in the third aspect or any one of the possible implementations of the third aspect.
A twelfth aspect of the present application provides a computer program product storing one or more computer-executable instructions which, when executed by a processor, perform a method as described above or any one of the possible implementations of the third aspect.
A thirteenth aspect of the present application provides a chip system comprising a processor for supporting a second computing node to implement the functionality referred to in the third aspect or any one of the possible implementations of the third aspect. In one possible design, the chip system may further include a memory to hold program instructions and data. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
A fourteenth aspect of the present application provides a database cluster comprising a first computing node performing the method as in the second aspect or any one of the possible implementations of the second aspect, and a second computing node performing the method as in the third aspect or any one of the possible implementations of the third aspect.
A fifteenth aspect of the present application provides a database system comprising a database cluster as in the fourteenth aspect above and a storage device connected to a first computing node and a second computing node in the database cluster, the storage device being for storing database resources.
The technical effects of the second aspect to the fifteenth aspect or any one of the possible implementation manners of the second aspect may be referred to the technical effects of the first aspect or the relevant possible implementation manners of the first aspect, which are not described herein.
Drawings
FIG. 1 is a schematic diagram of an exemplary architecture of a database system provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of an exemplary architecture of a database cluster provided in an embodiment of the present application;
FIG. 3 is an exemplary schematic diagram of a data processing method provided by an embodiment of the present application;
FIG. 4 is an exemplary diagram of an interaction mechanism between a master node, an owner, and a requestor provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of an exemplary architecture of a database cluster provided in an embodiment of the present application;
FIG. 6 is an exemplary schematic diagram of a data processing method provided by an embodiment of the present application;
FIG. 7a is an exemplary diagram of database resource metadata in a database cluster provided in an embodiment of the present application;
FIG. 7b is an exemplary diagram of reallocating database resource metadata in a database cluster as provided by embodiments of the present application;
FIG. 8 is an exemplary schematic diagram of an information interaction process between a first computing node and a second computing node provided by an embodiment of the present application;
FIG. 9 is a schematic diagram of an embodiment of a data processing apparatus according to an embodiment of the present application;
FIG. 10 is a schematic view of another embodiment of a data processing apparatus provided in an embodiment of the present application;
FIG. 11 is a schematic diagram of a first computing node according to an embodiment of the present disclosure;
FIG. 12 is a schematic diagram of a second computing node according to an embodiment of the present disclosure;
FIG. 13 is a schematic diagram of a database cluster according to an embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of a database system according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings. As one of ordinary skill in the art can appreciate, with the development of technology and the appearance of new scenes, the technical solutions provided in the embodiments of the present application are applicable to similar technical problems.
In the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" or similar expressions thereof, means any combination of these items, including any combination of single or plural items. The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely illustrative of the manner in which the embodiments of the application described herein have been described for objects of the same nature. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
In a practical application scenario, in order to facilitate searching and managing database resources, database resource metadata describing the database resources is generally generated. It can be seen that database resource metadata plays an important role in the database resource management process.
In a database cluster including a plurality of computing nodes, the metadata of the database resources of the entire database resources are often divided, and each part of the metadata of the database resources obtained after the division is stored in each computing node of the database cluster in a scattered manner, so that the respective stored metadata of the database resources are managed through each computing node.
When an abnormality occurs in a certain computing node during the process of executing the database process, database information in the computing node with the abnormality is often lost, and at this time, database resource metadata stored in the computing node with the abnormality needs to be recovered according to related database information on other computing nodes for recovering related database tasks.
In particular, at present, it is generally required to scan all the computing nodes without exception to obtain database information in all the computing nodes without exception, so as to recover the metadata of the database resources managed in the computing node with exception according to the related information of the database resources such as the control mode, version, history modification record of the data page in the scanned database information, thereby recovering the related database tasks.
With the increasing number of computing nodes in the database cluster, the data stored in the memory space of the computing nodes, such as the memory, is larger, the time spent in the scanning process and the data recovery process is longer, the recovery time of the abnormal database task is longer, the processing efficiency of the abnormal database task is lower, and the user experience is poor.
In view of the above problems, the present application provides a data processing method, so that a database cluster does not need to spend a great deal of time to recover metadata of database resources in a computing node where an exception occurs, thereby greatly improving the processing efficiency of an abnormal database task.
The following describes a data processing method according to an embodiment of the present application.
In the embodiment of the application, the data processing method can be applied to a database system.
The database system may include a database cluster and a storage device. A plurality of computing nodes may be included in a database cluster, each of which may be coupled to a storage device.
The specific architecture of the database cluster may vary and is not limited in this regard. And the particular type of any one computing node in the database cluster is not limited herein.
Illustratively, the computing node may be a terminal device, one or more servers, a Virtual Machine (VM), or a container.
The functions of the plurality of computing nodes in the database cluster may be the same or different, and in the embodiment of the present application, the architecture of the database cluster is not specifically limited.
For example, in one example, a database cluster may comprise a multi-active architecture, e.g., comprising a shared storage multi-active cluster, where multiple compute nodes in the database cluster may each be running database instances to provide data services, where the data is completely consistent, and where the user plane can obtain the same data regardless of which compute node is accessed from. In another example, a database cluster may include a master-slave architecture, and a master computing node and a slave computing node may be included in a plurality of computing nodes.
One or more storage nodes may be included in a storage device in a database system to store database resources through the one or more storage nodes. Further, in some examples, one or more controllers may also be included in the storage device for managing one or more storage nodes. In the embodiment of the present application, the type, architecture and internal storage mechanism of the storage device are not limited in particular.
The database resources include data resources stored in a database. The specific form of the database resource may be varied and is not limited herein. Illustratively, the database resource may include a plurality of data pages (pages).
An exemplary architecture diagram for a database system is shown in fig. 1.
The database system comprises a database cluster and a storage device, wherein the database cluster comprises a plurality of computing nodes, the storage device is used for storing database resources, and the plurality of computing nodes can access the storage device to perform operations such as reading and/or writing on the database resources on the storage device.
A description of a plurality of computing nodes in a database cluster in an embodiment of the present application is provided below.
In the embodiment of the present application, the plurality of computing nodes of the database cluster may include a first computing node and a second computing node.
The first computing node is a computing node with abnormal database processes in the database cluster, and the second computing node is a computing node with no abnormal database processes in the database cluster.
It will be appreciated that the first computing node and the second computing node may change dynamically as the actual situation changes, and that the first computing node and the second computing node are not pre-fixed in the database cluster. For a certain computing node in the database cluster, in a current scenario, if the database process of the computing node is abnormal, the computing node may be a first computing node, and in subsequent other scenarios, if the database process of the computing node may be normally executed, the computing node may be a second computing node in other scenarios.
An exemplary architecture diagram of a database cluster in an embodiment of the present application is shown in fig. 2.
Wherein the plurality of computing nodes of the database cluster may include a first computing node and a second computing node. Database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, and the database resource metadata is managed by a database process in the first computing node.
The shared memory can be used for realizing inter-process communication (interprocess communication, IPC) so that a plurality of processes can access the same memory space, thereby realizing data sharing and interaction, wherein the memory space which can be accessed by the plurality of processes is the shared memory. Generally, shared memory is a designated storage space in physical memory.
In this embodiment of the present application, a memory corresponding to a database process of the first computing node may be mapped to the shared memory, so as to manage database metadata stored in the shared memory. The mapping of the memory corresponding to the database process of the first computing node to the shared memory means that the database process of the first computing node maps the virtual address corresponding to the database process of the first computing node to the physical address corresponding to the shared memory.
Typically, the life cycle of a shared memory is longer than that of a single process.
For example, in one scenario, a shared memory exists as long as at least one of the processes associated with the shared memory remains alive, i.e., the shared memory's lifecycle covers the lifecycle of each associated process.
In yet another scenario, the lifecycle of the shared memory may follow the operating system kernel of the compute node. At this time, even if all processes capable of accessing the shared memory have finished running, the shared memory still exists along with the running of the operating system kernel, and if the operating system kernel does not modify the information in the shared memory, the operation result of the processes on the shared memory can be kept along with the running of the operating system kernel.
There may be a number of situations in which the number of first and second computing nodes is varied. The number of the first computing nodes can be one or more, and the number of the second computing nodes can be one or more.
The first computing node and the second computing node may each have a database program installed therein, and the database program may be run by a database process to perform database tasks. The database process may be an executing entity of a database program.
The database program can be installed in the first computing node and the second computing node after being developed by a third party, or can be a program self-contained in the first computing node and the second computing node. The specific source of the database program is not limited in the embodiments of the present application.
As shown in fig. 3, based on the database cluster, a data processing method in the embodiment of the present application includes steps 301 to 305.
In step 301, when a first computing node creates a database process, a memory corresponding to the database process is mapped to a shared memory.
In this embodiment of the present application, the first computing node may register the shared memory when creating the database process, and map the memory corresponding to the database process to the shared memory. Alternatively, the first computing node may register the shared memory prior to creating the database process (e.g., at the start of the operating system of the first computing node); and then, when the first computing node creates the database process, mapping the memory corresponding to the database process of the first computing node to the shared memory.
In step 302, when no abnormality occurs in the database process of the first computing node, the first computing node writes the metadata of the database resource into the shared memory through the database process.
Wherein the database resource metadata is metadata for describing the database resource. For example, the database resource metadata may include a distributed resource catalog (distributed resource catalogue, DRC). The distributed information of the database resources such as the data pages globally shared in the database cluster can be managed through DRC.
Illustratively, the database resource metadata includes lock pattern and role information for the respective database resource, and may also include one or more of identification, type, etc. information for the respective database resource.
Exemplary description of information that may be contained in database resource metadata is provided below.
Illustratively, the identification of the database resource may uniquely identify the database resource. For example, if the database resource includes a data page, the identification of the database resource may include information such as an address of the data page in the memory space or a page number of the data page. The type of database resource may indicate the file type, storage manner, etc. of the database resource.
The role information corresponding to the database resource may describe information such as related operations of the corresponding computing node on the database resource.
In particular, in one exemplary application scenario of a database cluster, the roles of compute nodes may include three for a database resource, the three roles including master node (master), owner (owner), and requestor (requester).
The master node includes database resource metadata of the managed database resources, so that the master node can manage information such as the state and the current owner of the database resources such as related data pages by maintaining the database resource metadata.
The owner can operate on database resources such as data pages, for example, read and/or write operations can be performed on related data pages.
While the requestor desires to be able to operate on database resources such as data pages. The requestor may first query the host node for the owner of the specified data page, then obtain the data page from the owner, and apply for a new owner of the data page to the host node.
For a certain database resource, if the database resource metadata of the database resource is stored in a certain computing node, the computing node may be considered as a master node corresponding to the database resource.
An exemplary interaction mechanism between a master node, an owner and a requestor may refer to fig. 4.
Taking access to the data page a as an example, in an exemplary interaction mechanism shown in fig. 4, a requester calculates a master node corresponding to the data page a according to a page ID of the data page a and a uniform hash algorithm (consistent hashing) and the like, so as to send information A1 to the master node to query the owner of the data page a.
After receiving the information A1, the master node queries the database resource metadata in the master node, determines the owner of the data page a, and then sends the information A2 to the owner of the data page a to notify the owner of the data page a to send the data page a to the requester. The owner of the data page a, after receiving the information A2 sent by the master node, sends information A3 to the requester, where the information A3 includes information about the data page a. After receiving the information about data page a, the requester sends information A4 to the master node to inform the master node that the requester is the new owner of data page a. The master node may update the metadata associated with data page a after receiving information A4, i.e. update the database resource metadata in the master node.
The metadata of the database resource of the computing node may include role information corresponding to the database resource, for example, may include information of a master node corresponding to the database resource, and may also include information of an owner and/or a requester corresponding to the database resource.
In addition, during the application process, the application of the database resource may be implemented through a plurality of lock modes.
For example, the lock pattern corresponding to the database resource may include one or more of the following three types: an invalid mode, a sharing mode, and an exclusive mode.
Each lock mode is mainly used for determining the authority of database resources such as corresponding data pages. Illustratively, for a certain page of data, the meaning of each lock mode is as follows:
1) An invalid mode indicating that the current computing node cannot operate the data page (e.g., cannot perform a read operation and a write operation on the data page), and that rights (e.g., read rights and/or write rights) need to be applied from the master node;
2) A sharing mode, which indicates that the current computing node has the read authority of the data page and can read the data page;
3) The exclusive mode indicates that the current computing node owns the write permission of the data page, so that the data page can be modified.
In some examples, the database resource metadata corresponding to the computing node may include information of a lock mode corresponding to the corresponding database resource to facilitate management of the corresponding database resource.
In this embodiment of the present application, for convenience of description, database resource metadata corresponding to a first computing node is referred to as first database resource metadata.
In practical application, the first computing node writes the metadata of the first database resource into the shared memory through the database process. In this way, the first database resource metadata is managed by the database process in the first computing node such that the database process in the first computing node implements the database service based on the first database resource metadata.
For example, the first computing node writing the first database resource metadata to the shared memory through the database process may be the first computing node writing the first database resource metadata to the shared memory for the first time.
Alternatively, the first computing node writes the first database resource metadata into the shared memory through the database process, or may update the first database resource metadata in the shared memory when the first database resource metadata changes during execution of the database process of the first computing node.
For example, after the first database resource metadata corresponding to a certain data page is written into the shared memory for the first time, if the owner and the requester of the data page change during the execution of the database process, the database process may update the first database resource metadata corresponding to the data page according to the changed information.
Step 303, after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node.
Wherein, the database process abnormality can be the database process abnormality such as crash, no response, flash back, etc. After the database process is abnormal, the database process cannot normally run, and the database process can be stopped due to the occurrence of the abnormality or can be unresponsive due to the occurrence of the abnormality. At this time, other processes may still be running in the first computing node. For example, the operating system in the first computing node is still capable of running. In addition, the first computing node may further be running a designated database management software, which may monitor the execution of the database process in the first computing node.
In this embodiment of the present application, metadata of a first database resource corresponding to a first computing node is stored in a corresponding shared memory in the first computing node.
Typically, the life cycle of a shared memory is longer than that of a single process.
For example, in one scenario, a shared memory exists as long as at least one of the processes associated with the shared memory remains alive. In yet another scenario, the lifecycle of the shared memory may follow the operating system kernel of the compute node. At this time, even if all processes capable of accessing the shared memory have finished running, the shared memory still exists along with the running of the operating system kernel, and if the operating system kernel does not modify the information in the shared memory, the operation result of the processes on the shared memory can be kept along with the running of the operating system kernel.
Therefore, after the database process of the first computing node is abnormal, the first database resource metadata stored in the shared memory still exists, and therefore, the first computing node can send the first database resource metadata stored in the shared memory to the second computing node.
For example, the first computing node may be actively sending the first database resource metadata to the second computing node. The first database resource metadata may be sent to the second computing node after receiving the instruction designating the second computing node.
For example, a first computing node may have a designated database management software running therein that may monitor execution of a database process in the first computing node. After detecting that the database process in the first computing node is abnormal, the database management software can inform the second computing node, and then the second computing node sends a designated instruction to the first computing node to instruct the first computing node to send the first database resource metadata to the second computing node.
Step 304, the second computing node receives database resource metadata.
No exception occurs to the database process of the second compute node.
In this way, after the second computing node receives the database resource metadata of the first computing node (i.e., the first database resource metadata), subsequent data processing operations may be performed quickly and efficiently based on the first database resource metadata. Exemplary data processing operations include, but are not limited to: and reallocating the first database resource metadata in the computing nodes with no abnormality of the database processes in the database cluster, performing abnormal database task recovery and the like.
Therefore, when the database process in the first computing node is abnormal, the database resource metadata stored in the shared memory is not lost along with the abnormality of the database process, and the first computing node still can acquire the database resource metadata from the shared memory, so that the first computing node can send the database resource metadata to the second computing node in which the abnormality of the database process does not occur, the second computing node can efficiently and quickly acquire the database resource metadata of the first computing node, and long time is not required to restore the database resource metadata according to the database resource information in the computing node in which the abnormality of the database process does not occur, thereby facilitating the subsequent quick restoration of the abnormal database task in the first computing node, and greatly improving the processing efficiency of the abnormal database task.
In some embodiments, as shown in fig. 3, after the step 304, the method further includes:
in step 305, the second computing node determines a manner in which the metadata of the database resource is allocated among computing nodes in the database cluster in which no abnormality occurs in the database process.
In this embodiment of the present application, after the first database resource metadata is obtained from the first computing node efficiently and quickly, the first database resource metadata may be reassigned in the computing node (including the second computing node) where no abnormality occurs in the database process in the database cluster, so that the first database resource metadata is restored to the computing node where no abnormality occurs in the database process in the database cluster, thereby restoring the abnormal database task in the first computing node based on the first database resource metadata.
Since the database process in the first computing node is abnormal, the specific content of the allocation algorithm adopted when the first database resource metadata is reallocated is generally different from that of the allocation algorithm when the first computing node is not abnormal, so that the first database resource metadata is not allocated to the computing node such as the first computing node which is abnormal.
That is, after the database process of the first computing node is abnormal, the second computing node needs to update the allocation algorithm, and then, the second computing node may determine, based on the updated allocation algorithm, an allocation manner of the first database resource metadata in the computing nodes in which the database process in the database cluster is not abnormal. If it is determined that some or all of the first database resource metadata should be stored in the second computing node, then some or all of the first database resource metadata may be stored in the second computing node.
In this embodiment of the present invention, after obtaining the first database resource metadata, the second computing node may redetermine an allocation manner of the first database resource metadata in computing nodes where no abnormality occurs in a database process in the database cluster, so that the first database resource metadata is allocated to computing nodes where no abnormality occurs in the database process for storage, and may recover, according to the first database resource metadata, a database task where an abnormality occurs in the first computing node.
An exemplary description of the processing mechanism in the first computing node is provided below.
In some embodiments, the first computing node runs a daemon, both the database process and the daemon having access to the shared memory;
the step 303 includes:
after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node through the daemon.
An exemplary architecture diagram of a database cluster is shown in fig. 5.
As shown in fig. 5, in an embodiment of the present application, a first computing node may be running with a database process and a daemon, where the daemon is a different process than the database process.
Both the database process and the daemon can access the shared memory, that is, the memories respectively corresponding to the database process and the daemon are mapped to the shared memory. Specifically, the database process may map its own virtual address to a specified storage space in the physical memory, and the daemon may also map its own virtual address to the specified storage space in the physical memory, so that the database process and the daemon may respectively associate their respective corresponding virtual address spaces to the same storage space of the physical memory, which may be considered as a shared memory to which the database process and the daemon correspond.
Thus, when the database process is abnormal, the daemon process can still access the shared memory, so that the first database resource metadata is obtained from the shared memory and is sent to the second computing node, and the second computing node which is not abnormal in the database process is not required to spend a great deal of time to restore the first database resource metadata, thereby greatly improving the processing efficiency of abnormal database tasks. The database process may be abnormal and exit from running during the execution, or the database process may be abnormal and unresponsive during the execution.
The rights of the database process and daemon when accessing the shared memory are not limited herein. For example, the database process may read and write the first database resource metadata stored in the shared memory, so as to manage the first database resource metadata stored in the shared memory. The daemon may perform a read operation on the first database resource metadata stored in the shared memory, thereby obtaining the first database metadata from the shared memory.
There may be a variety of situations in which database processes and daemons are generated and run at the same time.
In one example, during execution of the database process by the first computing node, the daemon is in an operational state.
In the embodiment of the application, the daemon process can be created when the database process is created or before the database process is created, and the database process and the daemon process are respectively associated with the shared memory in the process of creating the database process and the daemon process, so that the shared memory can be accessed by both the database process and the daemon process.
At this time, as long as at least one process in the processes associated with the shared memory is still in a surviving state, the shared memory will exist, and the information stored in the shared memory will be retained. After the database process is abnormal, the daemon is still in an operation state because the daemon is not abnormal, so that the shared memory still exists, the first database resource metadata stored in the shared memory is not lost, and the daemon can efficiently and quickly acquire the first database resource metadata so as to be convenient for timely transmitting to the second computing node.
In another example, a daemon may be created and started during the running of a database process.
In yet another example, a daemon process may be created after an exception occurs in a database process.
At this point, the lifecycle of the shared memory may follow the operating system kernel of the first computing node. Even if the database process has finished running, the shared memory still exists along with the existence of the operating system kernel of the first computing node, and if the operating system kernel of the first computing node does not modify the information in the shared memory, the processing result of the database process on the metadata of the first database resource in the shared memory can be always reserved along with the operating system kernel. A daemon is created after an exception occurs in the database process and the virtual memory space of the daemon is mapped to the shared memory so that the daemon can obtain the first database resource metadata from the shared memory and send to the second computing node.
In addition, in the application process, efficient and accurate transmission of the first database resource metadata can be achieved based on information interaction between the first computing node and the second computing node.
An exemplary description of the information interaction process between the first computing node and the second computing node is provided below.
As shown in fig. 6, the step 303 specifically includes steps 3031 to 3033:
in step 3031, after the database process of the first computing node is abnormal, the first computing node sends notification information to the second computing node.
The notification information is used for indicating that the database process of the first computing node is abnormal.
There may be a variety of ways in which the first computing node sends notification information to the second computing node.
For example, in one embodiment, a first computing node may send notification information point-to-point to a second computing node.
In yet another embodiment, the first computing node may broadcast the notification information to enable the second computing node to receive the notification information. In this embodiment, the first computing node may broadcast the notification information, so that all computing nodes in the database cluster in which no abnormality occurs in the database process may efficiently and quickly receive the notification information.
Step 3032, the second computing node sends the request information to the first computing node after receiving the notification information.
The request information is used to request database resource metadata.
After receiving the notification information, the second computing node whose database process is not abnormal may send request information to the first computing node to request the first database resource metadata.
Step 3033, after receiving the request information, the first computing node sends the database resource metadata stored in the shared memory to the second computing node.
After receiving the request information, the first computing node can determine the computing node in the database cluster, in which the database process is not abnormal, and can send the first database resource metadata to the computing node in which the database process is not abnormal.
It can be seen that, in the embodiment of the present application, the first computing node sends the notification information so that the computing node where no abnormality occurs in each database process knows that an abnormality occurs in the database process in the first computing node. And then, the second computing node sends the request information to the first computing node, so that the first computing node can determine the computing node with no abnormality in the database process in the database cluster, and can send the first database resource metadata to the computing node with no abnormality in the database process, so that the computing node with no abnormality in the database process can efficiently and quickly obtain the first database resource metadata.
Further, in some embodiments, database resource metadata is stored to the first computing node based on an allocation algorithm.
After the second computing node receives the notification information, the step 305 may include steps 3051-3052;
at step 3051, the second computing node updates the allocation algorithm.
The allocation algorithm is used to allocate database resource metadata to one or more computing nodes. The allocation algorithm may be an algorithm developed at present and later, and is not limited in this embodiment of the present application.
Illustratively, the allocation algorithm may be a consistent hashing algorithm. The consistent hashing algorithm is a special hashing algorithm. In the distributed cluster, through a consistent hashing algorithm, when one node (such as a server) is removed or added, the mapping relationship between the existing service request and the node for processing the service request can be changed as little as possible, so that the requirement of monotonicity is met as much as possible.
In this embodiment of the present application, the allocation algorithm may be an algorithm adopted when the metadata of the first database resource is allocated to the first computing node, and the allocation algorithm may also be referred to as an allocation algorithm before update. The updated allocation algorithm is different from the pre-update allocation algorithm.
The manner in which the allocation algorithm is updated may be determined based on the specifics of the allocation algorithm, and is not limited herein. Illustratively, the updating allocation algorithm may be a different type of algorithm, or may be a different value of a parameter configured by the same allocation algorithm, or the like. That is, the updated allocation algorithm may be different from the allocation algorithm in type, or may be different from the allocation algorithm in the value of the relevant parameter.
In step 3052, the second computing node determines, according to the updated allocation algorithm, an allocation manner of the database resource metadata in the computing nodes in which no abnormality occurs in the database process in the database cluster.
Illustratively, the allocation algorithm may be a consistent hashing algorithm. In the embodiment of the application, the updated consistent hash algorithm is used for reallocating the first database resource metadata, so that the mapping relationship between the database resource metadata existing in the second computing node and the second computing node can be changed unchanged or with a small amplitude.
After receiving the notification information, the second computing node may update the allocation algorithm, and determine, according to the received first database resource metadata and the updated allocation algorithm, an allocation manner of the first database resource metadata in the database cluster.
In some embodiments, the step 3052 specifically includes the following steps:
the second computing node determines metadata related to the second computing node in the metadata of the first database resource according to the updated allocation algorithm;
the second computing node stores metadata associated with the second computing node as second database resource metadata corresponding to the second computing node.
In this embodiment, the database resource metadata corresponding to the second computing node is second database resource metadata.
Each second computing node may determine first database resource metadata associated with the respective second computing node according to the updated allocation algorithm and store the first database resource metadata associated with the respective second computing node as second database resource metadata corresponding to the second computing node.
Therefore, the first database resource metadata can be redistributed in the computing nodes with no abnormality of the database process in the database cluster, so that after the first database resource metadata is redistributed, the abnormal database task in the first computing node can be recovered according to the stored first database resource metadata in the corresponding computing nodes with no abnormality of the database process, the recovery efficiency of the abnormal database task is greatly improved, and the recovery time of the abnormal database task is reduced.
Further, illustratively, database management software may be included in each computing node, such as a content management system (content management system, CMS) to monitor the respective database processes through the CMS and perform one or more of the information interactions described above.
For example, different computing nodes may communicate with each other via their respective CMSs to monitor performance of database tasks in the plurality of computing nodes.
When the CMS running in the first computing node monitors that the database process of the first computing node is abnormal, notification information may be broadcast to indicate that the database process of the first computing node is abnormal. The first computing node also has a daemon running therein that can access the shared memory to obtain first database resource metadata and send the first database resource metadata to the second computing node.
For example, as shown in FIG. 7a, an exemplary schematic diagram of database resource metadata in a database cluster.
In the example shown in fig. 7a, the database cluster comprises compute node 1, compute node 2 and compute node 3. The computing node 1 stores database resource metadata a, the computing node 2 stores database resource metadata B, and the computing node 3 stores database resource metadata C.
If an abnormality occurs in the database process in the computing node 3, the computing node 3 may be used as the first computing node. And no abnormality occurs in the database processes in the computing node 1 and the computing node 2, the computing node 1 and the computing node 2 can be regarded as second computing nodes.
At this point, an exemplary diagram of reallocating the first database resource metadata in the database cluster is shown in FIG. 7 b.
In fig. 7b, it can be determined based on the updated consistent hashing algorithm that the database resource metadata C is divided into two parts, database resource metadata C1 and database resource metadata C2.
Wherein the database resource metadata C1 is allocated to the computing node 1 for storage; at this time, the database resource metadata in the computing node 1 includes the database resource metadata C1 and the database resource metadata a stored in advance. And database resource metadata C2 is allocated to computing node 2 for storage; at this time, the database resource metadata in the computing node 2 includes the database resource metadata C2 and the database resource metadata B stored in advance.
In this way, the computing node 1 may recover the database task related to the database resource metadata C1 and having an abnormality in the computing node 3 based on the database resource metadata C1, and the computing node 2 may recover the database task related to the database resource metadata C2 and having an abnormality in the computing node 3 based on the database resource metadata C2.
In the embodiment of the present application, a specific example is described below for an information interaction procedure between a first computing node and a second computing node.
As shown in fig. 8, a database process, daemon, and CMS1 may be running in the first computing node, CMS1 being used to monitor the database process. A database process may be run in the second computing node and CMS2 may be used to execute the database process in the second computing node, and CMS2 is used to monitor the database process.
As shown in fig. 8, in the actual operation, the following steps may be included:
at step 801, cms2 monitors the database process of the second computing node.
Wherein the CMS2 may monitor the database process of the second computing node in real time.
At step 802, CMS1 monitors a database process of a first computing node.
Wherein the CMS1 may monitor the database process of the first computing node in real time.
In step 803, data interactions with respect to database tasks may be performed between the database process of the first computing node and the database process of the second computing node.
In step 804, the database process of the first computing node is out of operation due to an exception.
In step 805, the cms1 monitors that an exception has occurred in the database process of the first computing node and exits from operation.
At step 806, CMS1 broadcasts notification information.
The CMS1 broadcasts notification information so that a computing node (e.g., a second computing node) whose database process is not abnormal knows that the database program of the first computing node is abnormal.
In step 807, the cms2 receives notification information.
CMS2 may receive the notification information to determine that an anomaly has occurred in the database process in the first computing node.
At step 808, cms2 notifies the database process of the second computing node to update the consistent hashing algorithm.
Step 809, the database program of the second computing node updates the consistent hashing algorithm.
In step 8010, the database process of the second computing node sends the request information to the daemon of the first computing node.
The database process of the second computing node may send request information to the daemon of the first computing node to request the first database resource metadata.
In step 8011, a daemon of a first computing node receives request information.
In step 8012, the daemon of the first computing node reads the first database resource metadata stored in the shared memory of the first computing node.
In step 8013, the daemon process of the first computing node sends first database resource metadata to the database process of the second computing node.
In step 8014, the database process of the second computing node determines metadata related to the second computing node in the first database resource metadata according to the updated consistent hash algorithm, and stores the metadata related to the second computing node as second database resource metadata corresponding to the second computing node.
In step 8015, the database process of the second computing node resumes the database task in the first computing node that was abnormal.
The database process of the second computing node may recover a portion of the database tasks or all of the database tasks that are abnormal.
For example, the database process of the second computing node may recover the database task related to the metadata associated with the second computing node from the first database resource metadata.
Having described the data processing method in various aspects, embodiments of the present application, a data processing apparatus applied to a first computing node, and a data processing apparatus applied to a second computing node of the present application are described below with reference to the accompanying drawings.
As shown in fig. 9, the embodiment of the present application provides a data processing apparatus 90, where the apparatus 90 may be applied to the first computing node in the foregoing embodiment.
An embodiment of the apparatus 90 comprises:
and the sending module 901 is configured to send, after an abnormality occurs in a database process of the first computing node, database resource metadata stored in the shared memory to the second computing node, where the abnormality does not occur in the database process of the second computing node.
Optionally, the database resource metadata includes role information and lock patterns corresponding to the associated database resource.
Optionally, the apparatus 90 further includes:
the processing module 902 is configured to write, through a database process, metadata of a database resource into the shared memory.
Optionally, the apparatus 90 further includes:
and the processing module 902 is configured to map, when the database process is created, a memory corresponding to the database process to the shared memory.
Optionally, the first computing node is running a daemon, and both the database process and the daemon can access the shared memory;
the sending module 901 is configured to:
and after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node through the daemon.
Optionally, during the running of the database process by the first computing node, the daemon is in a running state.
Optionally, the sending module 901 is configured to:
after the database process of the first computing node is abnormal, sending notification information to the second computing node, wherein the notification information is used for indicating the database process of the first computing node to be abnormal;
and after receiving the request information from the second computing node, sending the database resource metadata stored in the shared memory to the second computing node, wherein the request information is generated by the second computing node according to the notification information, and the request information is used for requesting the database resource metadata.
Optionally, the sending module 901 is configured to:
after an anomaly occurs in the database process of the first computing node, notification information is broadcast.
As shown in fig. 10, an embodiment of the present application provides a data processing apparatus 100, where the apparatus 100 may be applied to the second computing node in the foregoing embodiment.
An embodiment of the apparatus 100 comprises:
the receiving module 1001 is configured to receive database resource metadata sent by a first computing node, where an abnormality occurs in a database process of the first computing node, and no abnormality occurs in a database process of a second computing node.
Optionally, the apparatus 100 further comprises a processing module 1002;
the processing module 1002 is configured to:
and determining the distribution mode of the database resource metadata in the computing nodes in which the database processes in the database cluster are not abnormal.
Optionally, the database resource metadata is stored to the first computing node based on an allocation algorithm;
the processing module 1002 is configured to:
receiving notification information sent by a first computing node, wherein the notification information is used for indicating that the database process of the first computing node is abnormal;
updating an allocation algorithm according to the notification information;
and determining the distribution mode of the first database resource metadata in the computing nodes with no abnormality of the database process in the database cluster according to the updated distribution algorithm.
Optionally, the apparatus 100 further comprises a transmitting module 1003;
the sending module 1003 is configured to:
after receiving the notification information from the first computing node, sending request information to the first computing node, the request information being used to request database resource metadata.
Optionally, the processing module 1002 is configured to:
determining metadata related to the second computing node in the metadata of the first database resource according to the updated allocation algorithm;
metadata associated with the second computing node is stored as second database resource metadata corresponding to the second computing node.
Fig. 11 is a schematic diagram of a possible logic structure of the first computing node 110 according to an embodiment of the present application. The first computing node 110 is configured to implement the functionality of the first computing node as referred to in any of the embodiments above. The first computing node 110 includes: memory 1101, processor 1102, communication interface 1103 and bus 1104. The memory 1101, the processor 1102, and the communication interface 1103 are communicatively connected to each other through a bus 1104.
The memory 1101 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access memory (random access memory, RAM). The memory 1101 may store a program, and when the program stored in the memory 1101 is executed by the processor 1102, the processor 1102 and the communication interface 1103 are used to perform the steps 301-305 and the like of the above-described data processing method embodiment.
The processor 1102 may employ a central processing unit (central processing unit, CPU), microprocessor, application specific integrated circuit (application specific integrated circuit, ASIC), graphics processor (graphics processing unit, GPU), digital signal processor (digital signal processing, DSP), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or any combination thereof, for executing associated programs to perform the functions required by the sending module, processing module, etc. in the data processing apparatus applied to the first computing node in the above embodiments, or to perform steps 301-305, etc. of the data processing method embodiments of the present application. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 1101, and the processor 1102 reads the information in the memory 1101, and performs steps 301-305 of the above-described data processing method embodiment in combination with its hardware.
The communication interface 1103 enables communication between the first computing node 110 and other devices or communication networks using a transceiving means, such as, but not limited to, a transceiver. For example, information interaction with the second computing node in any of the method embodiments described above may be performed through the communication interface 1103.
A bus 1104 may implement a pathway for information among the various components of the first computing node 110 (e.g., the memory 1101, the processor 1102, and the communication interface 1103). Bus 1104 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in FIG. 11, but not only one bus or one type of bus.
In another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor of a device, perform the steps performed by the processor of fig. 11 described above.
In another embodiment of the present application, there is also provided a computer program product comprising computer-executable instructions stored in a computer-readable storage medium; when the processor of the device executes the computer-executable instructions, the device performs the steps described above for the processor of fig. 11.
In another embodiment of the present application, there is also provided a chip system including a processor for implementing the steps performed by the processor of fig. 11. In one possible design, the system on a chip may further include a memory, the memory storing program instructions and data necessary for the means for writing data. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
Fig. 12 is a schematic diagram of a possible logic structure of the second computing node 120 according to an embodiment of the present application. The second computing node 120 is configured to implement the functionality of the second computing node as referred to in any of the embodiments above. The second computing node 120 includes: memory 1201, processor 1202, communication interface 1203, and bus 1204. Wherein the memory 1201, the processor 1202 and the communication interface 1203 are communicatively coupled to each other via a bus 1204.
The memory 1201 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (random access memory, RAM). The memory 1201 may store a program, and when the program stored in the memory 1201 is executed by the processor 1202, the processor 1202 and the communication interface 1203 are configured to execute the steps executed by the second computing node in the above-described data processing method embodiment, and the like.
The processor 1202 may employ a central processing unit (central processing unit, CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processor (graphics processing unit, GPU), digital signal processor (digital signal processor, DSP), off-the-shelf programmable gate array (field-programmable gate array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or any combination thereof, for executing associated programs to implement the functions required to be performed by the receiving module, transmitting module, processing module, etc. in the data processing apparatus of the second computing node of the above embodiment, or to perform the steps performed by the second computing node in the data processing method embodiment of the present application. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 1201, and the processor 1202 reads the information in the memory 1201 and performs the steps performed by the second computing node in the data processing method embodiment described above in connection with its hardware.
The communication interface 1203 uses a transceiving means, such as, but not limited to, a transceiver, to enable communication between the second computing node 120 and other devices or communication networks. For example, information interaction may be performed with the first computing node as referred to in any of the embodiments described above.
Bus 1204 may implement a pathway for information among the various components of second computing node 120 (e.g., memory 1201, processor 1202, and communication interface 1203). Bus 1204 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 12, but not only one bus or one type of bus.
In another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor of a device, perform the steps performed by the processor of fig. 12 described above.
In another embodiment of the present application, there is also provided a computer program product comprising computer-executable instructions stored in a computer-readable storage medium; when the processor of the device executes the computer-executable instructions, the device performs the steps described above for the processor of fig. 12.
In another embodiment of the present application, there is also provided a chip system including a processor for implementing the steps performed by the processor of fig. 12 described above. In one possible design, the system on a chip may further include a memory, the memory storing program instructions and data necessary for the means for writing data. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
As shown in fig. 13, in another embodiment of the present application, there is further provided a database cluster 130, where the database cluster 130 may include the first computing node 110 and the second computing node 120, so as to implement, by using the first computing node 110, the function of the first computing node in any of the method embodiments, and implement, by using the second computing node 120, the function of the second computing node in any of the method embodiments.
As shown in fig. 14, in another embodiment of the present application, there is further provided a database system 140, where the database system includes the database cluster 130 and a storage device 150, the storage device 150 is connected to the first computing node 110 and the second computing node 120 in the database cluster 130, and the storage device 150 is used to store database resources.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or, what contributes to the prior art, or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above is merely a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto.

Claims (23)

1. The data processing method is characterized by being applied to a database cluster, wherein the database cluster comprises a first computing node and a second computing node, database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, and the database resource metadata is managed by a database process in the first computing node;
the method comprises the following steps:
after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node;
and the second computing node receives the database resource metadata, wherein the database process of the second computing node is not abnormal.
2. The data processing method of claim 1, wherein the database resource metadata includes role information and lock patterns corresponding to related database resources.
3. A data processing method according to claim 1 or 2, characterized in that the method further comprises:
And the first computing node writes the metadata of the database resources into the shared memory through the database process.
4. A data processing method according to any one of claims 1-3, characterized in that the method further comprises:
and when the first computing node creates the database process, mapping the memory corresponding to the database process to the shared memory.
5. The data processing method of any of claims 1-4, wherein the first computing node is running a daemon, both the database process and the daemon having access to the shared memory;
after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node, including:
after the database process of the first computing node is abnormal, the first computing node sends the database resource metadata stored in the shared memory to the second computing node through the daemon.
6. The data processing method of claim 5, wherein the daemon is in an operational state during the operation of the database process by the first computing node.
7. The data processing method of any of claims 1-6, wherein after the second computing node receives the database resource metadata, the method further comprises:
and the second computing node determines the distribution mode of the database resource metadata in the computing nodes with no abnormal database process in the database cluster.
8. The method according to any one of claims 1 to 7, wherein after an abnormality occurs in the database process of the first computing node, the first computing node sends the database resource metadata stored in the shared memory to the second computing node, including:
after the database process of the first computing node is abnormal, the first computing node sends notification information to the second computing node, wherein the notification information is used for indicating the database process of the first computing node to be abnormal;
after receiving the notification information, the second computing node sends request information to the first computing node, wherein the request information is used for requesting the database resource metadata;
after receiving the request information, the first computing node sends the database resource metadata stored in the shared memory to the second computing node.
9. The method according to claim 8, wherein the sending, by the first computing node, notification information to the second computing node after the occurrence of an abnormality in the database process of the first computing node, includes:
after the database process of the first computing node is abnormal, the first computing node broadcasts the notification information.
10. The data processing method is characterized in that the data processing method is applied to a first computing node, the first computing node belongs to a database cluster, the database cluster further comprises a second computing node, database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, and the database resource metadata is managed by a database process in the first computing node;
the method comprises the following steps:
and after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node, wherein the database process of the second computing node is not abnormal.
11. The data processing method of claim 10, wherein the database resource metadata includes role information and lock patterns corresponding to related database resources.
12. A data processing method according to claim 10 or 11, characterized in that the method further comprises:
and writing the metadata of the database resources into the shared memory through the database process.
13. A data processing method according to any one of claims 10-12, characterized in that the method further comprises:
and when the database process is created, mapping the memory corresponding to the database process to the shared memory.
14. The data processing method of any of claims 10-13, wherein the first computing node is running a daemon, both the database process and the daemon having access to the shared memory;
after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node, wherein the method comprises the following steps:
and after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node through the daemon.
15. The data processing device is characterized in that the data processing device is applied to a first computing node, the first computing node belongs to a database cluster, the database cluster further comprises a second computing node, database resource metadata corresponding to the first computing node is stored in a shared memory of the first computing node, and the database resource metadata is managed by a database process in the first computing node;
The device comprises:
and the sending module is used for sending the database resource metadata stored in the shared memory to the second computing node after the database process of the first computing node is abnormal, wherein the database process of the second computing node is not abnormal.
16. The data processing apparatus of claim 15, wherein the apparatus further comprises:
and the processing module is used for writing the database resource metadata into the shared memory through the database process.
17. A data processing apparatus according to claim 15 or 16, wherein the apparatus further comprises:
and the processing module is used for mapping the memory corresponding to the database process to the shared memory when the database process is created.
18. The data processing apparatus of any of claims 15-17, wherein the first computing node is running a daemon, both the database process and the daemon having access to the shared memory;
the sending module is used for:
and after the database process of the first computing node is abnormal, sending the database resource metadata stored in the shared memory to the second computing node through the daemon.
19. A first computing node comprising at least one processor, a memory, and instructions stored on the memory and executable by the at least one processor, the at least one processor executing the instructions to implement the steps of the method of any one of claims 10-14.
20. A computer readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, implements the method of any of claims 10-14.
21. A database cluster comprising the first computing node and the second computing node of claim 19;
the second computing node is configured to receive the database resource metadata, where no anomaly occurs in a database process of the second computing node.
22. The database cluster of claim 21, wherein the database cluster is configured to store, in a database,
the second computing node is further configured to:
and determining the distribution mode of the computing nodes of which the database resource metadata is not abnormal in the database process in the database cluster.
23. A database system comprising a database cluster according to claim 21 or 22 and a storage device connected to a first computing node and a second computing node in the database cluster, the storage device being for storing database resources.
CN202211195959.6A 2022-09-28 2022-09-28 Data processing method and related equipment Pending CN117827474A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211195959.6A CN117827474A (en) 2022-09-28 2022-09-28 Data processing method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211195959.6A CN117827474A (en) 2022-09-28 2022-09-28 Data processing method and related equipment

Publications (1)

Publication Number Publication Date
CN117827474A true CN117827474A (en) 2024-04-05

Family

ID=90513996

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211195959.6A Pending CN117827474A (en) 2022-09-28 2022-09-28 Data processing method and related equipment

Country Status (1)

Country Link
CN (1) CN117827474A (en)

Similar Documents

Publication Publication Date Title
US8239505B2 (en) Progressively implementing declarative models in distributed systems
US8850156B2 (en) Method and system for managing virtual machine storage space and physical host
US8832693B2 (en) Runtime virtual process creation for load sharing
US11314420B2 (en) Data replica control
US8312201B2 (en) Managing memory allocations loans
US20200042454A1 (en) System and method for facilitating cluster-level cache and memory space
JP2006524381A (en) Simultaneous access to shared resources
CN110096336A (en) Data monitoring method, device, equipment and medium
KR20140034246A (en) Memory management model and interface for new applications
CN108073423B (en) Accelerator loading method and system and accelerator loading device
US6968382B2 (en) Activating a volume group without a quorum of disks in the volume group being active
KR20140033448A (en) Memory management model and interface for unmodified applications
US8087015B2 (en) Assignment of application models to deployment targets
EP3304294A1 (en) Method and system for allocating resources for virtual hosts
US11271895B1 (en) Implementing advanced networking capabilities using helm charts
EP3384384A1 (en) Methods and devices for acquiring data using virtual machine and host machine
CN111897666A (en) Method, device and system for communication among multiple processes
US20150301913A1 (en) Storage apparatus and failover method
US20190163626A1 (en) Multi-Ring Shared, Traversable, and Dynamic Advanced Database
US8332844B1 (en) Root image caching and indexing for block-level distributed application management
CN108062239B (en) Accelerator loading method and system and accelerator loading device
CN105677481A (en) Method and system for processing data and electronic equipment
US7536422B2 (en) Method for process substitution on a database management system
CN112230978A (en) Multi-data-source dynamic switching method, electronic equipment and storage medium
CN113268356B (en) LINUX system-based multi-GPU board card bounding system, method and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination