Index Splitting in Distributed Databases

By adopting a two-stage index splitting process in a distributed database, the locking problem during index splitting is solved, correctness and consistency in a multi-copy environment are achieved, and expansion and performance optimization are simplified.

CN111213138BActive Publication Date: 2024-09-17NUODB INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201880056617.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-08-15
Filing Date
2018-08-15
Publication Date
2024-09-17
Estimated Expiration
2039-01-06

AI Technical Summary

Technical Problem

In a distributed database, inconsistency and waiting time increase due to locking the database when index splitting, and existing methods are difficult to maintain correctness and consistency in a multi-copy environment.

Method used

A two-stage index splitting process is adopted. In the first stage, the index atoms are split into source atoms and target atoms, and in the second stage, the message is refreshed and forwarded from the source atom to the target atom, ensuring that the distribution is not locked during the splitting process. Database to maintain correctness, concurrency and consistency across nodes.

Benefits of technology

Through the two-stage splitting process, the waiting time is reduced, the expansion of the distributed database is simplified, the performance bottleneck caused by locking is avoided, and the data integrity and consistency during index splitting are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111213138B_ABST
    Figure CN111213138B_ABST
Patent Text Reader

Abstract

In a distributed database, many nodes can store copies or instances of the same record. If the record is split on one node, the record should be split on other nodes to maintain the consistency, concurrency and correctness of the data in the distributed database. In some distributed databases, the record is locked during the update process to ensure data integrity. Unfortunately, locking the record may increase waiting time, especially for larger databases. However, if the record is not locked and the node fails when the record is split and updated at the same time, the split and update may not propagate throughout the distributed database, resulting in a loss of data integrity. Internally exchanging messages about the status of record splits and forwarding updates reduces the possibility of data integrity loss due to node failure.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of priority under 35 U.S.C. §119(e) to U.S. Application No. 62 / 545,791, filed on August 15, 2017, entitled “Index Splitting in Distributed Databases,” which is incorporated herein by reference in its entirety. Background Art

[0003] Databases are usually incorporated into indexes to enable efficient retrieval of certain information. The B-tree data structure is a popular index structure that is optimized for reading and writing in databases of large data blocks and enables efficient database searches. The B-tree data structure comprises a root and multiple leaves. The root identifies each leaf using different key values. Each leaf points to a record containing a key value. The key values ​​are classified to form a classified list. Specifically, a given leaf comprises a "left sibling" (the next leaf to the left) and a "right sibling" (the next leaf to the right) in a classified order. The first or leftmost leaf and the last or rightmost leaf comprise entries representing the end of the leaf list for the root.

[0004] Typically, each leaf has a fixed memory size. As more data is added to the database, the size of the leaf grows until a size threshold is reached, at which point the leaf splits into a new left and right leaf at a specific key value. With the root modified appropriately, the left leaf receives values ​​less than the key value and the right leaf receives the remaining value.

[0005] In a centrally located, non-shared database, the split process is efficient because there is typically only one copy of an index in the database system. Splitting tends to have the effect of stalling the data processing system during the actual split operation. In a distributed database with many copies of an index, each copy of the index should be split to maintain accuracy, completeness, and data integrity. Unfortunately, splitting multiple copies of the same index can cause race conditions that lead to incorrect or inconsistent splits.

[0006] To ensure consistency after a given index in a split node, some existing methods implement locks. Locks are applied to individual pages or records when an index is split. Locks prevent additional data from being added to or removed from the database until after the index has been split. However, locking the database during an index split is not a scalable approach. Locks may also increase the latency associated with adding information to the database. Summary of the invention

[0007] Embodiments of the present technology include a method for splitting a first index atom among a plurality of atoms in a distributed database. The distributed database includes a plurality of nodes. Each of the plurality of nodes includes a corresponding processor and a corresponding memory. One of the plurality of nodes is designated as a chairperson and includes a copy of the chairperson of the first index atom. An example method includes splitting the chairperson's copy of the first index atom by the chairperson. The chairperson's copy of the first index atom represents data and / or metadata stored in the distributed database. The chairperson transmits instructions for splitting corresponding copies of the first index atom to other nodes among the plurality of nodes. The corresponding copies of the first index atom in the other nodes are replicas of the chairperson's copy of the first index atom. A first node among the plurality of nodes splits a first copy of the first index atom into a first copy of a source atom and a first copy of a target atom. The first node transmits a confirmation indicating that the first copy of the first index atom has been split. The confirmation is transmitted to the chairperson and each other node among the plurality of nodes.

[0008] In some cases, the chairperson splits the first copy of the first index atom in response to a request from another node in the plurality of nodes. The method also includes forwarding, at the first node, a message from the first copy of the source atom to the first copy of the target atom. In some cases, transmitting the confirmation from the first node to the chairperson and each other node in the plurality of nodes can occur after the first copy of the source atom forwards the message to the first copy of the target atom.

[0009] Another embodiment includes a method for splitting an index atom among a plurality of atoms in a distributed database. Again, the distributed database includes a plurality of nodes, each of the plurality of nodes including a corresponding processor and a corresponding memory. One of the nodes is designated as a chairperson of the index atom and includes an instance of the chairperson of the index atom, the instance of the chairperson representing data and / or metadata stored in the distributed database. The method includes splitting the instance of the chairperson of the index atom by the chairperson. The chairperson transmits an instruction for splitting the index atom to at least one subset of nodes. Each node in the subset includes a corresponding instance of the index atom. The first node in the subset splits its (first) instance of the index atom into a first instance of a source atom and a first instance of a target atom. The first node also retransmits the instruction for splitting the index atom to each other node in the subset. Moreover, the first node transmits a confirmation indicating that the first instance of the index atom has been split to the chairperson. The chairperson transmits a message indicating that the index atom has been split to the subset of nodes.

[0010] Yet another embodiment includes a method for splitting an index atom among a plurality of atoms in a distributed database, the distributed database comprising a plurality of nodes, each of the plurality of nodes comprising a corresponding processor and a corresponding memory. In this method, one of the nodes splits a local instance of the index atom into a local instance of a source atom and a local instance of a target atom. The value of the local instance of the source atom is less than a split key value, and the value of the local instance of the target atom is greater than the split key value. The node receives a message about a key value greater than the split key value on the local instance of the source atom. Moreover, the node forwards the message from the local instance of the source atom to the local instance of the target atom.

[0011] It should be understood that all combinations of the above concepts and additional concepts discussed in more detail below (provided that such concepts are not mutually inconsistent) are considered as part of the inventive subject matter disclosed herein. In particular, all combinations of the claimed subject matter appearing at the end of this disclosure are considered as part of the inventive subject matter disclosed herein. It should also be understood that terms explicitly used herein that may also appear in any disclosure incorporated by reference should be given the meaning most consistent with the specific concepts disclosed herein.

[0012] Other systems, processes, and features will become apparent to one skilled in the art upon examination of the following drawings and detailed description. All such additional systems, processes, and features are intended to be included within this description, be within the scope of the invention, and be protected by the accompanying claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Those skilled in the art will appreciate that the drawings are primarily for illustrative purposes and are not intended to limit the scope of the inventive subject matter described herein. The drawings are not necessarily drawn to scale; in some cases, various aspects of the inventive subject matter disclosed herein may be exaggerated or enlarged in the drawings to facilitate understanding of different features. In the drawings, like reference numerals generally refer to like features (e.g., functionally similar and / or structurally similar elements).

[0014] Figure 1 It is a schematic form of an elastic, scalable, on-demand distributed database.

[0015] Figure 2 Shows Figure 1 The representative transaction node of the distributed database.

[0016] Figure 3A and 3B Depicted by Figure 2 The local organization of atomic objects generated by the atomic class in the transaction node.

[0017] Figure 4 An index atom that can be split is shown.

[0018] Figure 5 Example asynchronous messages passed between a transaction node and an archive node are shown.

[0019] Figure 6 Shown how splitting atoms in a distributed database can lead to incorrect data retrieval.

[0020] Fig. 7A A prior art process for splitting index atoms in a distributed database is shown.

[0021] Figure 7B The process of splitting index atoms while maintaining correctness and consistency throughout a distributed database is shown.

[0022] Figure 7C An alternative process for splitting index atoms while maintaining correctness and consistency throughout a distributed database is shown. DETAILED DESCRIPTION

[0023] The embodiments described herein relate generally to distributed databases, and more specifically to splitting indexes in a distributed database. The systems and processes disclosed herein use a two-phase index splitting process to solve problems associated with maintaining correctness when splitting multiple copies of the same index in a distributed database without locking the distributed database during the splitting process. During the first phase of the index splitting process, a node in a distributed database having an index atom splits the index atom into a source atom and a target atom. Also, during the second phase of the index splitting process, the node having the index refreshes messages forwarded from the source atom to the target atom. This two-phase splitting process makes it easier to maintain correctness, concurrency, and consistency across a distributed database if data is inserted while the index atom is being split.

[0024] Distributed Database

[0025] Figure 1 An elastic, scalable, on-demand distributed database 30 is depicted that uses a two-phase index splitting process to facilitate and ensure correctness when splitting an index. The distributed database 30 contains multiple nodes of different types: nodes N1 to N6 are transaction nodes that provide user access to the database; nodes A1 and A2 are archive nodes that act as storage managers and are used to maintain a disk archive of the entire database at each archive node. While archive nodes typically store a copy of the entire database, each transaction node can only contain a portion of the database used to support the transactions executed at that transaction node at that time.

[0026] Figure 1 Each node in the distributed database 30 can communicate directly with each other node in the distributed database 30 through the database communication network 31. For example, node N1 can establish a communication path with each node in nodes N2 to N6, A1 and A2. The communication between any two nodes is carried out by serialized messages. In one embodiment, message transmission is performed asynchronously to perform various operations in a timely and rapid manner. Typically, the database communication network 31 is operated with a combination of high-bandwidth, low-latency paths (e.g., Ethernet) and high-bandwidth, high-latency paths (e.g., wide area network (WAN)). Each node can use a low-latency path for time-critical communication (e.g., obtaining records in response to queries), and uses a high-latency path for non-critical communication (e.g., requests for updating the information of a table). The data communication network 31 uses a message passing protocol, such as a transmission control protocol (TCP), and ensures that the order in which each node processes messages is the same as the order in which the messages are transmitted.

[0027] Transaction Node

[0028] Figure 2 Depicted Figure 1 30. The transaction node 32 is linked to other nodes (not shown) via a database communication network 31 and various end users 33. The transaction node 32 includes a processor 34 that communicates with the database communication network 31 via a network interface 35 and with various users via a user network interface 37. The processor 34 also interacts with a non-volatile memory 38, such as a random access memory (RAM), which contains a copy of a database management program that implements distributed database operations and index splitting disclosed in more detail below. This program is used to provide a remote interface 40, a database request engine 41, and a class or object set 42. The database request engine 41 resides on the transaction node and is an interface between high-level input and output commands at the user level and system-level input and output commands at the system level. In general, the database request engine 41 parses, compiles, and optimizes user queries, such as structured query language (SQL) queries, into commands interpreted by various classes or objects in the set 42.

[0029] At any given time, transaction node 32 contains only those portions of the database that are then relevant to the user applications active on transaction node 32. In addition, the portion of the distributed database in use at a given time at transaction node 32 resides in memory 38. During operation of this system, no supplemental storage, such as disk storage, is required at transaction node 32.

[0030] atom

[0031] In this system, the class / object set 42 is divided into an atomic class subset 43, a message class subset 44, and a helper class subset 45. Figure 2 Each atom class 43 in generates atoms. More specifically, each atom class 43 defines one or more atom types or atom objects. Each atom type or atom object generates atoms. Each atom contains a specific piece of information stored in the distributed database. Some atoms contain part of the database metadata; other atoms contain data records; and still other atoms act as directories for creating and tracking other atom types. Some atom types can instantiate only one atom that is replicated to all nodes. Other atom types can instantiate multiple atoms that are replicated to nodes on demand.

[0032] Figure 3A and 3B The different types of atoms and how they interact with each other are shown. Figure 3A In the main directory, Atom 70 tracks Figure 1 The status of transaction nodes and archive nodes in the distributed database 30 of FIG. The master directory atom 70 can be considered as creating and monitoring the set of transaction manager atoms 71, database atoms 72, schema atoms 73, table atoms 74, and table directory atoms 75 and the active index of the sequence ID manager 82. The table directory atom 75 acts as an active index for creating and monitoring index atoms 76, record status atoms 77, data atoms 78, blob status atoms 80, and blob atoms 81 associated with a single table. Each table has one table directory atom 75.

[0033] Figure 3B Can be used to understand the interaction and management of different atom types. In this context, neither the master directory atom 70 nor the table directory atom 75 performs any management function. The database atom 72 manages each schema atom 73. Each schema atom 73 manages each related table atom 74 and sequence ID manager atom 82. Each table atom 74 manages its corresponding table directory atom 75, index atom 76, record status atom 77, data atom 78, blob status atom 80 and blob atom 81. The database request engine 41 communicates with the master directory atom 70, the transaction manager atom 71, the database atom 72, each schema atom 73, each table atom 74 and the sequence ID manager 82 in response to user queries.

[0034] Figure 4 The index atom 76 is depicted in more detail. The index atom 76 is implemented as a B-tree index with elements 76A-76K and can be split as described in more detail below. Element 76A is the unique identifier of the index atom 76. Pointers 76B and 76C identify the home directory atom and the create directory atom, respectively. Element 76D points to the node where the chairman of the atom resides. (Each atom has a chairman that performs the functions described below.)

[0035] Each time a copy of an atom is changed in any transaction node, the copy of the atom receives a new change number. Element 76E records the change number. Whenever a node requests an atom from another node, there is an interval during which the requesting node may not be known to other transaction nodes. Element 76F is a list of all nodes to which the supply node relays messages containing the atom until the request is completed.

[0036] The operation of the database system is also divided into cycles. Cycle reference element 76G provides the cycle number of the last access to the atom. Element 76H is a list of all active nodes containing atoms. Element 76I contains several status indicators. Element 76J contains a binary tree of index nodes to provide a conventional indexing function. Element 76K contains an index level.

[0037] President

[0038] When a transaction node in a distributed database creates a new atom, the transaction node is designated as the chairperson of the new atom. Each atom can have a different chairperson, and a given node can be the chairperson of more than one atom. As the chairperson of the new atom, the transaction node establishes and maintains an ordered list of other nodes in the distributed database that have copies of the new atom. The order of this list is as follows: first the chairperson, then any transaction nodes that have the new atom, and then any archive nodes that have the new atom.

[0039] When a transaction node creates a new atom, the new atom is the first and only entry in the ordered list. As other nodes obtain copies of the new atom, the copies are added to the ordered list. Each transaction node that has a copy of the new atom also keeps a copy of the ordered list. If the chairperson becomes inactive for any reason, the next transaction node on the ordered list becomes the chairperson. If there are no transaction nodes on the ordered list, the first asynchronous archive node becomes the chairperson.

[0040] Messaging between nodes

[0041] Nodes communicate atoms and information about atoms through asynchronous message exchange to maintain the distributed database in a consistent and concurrent state. As described above, each node in the distributed database can communicate with each other node in the distributed database. When a node generates a message related to a specific atom, the node can transmit or broadcast the message to other nodes with replicas of the specific atom. Each node generates these messages independently of other nodes. It is possible that at any given moment, multiple nodes may contain copies of a given atom, and different nodes may be in different stages of processing it.

[0042] Figure 5 Depicts the basic syntax of a typical serialized message 90 that is transmitted asynchronously between any two nodes using TCP or another protocol with control to maintain the message passing sequence. The message 90 contains a variable length header 91 and a variable length body 92. The header 91 contains a message identifier code 93 that specifies the message and its function. The header 91 also contains an identification 94 of the software version that created the message, so that different nodes can run with different software versions. The remaining elements in the header contain the local identification 95 of the sender and information 96 of the message destination and an atom identification 97. Based on this information, the receiving node can deserialize, decode, and process the message.

[0043] Data Integrity During Index Splits

[0044] As mentioned above, distributed databases suffer from data integrity issues that do not affect other types of databases. Many of these data integrity issues arise from the desire to maintain consistency across nodes that contain instances (copies) of a given atom (piece of data or metadata). If the data is inconsistent across all nodes, two nodes may supply different answers to the same query.

[0045] When an atom is split, a node typically rebroadcasts messages about the split to other nodes in the database. Unfortunately, rebroadcasting can lead to a variety of scenarios that cause short-lived consistency conflicts. If the chairman fails during the split, those inconsistencies may become permanent or at least last until the atoms with incorrect data are discarded. These problems include incorrect references to target atoms on nodes that have not yet split their indexed atoms. This can cause consistency problems or crashes. If the reference to the target atom is never updated, the distributed database may enter an infinite loop in the reverse scan (while holding the loop lock). In addition, when obtaining objects from a node before the node has been split, the split message may be missed, and the node that initiated the split fails before sending any final messages about the split.

[0046] Figure 6 6 is a timing diagram illustrating how splitting an index atom in a distributed database using rebroadcast may result in a loss of data integrity in the distributed database. The timing diagram illustrates an index split between three nodes in a distributed database: an inserter node 610, a splitter node 620 (e.g., a root chair), and a reader node 630. In this example, the inserter node 610 and the splitter node 620 each contain an instance of the same index atom. The source node 610 receives a new value for insertion into the index atom. In response, the source node transmits an insert message 601 to the splitter node 620. This insert message 601 instructs the splitter node 620 to split its instance of the index atom by a split key value (or simply key value).

[0047] The splitter node 620 responds to the insert message 601 by splitting the index atom into a source atom and a target atom, wherein the entry is equal to or less than the split key value in the source atom, and the entry is greater than the split key value in the target atom. The splitter node 620 also rebroadcasts the insert message (at 602) to the reader node 630, which responds to the rebroadcast by updating its instance of the root atom that references the index atom to indicate that the index atom has been split. However, if the reader node 630 receives a commit transaction message 603 before it receives the rebroadcast 602, the reader node may retrieve information that may be incorrect in response to the time period 604 between the arrival of the rebroadcast 602 and the commit transaction message 603. Moreover, if the splitter node 620 fails before sending the rebroadcast 602, the reader node 630 may never learn of the split, thereby making the distributed database inconsistent and possibly incorrect.

[0048] Maintaining Correctness During Index Splits

[0049] Fig. 7A A prior art process 700 for mitigating failures during index splitting is shown. The process 700 begins when the root chair 710 of an index atom determines that an index atom should be split, for example in response to a request from another node or a request to insert a value into the chair's instance of the index atom. The root chair splits its instance of the index atom and sends a "split" message 701 to other nodes that have instances of the index atom - here archive (storage manager (SM)) nodes 720 and transactions (transaction engines (TE)) 730. These nodes split their instances of the index atom and then send corresponding "split applied" messages 702 to the root chair 710. Once the root chair 710 has received the "split applied" message from each node in the distributed database if the instance of the index atom is being split, the root chair sends a "split done" message 703 to the nodes affected by the split.

[0050] although Fig. 7A In the process 700 Figure 6The split index atoms shown in solves the problem, but the process may suffer from crashes during failover and never-ending or incomplete splits. Crashes during failover may occur if the chair fails and the new (replacement) chair loses one or more atoms created during the split process. Incomplete splits may occur if a transaction node hijacks the chair node from an archive node. This may occur if an archive node becomes chair after the original chair fails and the new transaction node obtains a copy of the split index atoms before the split is complete. The new transaction node expects to receive messages related to index atoms, but the archive node does not send the messages because the addition of the new transaction node does not trigger the transmission of the messages. Therefore, the split never ends.

[0051] Other potential problems associated with the prior art process 700 include "chair pile-up" and difficulty with exhaustive testing. Chair pile-up occurs in the prior art process 700 because the root chair of the index atom coordinates the processing of the split. Thus, the root chair becomes the chair for the new atoms created during the split; in other words, the new atoms "pile up" on the root chair, making the distributed database more vulnerable to attack in the event of a root chair failure.

[0052] Exhaustive testing becomes difficult when considering the state machine at a given node and the events that move this state machine between states. For exhaustive testing, every valid state / event pair should be verified. Since a given state consists of four atoms (each atom itself in several states), the number of unit tests for exhaustive testing becomes too high.

[0053] Exhaustive testing of a particular system typically involves generating a set of valid state / event pairs, and then generating a test for each pair. To illustrate, consider a system that can have two states, A and B, and two possible events, X and Y. This gives four state / event pairs—in this article, AX, AY, BX, and BY—each of which should be tested. The number of tests is the Cartesian product of events and states.

[0054] In the example distributed database, the state of the system is defined by the states of related atoms. Fig. 7A In process 700 of , the splitting operates on four atoms at a time, so the number of possible states is the Cartesian product of the states of the four atoms, which yields approximately 1300 tests, taking into account the number of possible events. Figure 7B Splitting the process in four atoms reduces the number of valid and relevant state / event pairs to about 130, which is more convenient for tractable testing than 1300.

[0055] Figure 7BA process 740 for splitting an index atom whose copies are stored in several nodes in a distributed database is shown, which solves both Figure 6 The basic problem shown in Fig. 7A In this case, the nodes with instances of index atoms include the chairman 711, the archive node 720, and the first transaction node 730a. Fig. 7A Unlike the root chairperson 710 in the embodiment, the chairperson 711 need not be the chairperson of the root atom associated with the split index atom. Instead, the chairperson may be the chairperson of the split index atom. The distributed database also includes nodes that do not have instances of index atoms, such as the second transaction node 730b. Each of these nodes may be implemented as a processor that executes computer instructions stored in a non-volatile memory and may be used in conjunction with other nodes.

[0056] In the first stage of process 750, the node splits the index atom into a source index atom or source and a target index atom or target. The process begins when the chair 711 of the index atom determines that the index atom should be split, for example in response to an attempt to insert a value into an instance of its index atom. If the chair 711 determines that the index atom should be split, the chair selects a key value for the split. This key value indicates which records will be retained in the original source index atom and which records will be passed to the new target index atom created by the split.

[0057] The chairman 711 splits its copy of the index atom by key value to create its own copy of the source index atom and the target index atom. The chairman also broadcasts an "execute split" message 741 to other nodes 720, 730a in the distributed database that have instances of the index atom. In response to receiving the "execute split" message 741 from the chairman, each of these other nodes 720, 730a splits its own copy of the index atom by key value to create its own copy of the source index atom and the target index atom. Unlike other index splitting processes, each of these nodes also retransmits the "execute split" message 742 to other nodes with index atoms, including the chairman 711. Once the other nodes 720, 730a have received the "execute split" message 742 from each possible source and have split their own instances of the index atom, the other nodes will transmit the "split application" 743 to the chairman 711. The chairman 711 then broadcasts a "split complete" message 744 to the nodes 720, 730a that have the split index atom and other nodes affected by the split, including the node with the root atom pointing to the split index atom (e.g., transaction node 730b). This completes Figure 7B The index splitting process 740 in.

[0058] As explained below, the source index atom forwards messages to the target index atom during part of the split process 740. To ensure that these messages are forwarded correctly, each node (including the chair 711) that contains a copy of the index atom tracks the progress of the index split using its ordered list of all nodes that contain a copy of the index atom in the distributed database. This is another difference from previous index split processes.

[0059] Figure 7C An alternative process 750 for splitting index atoms is shown. In this process, the chairman 711 splits its copy of the index atom by key value to create its own copy of the source index atom and the target index atom. The chairman also broadcasts a "perform split" message 751 to other nodes 720, 730a in the distributed database that have instances of the index atom. In response to receiving the "perform split" message 751 from the chairman 711, each of these other nodes 720, 730a splits its own copy of the index atom by key value to create its own copy of the source index atom and the target index atom. Unlike other index splitting processes, each non-chairman sends a "split apply" message 752 to each other node that has a copy of the index atom.

[0060] Nodes track the progress of index splitting, as shown below. Once each node has received the "split apply" message 752 from each other node on the ordered list, each node transmits the "split applied all" message 753 to the chairman 711 and other nodes with the split index atom. This indicates that each copy of the index atom has been split into a source and a target. Then, the nodes exchange "split apply confirm" messages 754 that confirm the "split apply" message 753. Once the chairman 711 has received the "split apply confirm" message 754 from the affected node, the chairman will broadcast a "split complete" message 755, and the affected node responds to the "split complete" message with a "split complete confirm" message 756.

[0061] Again, the source index atom is combined as above Figure 7B The message is forwarded to the target index atom during a portion of the split process 750 explained below. Moreover, as described above, in yet another difference from the previous index split process, by waiting to receive the "split apply all" message from all other nodes, the chairman 711 waits until all messages are forwarded from the source to the target as described below. The chairman then broadcasts the "split end" message 757 to all affected nodes. All nodes with source and target atoms replace the outdated references to the original index atom in their copies of the root atom with references to the new source. This completes the index split process 700.

[0062] Message forwarding during index split

[0063] As described above, the distributed database is not locked during the index split process 740 or 750. Therefore, information can be added to the index atom as it is split, and a new copy of the index atom can be created during the split. This reduces waiting time and makes the expansion of the distributed database simpler and easier.

[0064] In order to maintain correctness and data integrity during the index split process, nodes forward messages received during certain periods of the index split process. More specifically, nodes forward messages that were broadcast on the source atom but should be applied to the target atom. These messages are Figure 7B and 7C Once the first node receives the SplitIndexOnKey message 741 / 751 from the second node, the first node should not receive the message that needs to be forwarded from the second node. Only when the node knows that the message that should be forwarded should not exist, can the node complete the split and stop forwarding the message.

[0065] Forwarding occurs as follows. If a node receives a message addressed to an index atom after its copy of the index atom has been split into a source and a target, the node directs the message to the source. If the key value of the message's destination is equal to or less than the split key value, the source acts on the message. Furthermore, if the key value of the message's destination is greater than the split key value, the source forwards the message to the target (if the target exists on this node), which acts on the message. The target atom cannot exist on a node without the source atom, so forwarding from a source atom to a target atom is a node-local operation.

[0066] Message forwarding ensures that messages destined for a target actually reach the target. This takes into account the possibility that a split index may occur in all nodes at the same time, or in some nodes at the same time and in other nodes at different times, or in each node that has a copy of the index atom at different times. Message forwarding continues until the node is Figure 7B and 7C The process 740 and 750 shown in FIG. 10A and 10B are repeated until a "split apply all" message is received from each other node. At this point, the chairman inserts a reference to the target into the root atom corresponding to the split index atom as explained above. Thus, message forwarding is no longer required, and messages for the target are addressed to the target, rather than being addressed to the source and forwarded by the source to the target.

[0067] In other words, the index splitting process 700 is considered complete when: 1) each node containing the index atom has been split into source and target; 2) each node confirms that it no longer accepts message forwarding; and 3) the root is modified to include a reference to the target. That is, the index splitting process 750 ends when each node has obtained a "split apply all" message from each other node and a "split complete" message from the chairman and determines that the source and target no longer need message forwarding.

[0068] Advantages of two-stage index splitting

[0069] The previous process of splitting index atoms does not include Figure 7B The "split" message is broadcasted from the non-chairman node to other (non-chairman) nodes as in process 740 of Figure 7C The "Split Application" message is sent to the non-chairman node, the "Split Application" message is tracked, or the "Split Application All" message is transmitted to the chairman as in process 750. Therefore, the previous process may be more Figure 7B and 7C The processes 740 and 750 shown in FIG. 7 are faster and consume less bandwidth. This is because these processes involve exchanging messages between all nodes, rather than just exchanging messages between each non-chairman node and the chairman (for N nodes). 2 messages to be sorted relative to sorting N messages for the previous index split process). However, unlike the previous index split process, exchanging these additional messages maintains the correctness and integrity of the distributed database even in the face of node failures.

[0070] in conclusion

[0071] Although embodiments of the present invention have been described and shown herein, it will be readily apparent to those of ordinary skill in the art that various other devices and / or structures for performing the functions described herein and / or obtaining these results and / or one or more of these advantages will be contemplated, and each of such variations and / or modifications is considered to be within the scope of the embodiments of the present invention described herein. More generally, it will be readily apparent to those of skill in the art that all parameters, dimensions, materials, and configurations described herein are meant to be exemplary, and that actual parameters, dimensions, materials, and / or configurations will depend on one or more specific applications for which the present invention is taught. Using only routine experiments, those of skill in the art will recognize or be able to determine many equivalents of the specific embodiments of the present invention described herein. Therefore, it should be understood that the foregoing embodiments are introduced only by way of example, and within the scope of the appended claims and their equivalents, embodiments of the present invention may be practiced in a manner different from that specifically described and required. Embodiments of the invention disclosed herein relate to each individual feature, system, article, material, kit, and / or method described herein. In addition, any combination of two or more such features, systems, articles, materials, kits and / or methods is included within the inventive scope of the present disclosure if such features, systems, articles, materials, kits and / or methods are not mutually inconsistent.

[0072] The above embodiments may be implemented in any number of ways. For example, hardware, software, or a combination thereof may be used to implement these embodiments. When implemented in software, the software code may be executed on any suitable processor or processor set, whether the processor or processor set is set in a single computer or distributed in multiple computers.

[0073] Further, it should be understood that the computer may be embodied in any of a variety of forms, such as a rack-mounted computer, a desktop computer, a laptop computer, or a tablet computer. In addition, the computer may be embedded in a device that is not generally considered a computer but has suitable processing capabilities, including a personal digital assistant (PDA), a smart phone, or any other suitable portable or fixed electronic device.

[0074] In addition, the computer may have one or more input and output devices. Among other uses, these devices may be used to present a user interface. Examples of output devices that may be used to provide a user interface include a printer or display screen for visually presenting the output, and a speaker or other sound generating device for auditorily presenting the output. Examples of input devices that may be used for a user interface include a keyboard and a pointing device, such as a mouse, a touch pad, and a digitizing tablet. As another example, a computer may receive input information through speech recognition or in other audible formats.

[0075] Such computers may be interconnected in any suitable form via one or more networks, including local or wide area networks, such as enterprise networks and intelligent networks (IN) or the Internet. Such networks may be based on any suitable technology and may operate according to any suitable protocol, and may include wireless, wired or fiber optic networks.

[0076] The various methods or processes outlined herein may be encoded as software that can be executed on one or more processors using any of a variety of operating systems or platforms. In addition, such software may be written using any of a number of appropriate programming languages ​​and / or programming or scripting tools, and may also be compiled into executable machine language code or intermediate code that is executed on a framework or virtual machine.

[0077] In addition, various inventive concepts may be embodied in one or more methods for which examples have been provided. The actions performed as part of the methods may be ordered in any suitable manner. Thus, embodiments may be constructed in which the actions are performed in an order different from that shown, which may include performing some actions simultaneously, even if the actions are shown as sequential actions in the illustrative embodiments.

[0078] All publications, patent applications, patents, and other references mentioned herein are incorporated by reference in their entirety.

[0079] All definitions, as defined and used herein, should be understood to control over dictionary definitions, definitions in documents incorporated by reference, and / or ordinary meanings of the defined terms.

[0080] As used herein in the specification, the indefinite articles “a” and “an” should be understood to mean “at least one” unless explicitly indicated otherwise.

[0081] As used herein in the specification and claims, the phrase "and / or" should be understood to refer to "either one or both" of the elements so united, i.e., the elements exist together in some cases and separately in other cases. Multiple elements listed with "and / or" should be interpreted in the same manner, i.e., "one or more" of the elements so united. In addition to the elements specifically identified with the "and / or" phrase, other elements may optionally be present, whether related or unrelated to those specifically identified. Therefore, as a non-limiting example, when used in conjunction with open language (such as "including"), reference to "A and / or B" may refer to only A (optionally including elements other than B) in one embodiment; only B (optionally including elements other than A) in another embodiment; both A and B (optionally including other elements) in yet another embodiment; etc.

[0082] As used herein in this specification and claims, "or" should be understood to have the same meaning as "and / or" as defined above. For example, when separating the items in a list, "or" or "and / or" should be interpreted as inclusive, that is, including at least one element in a plurality of elements or a list of elements, but also including more than one element, and optionally other unlisted items. Only when the opposite terms are clearly indicated, such as "only one of ..." or "exactly one of ..." or "consisting of ..." when used in the claims, will refer to containing exactly one element in a plurality of elements or a list of elements. In general, when there are exclusive terms before, such as "any one", "one of ...", "only one of ..." or "exactly one of ...", the term "or" used herein should only be interpreted as indicating exclusive alternatives (i.e., "one or the other, not two"). When used in the claims, "consisting essentially of ..." should have the common meaning as used in the field of patent law.

[0083] As used in this specification and claims, the phrase "at least one" with respect to a list of one or more elements should be understood to refer to at least one element selected from any one or more elements in the list of elements, but not necessarily including at least one of each element specifically listed in the list of elements, and not excluding any combination of elements in the list of elements. This definition also allows that elements other than the elements specifically identified in the list of elements referred to by the phrase "at least one" may optionally be present, whether or not related to those elements specifically identified. Thus, as a non-limiting example, "at least one of A and B" (or equivalently "at least one of A or B" or equivalently "at least one of A and / or B") may refer to at least one, optionally including more than one A, without B (and optionally including elements other than B) in one embodiment; may refer to at least one, optionally including more than one B, without A (and optionally including elements other than A) in another embodiment; may refer to at least one, optionally including more than one A, and at least one, optionally including more than one B (and optionally including other elements) in yet another embodiment; etc.

[0084] In the claims and the above description, all transitional phrases, such as "includes," "comprising," "carrying," "having," "containing," "involving," "containing," "consisting of," etc., shall be understood as open-ended, i.e., including but not limited to. As provided in Section 2111.03 of the Patent Examination Manual of the United States Patent Office, only the transitional phrases "consisting of" and "consisting essentially of" shall be closed or semi-closed transitional phrases, respectively.

Claims

1. A method for splitting an index atom among a plurality of atoms in a distributed database, the distributed database comprising a plurality of nodes, each of the plurality of nodes comprising a corresponding processor and a corresponding memory, one of the plurality of nodes being designated as a chairperson of the index atom and comprising an instance of the chairperson of the index atom, the method include: Splitting, by the chairperson, the chairperson's instance of the index atom, the chairperson's instance of the index atom representing data and / or metadata stored in the distributed database; The chairman transmits an instruction for splitting the index atom to at least one subset of nodes among the plurality of nodes, each node in the at least one subset of nodes including a corresponding instance of the index atom; Splitting, by each node in the at least one subset of nodes, a corresponding instance of the index atom into a corresponding instance of a source atom and a corresponding instance of a target atom; retransmitting, by each node, the instruction for splitting the index atom to each other node in the at least one node subset; transmitting, from each node in the at least one subset of nodes to the chairperson and each other node in the at least one subset of nodes, an acknowledgment indicating that the corresponding instance of the index atom has been split; as well as transmitting, from each node in the at least one subset of nodes to the chairperson and each other node in the at least one subset of nodes, a message indicating that a corresponding instance of the index atom in each node in the at least one subset of nodes has been split; transmitting, from the chairman to the at least one subset of nodes, a message indicating that the index atom has been split; transmitting, from each node in the at least one subset of nodes to the chairperson, an acknowledgment of a message indicating that the index atom has been split; transmitting a message from the chairman to the subset of nodes indicating that the splitting is complete; forwarding, at a first node in the at least one subset of nodes, a message from a first instance of the source atom to the first instance of the target atom; Wherein, after forwarding the message from the first instance of the source atom to the first instance of the target atom, the first node transmits the confirmation to the chairman and each other node of the plurality of nodes.

2. The method of claim 1, wherein splitting the chairman's instance of the index atom at the chairman occurs in response to a request to insert a new value into the chairman's instance of the index atom.

3. The method according to claim 1, further comprising: include: The instruction to split the index atom is received by each node in the at least one subset of nodes from each other node in the at least one subset of nodes.

4. The method of claim 3, wherein in response to receiving the instruction to split the index atom from each other node in the at least one subset of nodes, the first node transmits the confirmation to the chairman.

5. The method according to claim 1, further comprising: include: A message indicating that the index atom has been split is transmitted by the chairperson to another node of the plurality of nodes, the another node including a root atom including a reference to the index atom.

6. A distributed database, include: A plurality of nodes, each of the plurality of nodes comprises a corresponding processor and a corresponding memory, and the plurality of nodes comprises: a first node containing a first instance of an index atom representing data and / or metadata stored in the distributed database; a second node containing a second instance of the index atom; and a third node, the third node containing a third instance of the index atom, wherein the first node is configured to split the first instance of the index atom into a first instance of a source atom and a first instance of a target atom, and transmit an instruction for splitting the index atom to the second node and the third node, The second node is configured to retransmit the instruction for splitting the index atom to the third node, split the second instance of the index atom into a second instance of the source atom and a second instance of the target atom in response to the instruction for splitting the index atom, receive a message addressed to the second instance of the target atom on the second instance of the source atom and forward the message from the second instance of the source atom to the second instance of the target atom, and transmit a confirmation indicating that the second instance of the index atom has been split to the first node and the third node after the message is forwarded to the second instance of the target atom, and The third node is configured to retransmit the instruction for splitting the index atom to the second node, split the third instance of the index atom into a third instance of the source atom and a third instance of the target atom in response to the instruction for splitting the index atom, and transmit a confirmation indicating that the third instance of the index atom has been split to the first node and the second node.

7. A distributed database according to claim 6, wherein the first node is configured to send a message indicating that the index atom has been split to the second node in response to receiving the confirmation indicating that the second instance of the index atom has been split and receiving a confirmation from the third node indicating that the third instance of the index atom has been split, and the second node and the third node are configured to send a response to the first node confirming receipt of the message from the first node.

8. A method for splitting an index atom among a plurality of atoms in a distributed database, the distributed database comprising a plurality of nodes, the index atom representing data and / or metadata stored in the distributed database, each of the plurality of nodes comprising a corresponding processor and a corresponding memory, one of the plurality of nodes being designated as a chairperson of the index atom and comprising an instance of the chairperson of the index atom, the method include: Splitting, by the chair, the instance of the chair of the index atom into an instance of the chair of a source atom and an instance of the chair of a target atom, the value of the instance of the chair of the source atom being less than a split key value, and the value of the instance of the chair of the target atom being greater than the split key value; The chairman transmits an instruction for splitting the index atom with the split key value to at least one node subset of the plurality of nodes, each node in the at least one node subset containing a corresponding instance of the index atom; retransmitting, by a first node in at least one subset of nodes, the instruction for splitting the index atom to each other node in the at least one subset of nodes; Splitting, by a first node in the at least one node subset, a first instance of the index atom into a first instance of a source atom and a first instance of a target atom, a value of the first instance of the source atom being less than the split key value, and a value of the first instance of the target atom being greater than the split key value; receiving, by the first node, a first message on a first instance of the source atom regarding a key value greater than the split key value; forwarding, by the first node, the first message from the first instance of the source atom to a first instance of the target atom; transmitting, at the first node, an acknowledgement from the first node to the chair indicating that the first instance of the index atom has been split; as well as inserting a reference to the target atom in a root atom with respect to the index atom; transmitting, at each node in the at least one subset of nodes, a message from the chairperson to the at least one subset of nodes indicating that the index atom has been split; as well as A second message is received by the first node on the first instance of the target atom regarding the key value that is greater than the split key value.

9. The method according to claim 8, further comprising: Each node in the at least one node subset tracks the process of splitting the index atom by other nodes in the at least one node subset.

Citation Information

Patent Citations

  • Method and apparatus for a distributed file storage and indexing service

    CN101395602A

  • Table partitioning within distributed database systems

    US20160350392A1

  • Adaptive prefix tree based order partitioned data storage system

    US20170212680A1