INDEX SPLITTING IN DISTRIBUTED DATABASES

Information

  • Patent Application
  • 20200257667
  • Publication Number
    20200257667
  • Date Filed
    August 15, 2018
    6 years ago
  • Date Published
    August 13, 2020
    4 years ago
Abstract
In a distributed database, many nodes can store copies, or instances, of the same record. If the record is split on one node, it should be split on the other nodes to maintain consistency, concurrency, and correctness of the data in the distributed database. In some distributed databases, the records are locked during the update process to ensure data integrity. Unfortunately, locking the records can increase latency, especially for larger databases. But if the records aren't locked and a node fails as a record is being split and updated simultaneously, the split and update may not propagate throughout the distributed database, leading to a loss of data integrity. Exchanging messages about the status of record splitting and forwarding updates internally reduces the likelihood of a loss of data integrity due to a node failure.
Description
BACKGROUND

Databases typically incorporate indexes for enabling the efficient retrieval of certain information. A B-tree data structure is a popular indexing structure that is optimized for use in a database that reads and writes large blocks of data and that enables efficient database searching. A B-Tree data structure includes a root and a plurality of leaves. The root uses a different key value to identify each leaf. Each leaf points to the records that contain the key value. The key values are sorted in order to form a sorted list. Specifically, a given leaf includes a “left sibling” (the next leaf to the left) and a “right sibling” (the next left to right) in the sorted order. The first or left-most leaf and last or right-most leaf include entries denoting the ends of the list of leaves for that root.


Typically, each leaf has a fixed memory size. As more data is added to the database, the leaf grows in size until it reaches a size threshold, at which point the leaf is split into new left and right leaves at a particular key value. The left leaf receives values that are less than the key value and the right leaf receives the remaining values with appropriate modifications to the root.


In centrally based and non-shared databases, the splitting process is efficient because generally there is only one copy of the index in the database system. The split is easy to effect by quiescing the data processing system during the actual splitting operation. In a distributed database with many copies of the 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 a race condition that leads to an erroneous or inconsistent split.


In order to assure consistency following the split of a given index in a node, some existing approaches implement locks. A lock is applied to individual pages or records while the index is being split. The lock prevents additional data from being added or removed from the database until after the index has been split. However, locking a database during an index split is not a scalable approach. Locking can also increase the latency associated with adding information to the database.


SUMMARY

Embodiments of the present technology include methods of splitting a first index atom in a plurality of atoms in a distributed database. The distributed database includes a plurality of nodes. Each node in the plurality of nodes comprises a corresponding processor and a corresponding memory. One node in the plurality of nodes is designated as a chairman and includes a chairman's copy of the first index atom. An example method comprises splitting the chairman's copy of the first index atom by the chairman. The chairman's copy of the first index atom represents data and/or metadata stored in the distributed database. The chairman transmits instructions to split respective copies of the first index atom to the other nodes in the plurality of nodes. The respective copies of the first index atom in other nodes are replicas of the chairman's copy of the first index atom. A first node in 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 an acknowledgement indicating that the first copy of the first index atom has been split. The acknowledgement is transmitted to the chairman and to each other node in the plurality of nodes.


In some cases, the chairman 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 comprises forwarding a message from the first copy of the source atom to the first copy of the target atom at the first node. In some cases, transmitting the acknowledgement from the first node to the chairman and to 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.


Another embodiment includes a method of splitting an index atom in a plurality of atoms in a distributed database. Again, the distributed database includes a plurality of nodes, each of which comprises a corresponding processor and a corresponding memory. One of these nodes is designated as a chairman for the index atom and includes a chairman's instance of the index atom, which represents data and/or metadata stored in the distributed database. The method includes splitting, by the chairman, the chairman's instance of the index atom. The chairman transmits the instructions to split the index atom to at least a subset of the nodes. Each node in the subset includes a corresponding instance of the index atom. A 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 re-transmits the instructions to split the index atom to each other node in the subset. And the first node transmits, to the chairman, an acknowledgement indicating that the first instance of the index atom has been split. The chairman transmits a message indicating the index atom has been split to the subset of nodes.


Yet another embodiment includes a method of splitting an index atom in a plurality of atoms in a distributed database that includes a plurality of nodes, each of which comprises 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 local instance of the source atom includes values less than a split key value and the local instance of the target atom includes values greater than the split key value. The node receives a message referring to a key value greater than the split key value on the local instance of the source atom. And the node forwards the message from the local instance of the source atom to the local instance of the target atom.


It should be appreciated that all combinations of the foregoing concepts and additional concepts discussed in greater detail below (provided such concepts are not mutually inconsistent) are contemplated as being part of the inventive subject matter disclosed herein. In particular, all combinations of claimed subject matter appearing at the end of this disclosure are contemplated as being part of the inventive subject matter disclosed herein. It should also be appreciated that terminology explicitly employed herein that also may appear in any disclosure incorporated by reference should be accorded a meaning most consistent with the particular concepts disclosed herein.


Other systems, processes, and features will become apparent to those skilled in the art upon examination of the following drawings and detailed description. It is intended that all such additional systems, processes, and features be included within this description, be within the scope of the present invention, and be protected by the accompanying claims.





BRIEF DESCRIPTION OF THE DRAWINGS

The skilled artisan will understand that the drawings primarily are for illustrative purposes and are not intended to limit the scope of the inventive subject matter described herein. The drawings are not necessarily to scale; in some instances, various aspects of the inventive subject matter disclosed herein may be shown exaggerated or enlarged in the drawings to facilitate an understanding of different features. In the drawings, like reference characters generally refer to like features (e.g., functionally similar and/or structurally similar elements).



FIG. 1 is a schematic form of an elastic, scalable, on-demand distributed database.



FIG. 2 illustrates a representative transactional node of the distributed database of FIG. 1.



FIGS. 3A and 3B depict a local organization of atom objects generated by atom classes in the transactional node of FIG. 2.



FIG. 4 illustrates an index atom that can be split.



FIG. 5 illustrates an example asynchronous message that transfers between transactional and archival nodes.



FIG. 6 illustrates how splitting an atom in a distributed database can lead to retrieval of incorrect data.



FIG. 7A illustrates a prior process for splitting an index atom in a distributed database.



FIG. 7B illustrates a process for splitting an index atom while maintaining correctness and consistency throughout a distributed database.



FIG. 7C illustrates an alternative process for splitting an index atom while maintaining correctness and consistency throughout a distributed database.





DETAILED DESCRIPTION

Embodiments described herein generally relate to distributed databases and more particularly to splitting indexes in distributed databases. The systems and processes disclosed herein use a two-stage index splitting process to address problems associated with maintaining correctness while splitting many copies of the same index in a distributed database without locking the distributed database during the splitting process. During the first stage of the index splitting process, the nodes in the distributed database with the index atom split the index atom into a source atom and a target atom. And during the second stage of the index splitting process, the nodes with the index flush messages being forwarded from the source atom to the target atom. This two-stage splitting process makes it easier to maintain correctness, concurrency, and consistency across the distributed databased if data is being inserted while the index atom is being split.


Distributed Databases


FIG. 1 depicts an elastic, scalable, on-demand, distributed database 30 that a two-stage index splitting process to promote and ensure correctness when splitting indexes. The distributed database 30 includes multiple nodes of different types: nodes N1 through N6 are transactional nodes that provide user access to the database; nodes A1 and A2 are archival nodes that act as storage managers and function to maintain a disk archive of the entire database at each archival node. While an archival node normally stores a copy of the entire database, each transactional node can contain only that portion of the database used to support transactions being performed at that transactional node at that time.


Each node in FIG. 1 can communicate directly with each other node in the distributed database 30 through a database communications network 31. For example, node N1 can establish a communications path with each of nodes N2 through N6, A1 and A2. Communications between any two nodes is by way of serialized messages. In one embodiment, the messaging is performed in an asynchronous manner to perform various operations in a timely and prompt manner. Typically, the database communications network 31 operates with a combination of high-bandwidth, low-latency paths (e.g., an Ethernet network) and high-bandwidth, high-latency paths (e.g., a wide area network (WAN)). Each node can use a low-latency path for time-critical communications (e.g., fetching a record in response to a query) and a high-latency path for non-critical communications (e.g., a request to update information for a table). The data communications network 31 uses a messaging protocol, such as the Transmission Control Protocol (TCP), and assures that each node processes messages in the same sequence in which the messages were transmitted.


Transactional Nodes


FIG. 2 depicts a representative transactional node 32 in the distributed database 30 of FIG. 1. The transactional node 32 links to other nodes (not shown) via the database communications network 31 and various end users 33. The transactional node 32 includes a processor 34 that communicates with the database communications network 31 through a network interface 35 and with the various users through a user network interface 37. The processor 34 also interacts with a non-volatile memory 38, such as a random-access memory (RAM), that contains a copy of the database management program that implements the distributed database operations and index splitting disclosed in greater detail below. This program functions to provide a remote interface 40, a database request engine 41, and a set 42 of classes or objects. The database request engine 41 resides on transactional nodes and is the interface between the high-level input and output commands at the user level and system-level input and output commands at the system level. In general terms, the database request engine 41 parses, compiles, and optimizes user queries, such as structured query language (SQL) queries, into commands that are interpreted by the various classes or objects in the set 42.


At any given time, the transactional node 32 contains only those portions of the database that are then relevant to user applications active on the transactional node 32. Moreover, the portions of distributed database in use at a given time at the transactional node 32 reside in the memory 38. There is no need for supplementary storage, such as disk storage, at the transactional node 32 during the operation of this system.


Atoms

In this system, the classes/objects set 42 is divided into a subset 43 of atom classes, a subset 44 of message classes, and a subset 45 of helper classes. Each atom class 43 in FIG. 2 produces atoms. More specifically, each atom class 43 defines one or more atom types or atom objects. Each atom type or atom object produces an atom. Each atom contains a specific fragment of information stored in the distributed database. Some atoms contain a portion of the database metadata; others contain data records; still others serve as catalogs that create and track other atom types. Some atom types may only instantiate one atom which replicates to all nodes. Other atom types may instantiate multiple atoms which are replicated to nodes on an as-needed basis.



FIGS. 3A and 3B show different types of atoms and how the atoms interact with each other. In FIG. 3A, a Master Catalog atom 70 tracks the status of transactional and archival nodes in the distributed database 30 of FIG. 1. The Master Catalog atom 70 can be considered an active index that creates and monitors a Transaction Manager atom 71, Database atom 72, Schema atoms 73, sets of Table atoms 74 and Table Catalog atoms 75, and Sequence ID Managers 82. The Table Catalog atom 75 acts as an active index that creates and monitors Index atoms 76, Record States atoms 77, Data atoms 78, Blob States atoms 80 and Blob atoms 81 associated with a single table. There is one Table Catalog atom 75 for each table.



FIG. 3B is useful in understanding the interaction and management of different atom types. In this context, neither the Master Catalog atom 70 nor the Table Catalog atom 75 performs any management functions. 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 Catalog atom 75, Index atoms 76, Record States atoms 77, Data atoms 78, Blob States atom 80 and Blob atoms 81. The database request engine 41 communicates with the Master Catalog atom 70, Transaction Manager atom 71, Database atom 72, each Schema atom 73, each Table atom 74 and Sequence ID Managers 82 in response to user queries.



FIG. 4 depicts an index atom 76 in greater detail. The index atom 76 is implemented as a B-Tree index with elements 76A-76K and can be split as described in greater detail below. Element 76A is a unique identification for the index atom 76. Pointers 76B and 76C identify a master catalog atom and the creating catalog atom, respectively. Element 76D points to the node where the chairman for that atom resides. (Each atom has a chairman that performs functions as described below.)


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


Operations of the database system are also divided into cycles. A cycle reference element 76G provides the cycle number of the last access to the atom. Element 76H is a list of the all active nodes that contain the atom. Element 76I includes several status indicators. Element 76J contains a binary tree of index nodes to provide a conventional indexing function. Element 76K contains an index level.


Chairmen

When a transactional node in the distributed database creates a new atom, that transactional node is designated as the new atom's chairman. Each atom can have a different chairman, and a given node can be the chairman for more than one atom. As the new atom's chairman, the transactional node establishes and maintains an ordered list of other nodes in the distributed database with copies of the new atom. The order of this list is as follows: first the chairman, then any transactional nodes with the new atom, and then any archival nodes with new atom.


When the transactional node creates the new atom, it is the first and only entry in the ordered list. As other nodes obtain copies of the new atom, they are added to the ordered list. Each transactional node with a copy of the new atom also keeps a copy of the ordered list. If the chairman becomes inactive for any reason, the next transactional node on the ordered list becomes the chairman. If there are no transactional nodes on the ordered list, the first non-synchronizing archival node becomes the chairman.


Messaging Among Nodes

The nodes exchange transfer atoms and information about atoms via asynchronous messages to maintain the distributed database in a consistent and concurrent state. As mentioned above, each node in the distributed database can communicate with every other node in the distributed database. When one node generates a message involving a specific atom, it can transmit or broadcast that message to the other nodes with replicas of that specific atom. Each node generates these messages independently of other nodes. It is possible that, at any given instant, multiple nodes may contain copies of a given atom and different nodes may be at various stages of processing them.



FIG. 5 depicts the basic syntax of a typical serialized message 90 transmitted asynchronously between any two nodes using the TCP or another protocol with controls to maintain messaging sequences. The message 90 includes a variable-length header 91 and a variable-length body 92. The header 91 includes a message identifier code 93 that specifies the message and its function. The header 91 also includes identification 94 of the software version that created the message, enabling different nodes to operate with different software versions. The remaining elements in the header include a local identification 95 of the sender and information 96 for the destination of the message and atom identification 97. From this information, a recipient node can de-serialize, decode and process the message.


Data Integrity During Index Splitting

As mentioned above, distributed databases suffer from data integrity problems that don't affect other types of databases. Many of these data integrity problems arise from the desire to maintain consistency and across the nodes containing instances (copies) of a given atom (piece of data or metadata). If the data is not consistent across all nodes, then two nodes could supply different answers to the same query.


When the atom is split, the nodes conventionally rebroadcast messages about the split to other nodes in the database. Unfortunately, rebroadcasts can lead to multiple scenarios that result in transient consistency violations. If the chairman fails during the split, those inconsistencies could become permanent or at least persist until an atom with incorrect data is dropped. These problems include incorrect references to a target atom on a node that has yet to split its instance of the index atom. This can cause consistency problems or crashes. If the references to the target atom is never updated, the distributed database may enter an infinite loop in backward scan (while holding cycle lock). In addition, it is possible to miss a split message while fetching an object from a node before the node has split and the node originating the split fails before sending any final messages about the split.



FIG. 6 is a timing diagram that illustrates how using rebroadcasts to split an index atom in a distributed database can lead to a loss of data integrity in a distributed database. The timing diagram illustrates index splitting among three nodes in the distributed database: an inserter node 610, a splitter node 620 (e.g., a root chairman), and a reader node 630. In this example, the inserter node 610 and the splitter node 620 each include an instance of the same index atom. The source node 610 receives a new value for inserting into the index atom. In response, it transmits an insertion message 601 to the splitter node 620. This insertion message 601 instructs the splitter node 620 to split its instance of the index atom at a split key value, or key value for short.


The splitter node 620 responds to the insertion message 601 by splitting the index atom into a source atom and a target atom, with entries equal to or less than the split key value in the source atom and entries greater than the split key value in the target atom. The splitter node 620 also rebroadcasts (at 602) the insertion message to the reader node 630, which responds to the rebroadcast by updating its instance of a root atom that refers to the index atom to show that the index atom has been split. But if the reader node 630 receives a commit transaction message 603 before it receives the rebroadcast 602, it may retrieve potentially incorrect information in response for a period 604 between the arrival of the rebroadcast 602 and the commit transaction message 603. And if the splitter node 620 fails before sending the rebroadcast 602, the reader node 630 may never learn about the split, leaving the distributed databased inconsistent and possibly incorrect.


Maintaining Correctness During Index Splitting


FIG. 7A illustrates a prior process 700 for mitigating failures during index splitting. The process 700 starts when a root chairman 710 for an index atom determines that the index atom should be split, e.g., in response to a request from another node or a request to insert a value into the chairman's instance of the index atom. The root chairman splits its instance of the index atom and sends a “split” message 701 to other nodes with instances of the index atom—here, an archival (storage manager (SM)) node 720 and a transactional (transaction engine (TE)) 730. These nodes split their instances of the index atom, then send respective “split applied” messages 702 to the root chairman 710. Once the root chairman 710 has received a “split applied” message from each node in the distributed database with an instance of the index atom being split, it sends a “split done” message 703 to the nodes affected by the split.


Although the process 700 in FIG. 7A addresses the problems with splitting index atoms shown in FIG. 6, it can suffer from crashing during failover and a never-ending or unfinished split. Crashing during failover can occur if the chairman fails and the new (replacement) chairman is missing the atom(s) created during the splitting process. An unfinished split can occur if a transactional node hijacks chairmanship node from an archival node. This can occur if an archival node becomes chairman after the original chairman fails and a new transactional node fetches a copy of the index atom being split before the split is complete. The new transactional node expects to receive messages pertaining to the index atom, but the archival node does not send them because the addition of the new transactional node does not trigger their transmission. As a result, the split never finishes.


Other potential problems associated with the prior process 700 include “chairmanship pileup” and the difficulty of exhaustive testing. A chairmanship pileup occurs in the prior process 700 because the root chairman for the index atom orchestrates the split. As a result, the root chairman become the chairman for the new atoms created during split; in other words, the new atoms “pile up” on the root chairman, leaving the distributed database more vulnerable if the root chairman fails.


Exhaustive testing becomes difficult when considering a state machine on a given node and the events that move this state machine from state to state. For exhaustive testing, each valid state/event pair should be verified. Since a given state is composed of four atoms (each in several states itself), the number of unit tests for exhaustive testing becomes prohibitive.


Exhaustively testing a particular system typically involves generating a set of valid state/event pairs and then generating test for each pair. For illustration, consider a system that can have two states A and B and two possible events X and Y. This give four state/event pairs—here, AX, AY, BX and BY—each of which should be tested. The number of tests is the Cartesian product of events and states.


In an example distributed database, the state of the system is defined by the state of the relevant atoms. In the process 700 in FIG. 7A, the split operates on four atoms at once, so the number of possible states is a Cartesian product of states of four atoms, which yields about 1300 tests given the number of possible events. Splitting four atoms with the process in FIG. 7B reduces the number of valid and relevant state/event pairs to about 130, which more tractable for tractable testing than 1300.



FIG. 7B illustrates a process 740 for splitting an index atom, copies of which are stored in several nodes in a distributed database, that addresses both the fundamental problems illustrated in FIG. 6 and the shortcomings of the prior process 700 in FIG. 7A. In this case, the nodes with instances of the index atom include a chairman 711, an archival node 720, and a first transactional node 730a. Unlike the root chairman 710 in FIG. 7A, the chairman 711 doesn't have to be chairman of the root atom associated with the index atom being split. Instead, it can be chairman of the index atom being split. The distributed database also includes nodes without instances of the index atom, such as a second transactional node 730b. Each of these nodes can be implemented as a processor that executes computer instructions stored in a non-volatile memory and can be collocated with other nodes.


In the first stage of the process 750, the nodes split the index atom into a source index atom, or source, and a target index atom, or target. The process begins when the chairman 711 of the index atom determines that the index atom should be split, e.g., in response to an attempt to insert a value into its instance of the index atom. If the chairman 711 determines that the index atom should be split, it selects a key value for the split. This key value indicates which records will stay in the original source index atom and which records will be transferred to the new target index atom created by the split.


The chairman 711 splits its copy of the index atom at the key value to create its own copies of the source index atom and target index atom. It also broadcasts an “execute split” message 741 to the other nodes 720, 730a in the distributed database with 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 at the key value to create its own copies of the source index atom and target index atom. Unlike in other index splitting process, each of these nodes also re-transmits the “execute split” message 742 to the other nodes with the index atom, including the chairman 711. Once the other nodes 720, 730a have received “execute split” messages 742 from every possible source and have split their own instances of the index atom, they transmit a “split applied” 743 to the chairman 711. The chairman 711 then broadcasts a “split done” message 744 to the nodes 720, 730a with the split index atom and to other nodes affected by the split, including nodes with root atoms that point to the split index atom (e.g., transactional node 730b). This completes the index splitting process 740 in FIG. 7B.


As explained below, the source index atoms forward messages to the target index atoms during a portion of the splitting process 740. To ensure that these messages are forwarded correctly, each node containing a copy of the index atom (including the chairman 711) tracks the index splitting progress using its ordered list of all of the nodes in the distributed database that contain a copy of the index atom. This is another difference from previous index splitting processes.



FIG. 7C illustrates an alternative process 750 for splitting an index atom. In this process, the chairman 711 splits its copy of the index atom at the key value to create its own copies of the source index atom and target index atom. It also broadcasts an “execute split” message 751 to the other nodes 720, 730a in the distributed database with instances of the index atom. In response to receiving the “execute split” message 751 from the chairman 711, each of these other nodes 720, 730a splits its own copy of the index atom at the key value to create its own copies of the source index atom and target index atom. Unlike in other index splitting process, each non-chairman sends a “split applied” message 752 to every other node with a copy of the index atom.


The nodes track the index splitting progress as follows. Once each node has received a “split applied” message 752 from each other node on the ordered list, it transmits a “split applied all” message 753 to the chairman 711 and the other nodes with split index atoms. This signifies that every copy of the index atom has been split into a source and a target. The nodes then exchange “split applied ack” message 754 acknowledging the “split applied” messages 753. Once the chairman 711 has receive a “split applied ack” message 754 from the affected nodes, it broadcasts a “split complete” message 755, to which the affected node responds with “split complete ack” messages 756.


Again, the source index atoms forward messages to the target index atoms during a portion of the splitting process 750 as explained above with respect to FIG. 7B and below. And as noted above, in yet another difference from previous index splitting processes, the chairman 711 waits until all messages are forwarded from the source to the target as described below, by waiting to receive “split applied all” messages from all other nodes. The chairman then broadcasts a “split done” message 757 to all of the affected nodes. All of the nodes with the source and target atoms replace outdated references to the original index atom in their copies of the root atom with references to the new source. This completes the index splitting process 700.


Message Forwarding During Index Splitting

As mentioned above, the distributed database is not locked during the index splitting processes 740 or 750. As a result, information can be added to the index atom while it is being split and new copies of the index atom can be created during the split. This reduces latency and makes it simpler and easier to scale the distributed database.


To maintain correctness and data integrity during the index splitting process, the nodes forward messages received during certain periods of the index splitting process. More specifically, a node forwards messages that are broadcast on the source atom but should be applied on the target atom. These messages are generated before TO in FIGS. 7B and 7C. Once a first node receives a SplitIndexOnKey message 741/751 from a second node, the first node should not receive messages that need to be forwarded from the second node. The nodes finish splitting and stop forwarding messages only when they know that messages that should be forwarded is not supposed to exist.


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


Message forwarding ensures that messages destined for the target actually reach the target. It accounts for the possibility that splitting the index could occur simultaneously in all the nodes, or simultaneously in some nodes and at a different time in other nodes, or at different times in each node that has a copy of the index atom. Message forwarding continues until the node receives a “split applied all” message from each other node in processes 740 and 750 shown in FIGS. 7B and 7C. At this point, the chairman inserts a reference to the target in the root atom corresponding to the split index atom as explained above. As a result, message forwarding is no longer necessary, and messages for the target are addressed to the target instead of being addressed to the source and forwarded by the source to the target.


In other words, the index splitting process 700 is considered to be complete when: 1) every node containing the index atom has been split into a source and a target; 2) every node acknowledges that it is no longer accepting message forwarding; and 3) the root is modified to include a reference to the target. That is, the index splitting process 750 ends when every node has obtained both “split applied all” messages from each other node and a “split done” message from the chairman and has determined that message forwarding is no longer necessary for the source and target.


Advantages of Two-Stage Index Splitting

Previous processes for splitting an index atom do not include broadcasting “split” messages from non-chairman nodes to other (non-chairman) nodes as in the process 740 of FIG. 7B, nor do they include sending “split applied” messages to non-chairman nodes, tracking “split applied” messages, or transmitting “split applied all” messages to the chairman as in the process 750 of FIG. 7C. As a result, they can be faster and consume less bandwidth than the processes 740 and 750 shown in FIGS. 7B and 7C, respectively. This is because these processes involve exchanging messages among all the nodes as opposed to just between each non-chairman node and the chairman (order N2 messages for N nodes versus order N messages for previous index splitting processes). But unlike previous index splitting processes, exchanging these extra messages maintains the correctness and integrity of the distributed database even in the event of a node failure.


CONCLUSION

While various inventive embodiments have been described and illustrated herein, those of ordinary skill in the art will readily envision a variety of other means and/or structures for performing the function and/or obtaining the results and/or one or more of the advantages described herein, and each of such variations and/or modifications is deemed to be within the scope of the inventive embodiments described herein. More generally, those skilled in the art will readily appreciate that all parameters, dimensions, materials, and configurations described herein are meant to be exemplary and that the actual parameters, dimensions, materials, and/or configurations will depend upon the specific application or applications for which the inventive teachings is/are used. Those skilled in the art will recognize or be able to ascertain, using no more than routine experimentation, many equivalents to the specific inventive embodiments described herein. It is, therefore, to be understood that the foregoing embodiments are presented by way of example only and that, within the scope of the appended claims and equivalents thereto, inventive embodiments may be practiced otherwise than as specifically described and claimed. Inventive embodiments of the present disclosure are directed 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, if such features, systems, articles, materials, kits, and/or methods are not mutually inconsistent, is included within the inventive scope of the present disclosure.


The above-described embodiments can be implemented in any of numerous ways. For example, embodiments may be implemented using hardware, software or a combination thereof. When implemented in software, the software code can be executed on any suitable processor or collection of processors, whether provided in a single computer or distributed among multiple computers.


Further, it should be appreciated that a computer may be embodied in any of a number of forms, such as a rack-mounted computer, a desktop computer, a laptop computer, or a tablet computer. Additionally, a computer may be embedded in a device not generally regarded as a computer but with suitable processing capabilities, including a Personal Digital Assistant (PDA), a smart phone or any other suitable portable or fixed electronic device.


Also, a computer may have one or more input and output devices. These devices can be used, among other things, to present a user interface. Examples of output devices that can be used to provide a user interface include printers or display screens for visual presentation of output and speakers or other sound generating devices for audible presentation of output. Examples of input devices that can be used for a user interface include keyboards, and pointing devices, such as mice, touch pads, and digitizing tablets. As another example, a computer may receive input information through speech recognition or in other audible format.


Such computers may be interconnected by one or more networks in any suitable form, including a local area network or a wide area network, such as an enterprise network, and intelligent network (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 networks, wired networks or fiber optic networks.


The various methods or processes outlined herein may be coded as software that is executable on one or more processors that employ any one of a variety of operating systems or platforms. Additionally, such software may be written using any of a number of suitable programming languages and/or programming or scripting tools, and also may be compiled as executable machine language code or intermediate code that is executed on a framework or virtual machine.


Also, various inventive concepts may be embodied as one or more methods, of which an example has been provided. The acts performed as part of the method may be ordered in any suitable way. Accordingly, embodiments may be constructed in which acts are performed in an order different than illustrated, which may include performing some acts simultaneously, even though shown as sequential acts in illustrative embodiments.


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


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.


The indefinite articles “a” and “an,” as used herein in the specification and in the claims, unless clearly indicated to the contrary, should be understood to mean “at least one.”


The phrase “and/or,” as used herein in the specification and in the claims, should be understood to mean “either or both” of the elements so conjoined, i.e., elements that are conjunctively present in some cases and disjunctively present in other cases. Multiple elements listed with “and/or” should be construed in the same fashion, i.e., “one or more” of the elements so conjoined. Other elements may optionally be present other than the elements specifically identified by the “and/or” clause, whether related or unrelated to those elements specifically identified. Thus, as a non-limiting example, a reference to “A and/or B”, when used in conjunction with open-ended language such as “comprising” can refer, in one embodiment, to A only (optionally including elements other than B); in another embodiment, to B only (optionally including elements other than A); in yet another embodiment, to both A and B (optionally including other elements); etc.


As used herein in the specification and in the claims, “or” should be understood to have the same meaning as “and/or” as defined above. For example, when separating items in a list, “or” or “and/or” shall be interpreted as being inclusive, i.e., the inclusion of at least one, but also including more than one, of a number or list of elements, and, optionally, additional unlisted items. Only terms clearly indicated to the contrary, such as “only one of” or “exactly one of,” or, when used in the claims, “consisting of,” will refer to the inclusion of exactly one element of a number or list of elements. In general, the term “or” as used herein shall only be interpreted as indicating exclusive alternatives (i.e. “one or the other but not both”) when preceded by terms of exclusivity, such as “either,” “one of,” “only one of,” or “exactly one of” “Consisting essentially of,” when used in the claims, shall have its ordinary meaning as used in the field of patent law.


As used herein in the specification and in the claims, the phrase “at least one,” in reference to a list of one or more elements, should be understood to mean at least one element selected from any one or more of the elements in the list of elements, but not necessarily including at least one of each and every element specifically listed within the list of elements and not excluding any combinations of elements in the list of elements. This definition also allows that elements may optionally be present other than the elements specifically identified within the list of elements to which the phrase “at least one” refers, whether related or unrelated 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”) can refer, in one embodiment, to at least one, optionally including more than one, A, with no B present (and optionally including elements other than B); in another embodiment, to at least one, optionally including more than one, B, with no A present (and optionally including elements other than A); in yet another embodiment, 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); etc.


In the claims, as well as in the specification above, all transitional phrases such as “comprising,” “including,” “carrying,” “having,” “containing,” “involving,” “holding,” “composed of,” and the like are to be understood to be open-ended, i.e., to mean including but not limited to. Only the transitional phrases “consisting of” and “consisting essentially of” shall be closed or semi-closed transitional phrases, respectively, as set forth in the United States Patent Office Manual of Patent Examining Procedures, Section 2111.03.

Claims
  • 1. A method of splitting an index atom in a plurality of atoms in a distributed database, the distributed database comprising a plurality of nodes, each node in the plurality of nodes comprising a corresponding processor and a corresponding memory, one node in the plurality of nodes being designated as a chairman for the index atom and including a chairman's instance of the index atom, the method comprising: splitting, by the chairman, the chairman's instance of the index atom, the chairman's instance of the index atom representing data and/or metadata stored in the distributed database;transmitting, by the chairman to at least a subset of nodes in the plurality of nodes, instructions to split the index atom, each node in the at least a subset of nodes including a corresponding instance of the index atom;splitting, by a first node in the at least a subset of nodes, a first instance of the index atom into a first instance of a source atom and a first instance of a target atom;re-transmitting, by the first node to each other node in the at least a subset of nodes, the instructions to split the index atom;transmitting, from the first node to the chairman, an acknowledgement indicating that the first instance of the index atom has been split; andtransmitting, from the chairman to the at least a subset of nodes, a message indicating the index atom has been split.
  • 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 of claim 1, further comprising: receiving, by the first node from each other node in the at least a subset of nodes, the instructions to split the index atom.
  • 4. The method of claim 3, wherein the first node transmits the acknowledgement to the chairman in response to receiving the instructions to split the index atom from each other node in the at least a subset of nodes.
  • 5. The method of claim 1, further comprising: forwarding, at the first node, a message from the first instance of the source atom to the first instance of the target atom.
  • 6. The method of claim 5, wherein the transmitting the acknowledgment from the first node to the chairman and to each other node in the plurality of nodes occurs after forwarding the message from the first instance of the source atom to the first instance of the target atom.
  • 7. The method of claim 1, further comprising: transmitting, by the chairman to another node in the plurality of nodes, a message indicating the index atom has been split, the other node comprising a root atom containing a reference to the index atom.
  • 8. A distributed database comprising: a plurality of nodes, each node in the plurality of nodes comprising a corresponding processor and a corresponding memory, the plurality of nodes comprising:a first node containing a first instance of an index atom, the index atom representing data and/or metadata stored in the distributed database;a second node containing a second instance of an index atom; anda third node containing a third instance of an 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 second instance of a target atom and to transmit instructions to split the index atom to the second node and the third node,the second node is configured to re-transmit the instructions to split the index atom to the third atom, andthe third node is configured to re-transmit the instructions to split the index atom to the second atom.
  • 9. The distributed database of claim 8, wherein the second node is configured to 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 instructions to split the index atom and to transmit, to the first node, an acknowledgement indicating that the second instance of the index atom has been split.
  • 10. The distributed database of claim 9, wherein the first node is configured to send a message to the second node indicating that the index atom has been split in response to receiving the acknowledgement indicating that the second instance of the index atom has been split and to receiving an acknowledgement from the third node indicating that the third instance of the index atom has been split.
  • 11. The distributed database of claim 8, wherein the second node is configured to receive a message destined for the second local instance of the target atom on the second local instance of the source atom and to forward the message from the second local instance of the source atom to the second local instance of the target atom.
  • 12. A method of splitting an index atom in a plurality of atoms in a distributed database, the distributed database comprising a plurality of nodes, each node in the plurality of nodes comprising a corresponding processor and a corresponding memory, the method comprising: splitting, by a node in the plurality of nodes, a local instance of the index atom into a local instance of a source atom and a local instance of a target atom, the local instance of the source atom including values less than a split key value and the local instance of the target atom including values greater than the split key value; andreceiving, by the node on the local instance of the source atom, a message referring to a key value greater than the split key value; andforwarding, by the node, the message from the local instance of the source atom to the local instance of the target atom.
  • 13. The method of claim 12, wherein the node splits the local instance of the index atom in response to instructions to split the index atom from a chairman for the index atom, the chairman being a designated node in the plurality of nodes.
  • 14. The method of claim 13, further comprising: receiving, by the node, the instructions to split the index atom from each other node in the plurality of nodes.
  • 15. The method of claim 14, further comprising, after receiving the instructions to split the index atom from each other node in the plurality of nodes: receiving, by the node on the local instance of the target atom, a message referring to a key value greater than the split key value.
  • 16. The method of claim 14, further comprising, before receiving the instructions to split the index atom from the chairman: transmitting, by the node on the local instance of the index atom, a message referring to a key value greater than the split key value.
  • 17. The method of claim 16, further comprising, after splitting the local instance of the index atom: transmitting, by the node on the local instance of the target atom, a message referring to a key value greater than the split key value.
  • 18. A method of splitting an index atom in 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 node in the plurality of nodes comprising a corresponding processor and a corresponding memory, one node in the plurality of nodes being designated as a chairman for the index atom and including a chairman's instance of the index atom, the method comprising: splitting, by the chairman, the chairman's instance of the index atom into a chairman's instance of a source atom and a chairman's instance of a target atom, the chairman's instance of the source atom including values less than a split key value and the chairman's instance of the target atom including values greater than the split key value;transmitting, by the chairman to at least a subset of nodes in the plurality of nodes, instructions to split the index atom at the split key value, each node in the at least a subset of nodes including a corresponding instance of the index atom;re-transmitting, by the first node to each other node in the at least a subset of nodes, the instructions to split the index atom;splitting, by a first node in the at least a subset of nodes, a first instance of the index atom into a first instance of a source atom and a first instance of a target atom, the first instance of the source atom including values less than the split key value and the first instance of the target atom including values greater than the split key value;receiving, by the first node on the local instance of the source atom, a message referring to a key value greater than the split key value; andforwarding, by the first node, the message from the local instance of the source atom to the local instance of the target atom.transmitting, from the first node to the chairman, an acknowledgement indicating that the first instance of the index atom has been split at the first node; andtransmitting, from the chairman to the at least a subset of nodes, a message indicating the index atom has been split at each node in the at least a subset of nodes.
CROSS-REFERENCE TO RELATED APPLICATION(S)

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

PCT Information
Filing Document Filing Date Country Kind
PCT/US2018/000142 8/15/2018 WO 00
Provisional Applications (1)
Number Date Country
62545791 Aug 2017 US