Node management method, device and equipment in database system and storage medium

By obtaining information and transaction information of the target node from the metadata node, the problem of time-consuming normal service provision after node failure in a distributed database system is solved, achieving rapid feedback and efficient system recovery.

CN115237968BActive Publication Date: 2025-11-25SHANGHAI DAMENG DATABASE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210849337.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-19
Publication Date
2025-11-25
Estimated Expiration
2042-07-19

AI Technical Summary

Technical Problem

In a distributed database system, when a compute node or data node fails, it cannot receive exclusive blocking broadcast messages, resulting in a long time to provide normal service after the fault is recovered.

Method used

By obtaining the node information and current transaction information of the target node from the metadata node, the node status is determined, and access requests are processed based on this information. Feedback information is provided to resolve locking conflicts and avoid waiting for the completion of DDL transactions or synchronization of locking information.

Benefits of technology

The target node can immediately obtain feedback information after the fault is recovered, which reduces waiting time and improves system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237968B_ABST
    Figure CN115237968B_ABST
Patent Text Reader

Abstract

The application discloses a node management method, device and equipment in a database system and a storage medium, and is applied to a metadata node in a distributed database system, and the method comprises the following steps: when an access request of a target node is received, acquiring node information of the target node; determining a node state of the target node according to the node information; if the node state is a sick state, acquiring current transaction information managed by the metadata node; processing the access request according to the node information and the current transaction information, determining to-be-returned information, and feeding back the to-be-returned information to the target node, thereby solving the problem that a target node takes a long time to provide normal services after fault recovery. Through setting the node state of the target node, for the target node in the sick state, the node information and the transaction information are used for lock conflict checking, and the access request is processed. The target node can immediately send an access request to start services after fault recovery, without waiting, thereby saving time and improving system efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of database, and particularly relates to a node management method and device in a database system, equipment and a storage medium. BACKGROUND

[0002] In a distributed database system, dictionary lock is a global lock. If a global lock is performed, a lock node (generally a metadata node) is determined in the entire distributed system, and all locks are communicated with the node.

[0003] In a database system, only exclusive locks may cause lock conflicts, and the frequency of exclusive locks is much less than that of shared locks. Based on the above reasons, some distributed databases use an optimistic dictionary lock mode: exclusive locks are broadcasted; and for shared locks, only local locks are performed on the node performing the lock.

[0004] However, in this case, if a computing node or a data node fails, the node cannot receive the broadcast message of the exclusive lock during the failure. After the failure is recovered, the metadata node needs to wait until the metadata node completes a database object definition modification (DDL) transaction or synchronizes the lock information during the failure before providing normal services, and this operation may be time-consuming. SUMMARY

[0005] The present application provides a node management method, device, equipment and storage medium in a database system to solve the problem of time-consuming in providing normal services after a node fails.

[0006] According to an aspect of the present application, a node management method in a database system is provided, applied to a metadata node in a distributed database system, comprising:

[0007] When an access request of a target node is received, node information of the target node is acquired;

[0008] A node state of the target node is determined according to the node information;

[0009] If the node state is a sick state, current transaction information managed by the metadata node is acquired;

[0010] The access request is processed according to the node information and the current transaction information, to determine to-be-returned information, and the to-be-returned information is fed back to the target node.

[0011] According to another aspect of the present application, a node management device in a database system is provided, applied to a metadata node in a distributed database system, comprising:

[0012] The node information acquisition module is used to acquire the node information of the target node when an access request for the target node is received.

[0013] A node status determination module is used to determine the node status of the target node based on the node information.

[0014] The transaction information acquisition module is used to acquire the current transaction information managed by the metadata node if the node status is a diseased state.

[0015] The information feedback module is used to process the access request based on the node information and the current transaction information, determine the information to be fed back, and feed back the information to be fed back to the target node.

[0016] According to another aspect of the present invention, an electronic device is provided as a metadata node, the electronic device comprising:

[0017] At least one processor; and

[0018] A memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the node management method in the database system according to any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the node management method in the database system according to any embodiment of the present invention.

[0021] The technical solution of this invention, when receiving an access request from a target node, obtains the node information of the target node; determines the node status of the target node based on the node information; if the node status is faulty, obtains the current transaction information managed by the metadata node; processes the access request based on the node information and the current transaction information, determines the information to be fed back, and feeds back the information to the target node, thus solving the problem of time consumption in providing normal service after the target node recovers from a fault. After receiving an access request from the target node, the node information of the target node is obtained, the node status is determined based on the node information, and if the node status is faulty, the current transaction information managed by the metadata node is obtained. The access request is processed based on the current transaction information and the node information, the corresponding information to be fed back is determined, and fed back to the target node. This application sets a node status for the target node, judges the node status, and for target nodes in a faulty state, performs a blocking conflict check through the node information and the current transaction information, and then processes the access request accordingly to obtain the information to be fed back. After the target node recovers from the fault and starts up, it can send an access request to the metadata node at any time to obtain feedback information. It does not need to wait for the metadata node to complete the DDL transaction or synchronize the blocking information during the fault before it can obtain feedback information. The target node can send an access request to obtain feedback information immediately after recovering from the fault and starting up, saving time and improving system efficiency.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a node management method in a database system according to Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart of a node management method in a database system according to Embodiment 2 of the present invention;

[0026] Figure 3 This is a schematic diagram of the structure of a node management device in a database system according to Embodiment 3 of the present invention;

[0027] Figure 4This is a schematic diagram of the structure of an electronic device that implements the node management method in the database system of this invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "target," "original," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Example 1

[0031] Figure 1 This is a flowchart illustrating a node management method in a database system according to Embodiment 1 of the present invention. This embodiment is applicable to managing the operation of nodes in a database. The method can be executed by a database node management device, which can be implemented in hardware and / or software and can be configured in metadata nodes. Figure 1 As shown, the method includes:

[0032] S101. When an access request is received from the target node, obtain the node information of the target node.

[0033] In this embodiment, the target node can be a computing node, storage node, etc., in the database system. In a distributed database system, nodes are categorized as follows: Metadata nodes: store all metadata information in the entire distributed database system. Computing nodes: responsible for processing user requests, generating execution plans, and controlling the distribution and execution of these plans. Storage nodes: data is distributed and stored across several storage nodes according to distribution rules; they execute the sub-plans for data access by the computing nodes. An access request can be specifically understood as a request generated when the target node needs to access a certain dictionary object. Node information can be understood as information describing the target node, which may include node status, node startup time, node name, node identifier, etc.

[0034] It's important to know that in a distributed environment, all metadata information is stored in metadata nodes. All DDL operations that modify metadata information are sent directly to the metadata nodes for execution. Among these, the data dictionary corresponding to a dictionary object is a type of metadata information.

[0035] Specifically, during its operation, the target node can provide services to users at any time. When providing services, it generates access requests and sends them to the metadata node. The target node's operation process can refer to its normal operation or its startup process after a fault recovery. The metadata node pre-generates and stores the target node's node information and manages this information during the target node's operation. Upon receiving an access request from the target node, it retrieves the target node's node information from the corresponding module.

[0036] S102. Determine the node status of the target node based on the node information.

[0037] In this embodiment, the node status can be either normal, indicating that the node is functioning correctly and there are no blocking conflicts, or it can be in a "sick" state, indicating that the node may be experiencing blocking conflicts. The node information is parsed to determine the node status of the target node.

[0038] S103. If the node status is in a diseased state, obtain the current transaction information managed by the metadata node.

[0039] In this embodiment, the current transaction information can be specifically understood as the information of the DDL transactions currently managed by the metadata node. This information is managed and maintained by the DDL transaction submodule provided in the transaction module of the metadata node. The DDL transaction submodule maintains the transaction information for all DDL transactions, which can be stored in a linked list. The current transaction information may include the start time of each currently managed transaction. When a node is in a "sick" state, it is determined whether there is a first transaction. If there is a first transaction and its start time is not greater than the node's start time, a lock conflict check is performed on the target node. The current transaction information managed by the metadata node is obtained from the corresponding module, and the lock conflict check is performed on the target node using this information.

[0040] It is important to know that exclusive locks in a database are mostly generated by database object definition modifications (DDL); and database object definition modifications are sent to the metadata node for execution; therefore, exclusive locks are generated by the metadata node. Thus, this application performs exclusive lock checks through the metadata node.

[0041] S104. Process the access request based on the node information and the current transaction information, determine the information to be fed back, and feed back the information to be fed back to the target node.

[0042] In this embodiment, the feedback information can be specifically understood as the response information obtained after processing the access request, which needs to be fed back to the target node. The feedback information can be the information obtained from a normal response to the access request, or it can be the error information obtained from the access request being unable to be responded to normally due to a blocking conflict, informing the target node or user to wait.

[0043] Specifically, based on node information and current transaction information, it is determined whether all DDL transactions before the target node started have been fully executed. If all have been completed, the node is updated to a normal state, access requests are processed normally, and the information requested by the access request is identified as feedback information and sent to the target node. If not all have been completed, it is necessary to further determine whether the dictionary object accessed by the access request has an exclusive lock. If an exclusive lock exists, the access request is invalid and cannot be processed normally, resulting in access failure, and corresponding feedback information is generated and sent to the target node. If no exclusive lock exists, the access request is valid and can be processed normally, and the information requested by the access request is identified as feedback information and sent to the target node.

[0044] This invention provides a node management method in a database system, solving the problem of time delay in providing normal service after a target node recovers from a fault. Upon receiving an access request from the target node, the method obtains the target node's node information, determines the node status based on the node information, and if the node status is faulty, obtains the current transaction information managed by the metadata node. The access request is then processed based on the current transaction information and the node information to determine the corresponding feedback information and send it back to the target node. This application sets a node status for the target node and judges the node status. For target nodes in a faulty state, a blocking conflict check is performed using node information and transaction information, and then the access request is processed accordingly to obtain the feedback information. After recovering from a fault and starting up, the target node can send an access request to the metadata node at any time to obtain feedback information, without waiting for the metadata node to complete DDL transactions or synchronize blocking information during the fault. The target node can immediately send an access request to obtain feedback information after recovering from a fault and starting up, and then return the feedback information to the client, saving time and improving system efficiency.

[0045] Example 2

[0046] Figure 2 This is a flowchart of a node management method in a database system provided in Embodiment 2 of the present invention. This embodiment is a refinement based on the above embodiments. Figure 2 As shown, the method includes:

[0047] S201. After receiving the registration information sent by the target node, generate the node information of the target node.

[0048] The registration information is generated and sent by the target node after successful startup.

[0049] In this embodiment, the registration information can be specifically understood as information used to prompt the metadata node to register the target node. The target node generates registration information after successful startup. Target node startup can occur during normal operation or after fault recovery. Upon successful startup, the target node first generates registration information. This registration information can be generated according to a pre-defined format. The target node sends the registration information to the metadata node. Upon receiving the registration information, the metadata node generates corresponding node information for the target node, facilitating its management. Before providing services, the target node generates registration information and sends it to the metadata node. The metadata node then generates node information for the target node so that it can perform blocking conflict checks based on this information when providing services. The node information can be maintained through the node information maintenance module in the metadata node.

[0050] Optionally, the node information includes node status and node startup time. As an optional embodiment of this example, this optional embodiment further optimizes the node information for generating the target node as follows:

[0051] A1. Obtain the current time and use it as the node startup time of the target node.

[0052] In this embodiment, the node startup time can be specifically understood as the time when the target node starts working. The current time recorded in the database system is obtained and used as the node startup time of the target node.

[0053] A2. Obtain the first transaction information in the database object definition modification transaction chain. If the first transaction information does not exist, determine that the node status of the target node is normal; otherwise, determine that the node status of the target node is defective.

[0054] In this embodiment, the database object definition modification transaction linked list can be specifically understood as a linked list storing transaction information for database object definition modification transactions. The database object definition modification transaction linked list is also known as the DDL transaction linked list, and the following description uses the DDL transaction linked list. The first transaction information is the transaction information located at the head of the DDL transaction linked list. In this application, the DDL transaction linked list stores transaction information in chronological order. The first transaction information stored in the DDL transaction linked list is retrieved. If it does not exist, meaning the DDL transaction linked list currently does not have a DDL transaction that could cause an unknown exclusive lock, the node status of the target node is set to normal; otherwise, the node status of the target node is set to a sick state.

[0055] As an optional embodiment of this example, this optional embodiment further optimizes the following steps: when executing a database object definition modification transaction, determine the transaction start time of the database object definition modification transaction; generate transaction information based on the transaction start time of the database object definition modification transaction, and add the transaction information to the tail of the database object definition modification transaction linked list; after the database object definition modification transaction is completed, remove the transaction information corresponding to the database object definition modification transaction from the database object definition modification transaction linked list.

[0056] When a metadata node executes a DDL transaction, it determines the transaction start time based on the time recorded by the database system. Transaction information is then generated according to a predefined format, combining the start time with the transaction information. This transaction information, including the start time, is added to the tail of the DDL transaction linked list, thus managing the transaction information. Once the DDL transaction is complete, the corresponding transaction information is removed from the DDL transaction linked list.

[0057] As we know, the DDL transaction list can maintain and manage all DDL transactions. Metadata nodes can execute DDL transactions at any time during operation. Each time a DDL transaction is executed, its start time is recorded, and corresponding transaction information is generated and added to the tail of the DDL transaction list. The DDL transaction list can store transaction information for all DDL transactions simultaneously. After a DDL transaction is completed, all locks generated during its execution are released, and the transaction information of this completed DDL transaction is removed from the DDL transaction list.

[0058] It is important to know that compute nodes and data nodes do not proactively perform exclusive blocking. They only execute the blocking according to the message when they receive an exclusive blocking broadcast message from the metadata node, and release the blocking when they receive an unlock broadcast message.

[0059] S202. When an access request is received from the target node, obtain the node information of the target node.

[0060] S203. Determine the node status of the target node based on the node information.

[0061] S204. Determine whether the node status is in a diseased state or a normal state. If the node status is in a diseased state, execute S205; if the node status is in a normal state, execute S210.

[0062] S205. Obtain the current transaction information managed by the metadata node.

[0063] Metadata nodes manage transaction information through the DDL transaction chain, so metadata nodes obtain the information of the current transaction they manage from the DDL transaction chain.

[0064] S206. Determine the node startup time based on the node information.

[0065] The node startup time is determined by parsing the node information.

[0066] S207. Determine the first transaction information based on the current transaction information.

[0067] When obtaining current transaction information, this application can directly obtain all transaction information in the DDL transaction chain as current transaction information and determine the first transaction information from all transaction information; or, it can obtain only the first transaction information from the DDL transaction chain as current transaction information, in which case the current transaction information is the first transaction information.

[0068] S208. If the first transaction information exists and the transaction start time in the first transaction information is not greater than the node start time, determine the blocking information of the dictionary object corresponding to the access request, and determine the information to be fed back based on the blocking information of the dictionary object.

[0069] In this embodiment, the blocking information can be specifically understood as whether the dictionary object is blocked, and what type of blocking it is. It is determined whether the first transaction information exists. If it exists, the node startup time and the transaction startup time in the first transaction information are compared. The comparison method can be to convert the node startup time and the transaction startup time into binary numbers for comparison. If the transaction startup time in the first transaction information is not greater than the node startup time, that is, the transaction startup time in the first transaction information is earlier than the node startup time, then the target node has unfinished DDL transactions after startup. When the metadata node executes a DDL transaction, if a blocking occurs, it saves the blocking information of the dictionary object. Therefore, if the first transaction information exists and the transaction startup time in the first transaction information is not greater than the node startup time, the dictionary object requested by the access request is determined, and the pre-saved blocking information of the dictionary object is determined. The blocking information of the dictionary object is used to determine whether the dictionary object can be accessed, and the corresponding feedback information is determined.

[0070] As an optional embodiment of this example, this optional embodiment is further optimized by: generating the locking information of the dictionary object corresponding to the database object definition modification transaction when an exclusive lock is generated during the execution of the database object definition modification transaction.

[0071] When an exclusive lock is generated during the execution of any DDL transaction, the metadata node generates the lock information of the dictionary object corresponding to the DDL transaction. The lock information records that the dictionary object is currently under an exclusive lock, preventing other nodes from accessing it.

[0072] It is important to know that the locking information in this application can be stored through the locking module in the metadata node. When an exclusive lock is generated during the execution of a DDL transaction, in addition to performing a local lock and adding the locking information of the dictionary object to the locking module, the metadata node can also obtain the node information of nodes in normal state and broadcast the exclusive lock to nodes in normal state.

[0073] As an optional embodiment of this example, this optional embodiment further optimizes the determination of the feedback information based on the locking information of the dictionary object as follows:

[0074] B1. If the dictionary object's locking information contains an exclusive lock, the access request is determined to be an illegal request, and an access failure message is generated as feedback information.

[0075] In this embodiment, access failure information can be specifically understood as information used to indicate that the access request failed, such as error, access block waiting, etc. When there is an exclusive block in the block information of the dictionary object, it means that the exclusive block broadcast of the dictionary object was lost before the target node started, the access request of the target node is determined to be an illegal request, and access failure information is generated as feedback information according to the rules.

[0076] B2. If there is no exclusive lock in the locking information of the dictionary object, obtain the information of the dictionary object corresponding to the access request and send it back to the target node.

[0077] If there is no exclusive lock in the locking information of the dictionary object, the access request is a legitimate request. The metadata node determines the dictionary object corresponding to this access request, accesses the dictionary object, and obtains the corresponding information to be fed back to the target node.

[0078] S209. If there is no first transaction information or the transaction start time in the first transaction information is greater than the node start time, update the node status of the target node to normal status.

[0079] If there is no first transaction information or the transaction start time in the first transaction information is greater than the node start time, it means that all DDL transactions executed before the target node started have been completed. (At this time, the first transaction information is the latest DDL transaction information, and its transaction start time is later than the target node's node start time.) The node status of the target node will be updated to normal.

[0080] Even if the target node is in a faulty state after startup, when it sends an access request to the metadata node, the metadata node can determine whether there are still unfinished DDL transactions when the target node sends the access request based on the transaction startup time of the DDL transaction. After all the DDL transactions before the target node started have been completed, the node state of the target node is updated to a normal state, ensuring that the access request of the target node can also be processed normally.

[0081] S210. If the node status is normal, obtain the information of the corresponding dictionary object according to the access request and feed it back to the target node.

[0082] If the node status is normal and the access request is a valid request, the metadata node determines the dictionary object corresponding to this access request, accesses the dictionary object and obtains the corresponding information to send back to the target node.

[0083] This invention provides a node management method in a database system, solving the problem of time-consuming service provision after target node failure recovery. This application sets node states for target nodes and manages transaction information for all database object definition modification transactions through a database object definition modification transaction linked list. Node states are assessed; for target nodes in a faulty state, locking conflict checks are performed based on node startup time and transaction startup time, and access requests are processed accordingly to obtain pending feedback information. Target nodes can send access requests to metadata nodes at any time and provide services to users based on feedback information, without waiting for the metadata node to complete DDL transactions or synchronize locking information during the failure period before starting services. Target nodes can immediately send access requests to start services after failure recovery, saving time, avoiding prolonged waiting, and improving system efficiency. This application is simple and effective in handling locking issues after node failure recovery.

[0084] Example 3

[0085] Figure 3 This is a schematic diagram of the structure of a node management device in a database system according to Embodiment 3 of the present invention, applied to the metadata node of a distributed database system. Figure 3 As shown, the device includes: a node information acquisition module 31, a node status determination module 32, a transaction information acquisition module 33, and a first information feedback module 34.

[0086] The node information acquisition module 31 is used to acquire the node information of the target node when an access request for the target node is received.

[0087] The node status determination module 32 is used to determine the node status of the target node based on the node information.

[0088] The transaction information acquisition module 33 is used to acquire the current transaction information managed by the metadata node if the node status is a diseased state.

[0089] The first information feedback module 34 is used to process the access request based on the node information and the current transaction information, determine the information to be fed back, and feed back the information to be fed back to the target node.

[0090] This invention provides a node management device in a database system, solving the problem of time delay in providing normal service after a target node recovers from a fault. Upon receiving an access request from the target node, the device obtains the target node's node information, determines the node status based on the node information, and if the node status is faulty, obtains the current transaction information managed by the metadata node. The access request is processed based on the current transaction information and the node information to determine the corresponding feedback information and send it back to the target node. This application sets the node status of the target node and judges the node status. For target nodes in a faulty state, a blocking conflict check is performed using the node information and current transaction information, and then the access request is processed accordingly to obtain the feedback information. After recovering from a fault and starting up, the target node can send an access request to the metadata node at any time to obtain feedback information, without waiting for the metadata node to complete DDL transactions or synchronize the blocking information during the fault. The target node can immediately send an access request to obtain feedback information after recovering from a fault and starting up, saving time and improving system efficiency.

[0091] Optionally, the device may also include:

[0092] The node information generation module is used to generate node information of the target node after receiving the registration information sent by the target node.

[0093] The registration information is generated and sent by the target node after successful startup.

[0094] Optional, the node information generation module includes:

[0095] A time acquisition unit is used to acquire the current time and use the current time as the node startup time of the target node;

[0096] The status determination unit is used to obtain the first transaction information in the database object definition modification transaction chain. If there is no first transaction information, the node status of the target node is determined to be normal; otherwise, the node status of the target node is determined to be defective.

[0097] Optionally, the device may also include:

[0098] The transaction start time determination module is used to determine the transaction start time of the database object definition modification transaction when executing the database object definition modification transaction;

[0099] The linked list update module is used to generate transaction information based on the transaction start time of the database object definition modification transaction, and add the transaction information to the tail of the database object definition modification transaction linked list;

[0100] The transaction removal module is used to remove the transaction information corresponding to the database object definition modification transaction from the database object definition modification transaction linked list after the database object definition modification transaction has been executed.

[0101] Optionally, the first information feedback module 34 includes:

[0102] A node startup time determination unit is used to determine the node startup time based on the node information.

[0103] A transaction information determination unit is used to determine the first transaction information based on the current transaction information;

[0104] The feedback information determination unit is used to determine the blocking information of the dictionary object corresponding to the access request if the first transaction information exists and the transaction start time in the first transaction information is not greater than the node start time, and to determine the feedback information based on the blocking information of the dictionary object.

[0105] Optionally, the feedback information determination unit is specifically used for: if there is an exclusive block in the blocking information of the dictionary object, determining that the access request is an illegal request and generating access failure information as feedback information; if there is no exclusive block in the blocking information of the dictionary object, obtaining the information of the dictionary object corresponding to the access request and feeding it back to the target node.

[0106] Optionally, the device may also include:

[0107] The lock information generation module is used to generate lock information for the dictionary object corresponding to the database object definition modification transaction when an exclusive lock is generated during the execution of the database object definition modification transaction.

[0108] Optionally, the first information feedback module 34 also includes:

[0109] The status update determination unit is used to update the node status of the target node to normal status if there is no first transaction information or the transaction start time in the first transaction information is greater than the node start time.

[0110] Optionally, the device may also include:

[0111] The second information feedback module is used to obtain the information of the corresponding dictionary object according to the access request and feed it back to the target node if the node status is normal.

[0112] The node management device in the database system provided in the embodiments of the present invention can execute the node management method in the database system provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0113] Example 4

[0114] Figure 4 A schematic diagram of an electronic device 40, which can be used to implement embodiments of the present invention, is shown. The electronic device acts as a metadata node to execute the methods provided in this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0115] like Figure 4 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded into the RAM 43 from storage unit 48. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0116] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0117] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as node management methods in a database system.

[0118] In some embodiments, the node management method in the database system may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the node management method in the database system described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to execute the node management method in the database system by any other suitable means (e.g., by means of firmware).

[0119] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0120] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0121] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0123] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0124] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0125] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0126] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A node management method in a database system, characterized in that, Metadata nodes used in distributed database systems include: When an access request is received from the target node, the node information of the target node is obtained; The node status of the target node is determined based on the node information; If the node is in a diseased state, obtain the current transaction information managed by the metadata node; The access request is processed based on the node information and current transaction information to determine the information to be fed back, and the information to be fed back is fed back to the target node; The step of processing the access request based on the node information and current transaction information to determine the information to be fed back includes: The node startup time is determined based on the node information; Determine the first transaction information based on the current transaction information; If the first transaction information exists and the transaction start time in the first transaction information is not greater than the node start time, determine the blocking information of the dictionary object corresponding to the access request, and determine the information to be fed back based on the blocking information of the dictionary object; The step of determining the information to be fed back based on the locking information of the dictionary object includes: If the dictionary object contains an exclusive block, the access request is determined to be an illegal request, and an access failure message is generated as feedback information. If there is no exclusive lock in the locking information of the dictionary object, obtain the information of the dictionary object corresponding to the access request and feed it back to the target node.

2. The method according to claim 1, characterized in that, Before receiving the access request from the target node, it also includes: Upon receiving the registration information sent by the target node, the node information of the target node is generated; The registration information is generated and sent by the target node after successful startup.

3. The method according to claim 2, characterized in that, The node information includes node status and node startup time. The node information used to generate the target node includes: Obtain the current time and use the current time as the node startup time of the target node; Obtain the first transaction information in the database object definition modification transaction chain. If the first transaction information does not exist, determine that the node status of the target node is normal; otherwise, determine that the node status of the target node is defective.

4. The method according to claim 3, characterized in that, Also includes: When executing a database object definition modification transaction, determine the transaction start time of the database object definition modification transaction; Transaction information is generated based on the transaction start time of the modified transaction according to the database object definition, and the transaction information is added to the tail of the modified transaction linked list of the database object definition; Once the database object definition modification transaction is completed, the transaction information corresponding to the database object definition modification transaction is removed from the database object definition modification transaction linked list.

5. The method according to claim 1, characterized in that, Also includes: When an exclusive lock is generated during a database object definition modification transaction, the lock information of the dictionary object corresponding to the database object definition modification transaction is generated.

6. The method according to claim 1, characterized in that, Also includes: If there is no first transaction information or the transaction start time in the first transaction information is greater than the node start time, the node status of the target node will be updated to normal status.

7. The method according to any one of claims 1-6, characterized in that, Also includes: If the node is in a normal state, the information of the corresponding dictionary object is obtained according to the access request and fed back to the target node.

8. A node management device in a database system, characterized in that, Metadata nodes used in distributed database systems include: The node information acquisition module is used to acquire the node information of the target node when an access request for the target node is received. A node status determination module is used to determine the node status of the target node based on the node information. The transaction information acquisition module is used to acquire the current transaction information managed by the metadata node if the node status is a diseased state. The first information feedback module is used to process the access request based on the node information and the current transaction information, determine the information to be fed back, and feed back the information to be fed back to the target node; The first information feedback module includes: A node startup time determination unit is used to determine the node startup time based on the node information. A transaction information determination unit is used to determine the first transaction information based on the current transaction information; The feedback information determination unit is used to determine the blocking information of the dictionary object corresponding to the access request if the first transaction information exists and the transaction start time in the first transaction information is not greater than the node start time, and to determine the feedback information based on the blocking information of the dictionary object. The feedback information determination unit is specifically used for: if there is an exclusive block in the blocking information of the dictionary object, determining that the access request is an illegal request and generating access failure information as feedback information; if there is no exclusive block in the blocking information of the dictionary object, obtaining the information of the dictionary object corresponding to the access request and feeding it back to the target node.

9. An electronic device, characterized in that, The electronic device, as a metadata node, includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the node management method in the database system according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the node management method in the database system of any one of claims 1-7.

Citation Information

Patent Citations

  • Information protection method based on private block chain

    CN108390891A

  • Distributed stream processing

    US20160044074A1