Search

CN-117480500-B - Historical information in an instructor-based database system for transaction consistency

CN117480500BCN 117480500 BCN117480500 BCN 117480500BCN-117480500-B

Abstract

Techniques are disclosed relating to a database system that includes worker nodes operable to execute transactions and director nodes operable to ensure transaction consistency for transactions. The worker node may receive a request to perform a transaction involving writing a record. The worker node may then issue a request to a director node of the database system for information that facilitates performing the transaction operation. The director node may determine whether to approve the request based on whether the operation would result in a transactional inconsistency in the database system. The worker node may advance performing the transaction operation in response to receiving an approval response from most director nodes, wherein none of the received responses indicates that the transaction is not approved.

Inventors

  • P.J. Helland

Assignees

  • 易享信息技术有限公司

Dates

Publication Date
20260505
Application Date
20220509
Priority Date
20210608

Claims (14)

  1. 1. A method, comprising: Receiving, by a first worker node of a database system, a request to execute a transaction, the transaction involving writing a first record, wherein the database system comprises a plurality of worker nodes operable to execute transactions for the database system and a plurality of director nodes operable to ensure transaction consistency of the transactions; Issuing, by the first worker node, a snapshot request to an instructor node of the plurality of instructor nodes to obtain a snapshot time and history information describing a history of approved records up to the snapshot time; Receiving, by the first worker node, a response from a majority of the plurality of director nodes, wherein a first history of approved records known to a first one of the director nodes is different from a second history of approved records known to a second one of the director nodes, and wherein a union of information in the response forms the history information, and Executing, by the first worker node, the transaction, including attempting to access at least one record from a second worker node of the plurality of worker nodes, the at least one record identified by the history information as stored at the second worker node.
  2. 2. The method of claim 1, wherein the performing comprises: determining whether there is a second record located at the second worker node that conflicts with the first record based on the historical information, and In response to determining that a conflicting second record exists, the transaction is aborted.
  3. 3. The method of claim 1 or 2, wherein the history information specifies for a record of the history of approved recordings: The recording; the recorded position, and The record is indicated as committed time.
  4. 4. The method of claim 1, wherein the transaction involves a second record, and wherein the method further comprises: Determining, by the first worker node, a location of the second record based on the history information, and Attempting, by the first worker node, to access the second record from the location.
  5. 5. The method of claim 4, wherein the location corresponds to a central memory shared among the plurality of worker nodes.
  6. 6. The method of claim 1, wherein none of the responses alone fully provides the historical information.
  7. 7. The method of claim 1, wherein the snapshot time is proposed by the first worker node, and wherein the director node is operable to delay processing the snapshot request until the snapshot time.
  8. 8. The method of claim 1, wherein the director nodes are not operable to communicate with each other to share historical information describing approved records.
  9. 9. The method of claim 1, wherein the database system comprises a shared memory to which records are flushed from the plurality of worker nodes, and wherein the history of approved records describes records that have not been flushed from the plurality of worker nodes to a log-structured merge tree.
  10. 10. A computer readable medium having stored thereon program instructions capable of causing a first worker node of a database system to perform operations comprising: Receiving a request to execute a transaction involving writing a first record, wherein the database system includes a plurality of worker nodes operable to execute transactions for the database system and a plurality of director nodes operable to ensure transaction consistency for the transactions; issuing a snapshot request to an instructor node of the plurality of instructor nodes to obtain a snapshot time and history information describing a history of approved records up to the snapshot time; Receiving a response from a majority of the plurality of director nodes, wherein a first history of approved records known to a first one of the director nodes is different from a second history of approved records known to a second one of the director nodes, and wherein a union of information in the response forms the history information, and Executing the transaction includes attempting to access at least one record from a second worker node of the plurality of worker nodes, the at least one record identified by the history information as stored at the second worker node.
  11. 11. The computer-readable medium of claim 10, wherein the performing comprises: determining whether there is a second record located at the second worker node that conflicts with the first record based on the historical information, and After determining that there is no conflicting second record, a commit request is issued to the director node to obtain permission to commit the first record.
  12. 12. The computer-readable medium of claim 10, wherein the performing comprises: determining a location of a second record associated with the same database key as the first record based on the history information, and Attempting to access the second record from the location.
  13. 13. The computer-readable medium of claim 10, wherein attempting to access the at least one record comprises: sending a request for a second record to the second worker node, and A response is received indicating that the second record was not committed.
  14. 14. A system, comprising: at least one processor, and Memory having stored thereon program instructions executable by the at least one processor to perform the method according to any of claims 1 to 9.

Description

Historical information in an instructor-based database system for transaction consistency Background Technical Field The disclosure relates generally to database systems and, more particularly, to handling deceleration of components of database systems. Description of related Art Companies often employ modern database management systems that enable users to store collections of information that can be efficiently accessed and manipulated in an organized manner. Historically, these systems have been deployed on high-end, expensive hardware maintained by data centers owned by these companies. In most cases, the behavior of the high-end hardware is predictable and enables the system to achieve fast response latency. Over time, however, more and more companies have migrated their systems into the cloud, relying on the hardware provided by the cloud provider. However, cloud providers have begun to move toward using cheaper hardware in their cloud infrastructure, which is less predictable in terms of its behavior than high-end hardware. Drawings Fig. 1 is a block diagram illustrating exemplary elements of a system including a worker node and an instructor node, according to some embodiments. Fig. 2 is a block diagram illustrating exemplary elements of a worker node according to some embodiments. Fig. 3 is a block diagram illustrating exemplary elements of an instructor node in accordance with some embodiments. FIG. 4 is a block diagram illustrating exemplary elements of a history data structure according to some embodiments. FIG. 5 is a block diagram illustrating exemplary elements relating to a snapshot-to-close interaction of a worker node and a plurality of director nodes, according to some embodiments. Fig. 6 is a block diagram illustrating an exemplary layout of historical information regarding different director nodes according to some embodiments. FIG. 7 is a block diagram illustrating exemplary elements relating to submission-related interactions of a worker node and a plurality of director nodes, in accordance with some embodiments. Fig. 8 is a block diagram illustrating another exemplary layout of historical information regarding different director nodes according to some embodiments. Fig. 9 is a block diagram illustrating exemplary elements related to alignment time between components of a system, according to some embodiments. Fig. 10 is a block diagram illustrating exemplary elements of an assistant node according to some embodiments. FIG. 11 is a block diagram illustrating exemplary elements of a refresh operation in which a worker node and an assistant node refresh the same record to a database, according to some embodiments. FIG. 12 is a flow diagram illustrating an exemplary method associated with a worker node that interacts with an instructor node to facilitate performing a transaction operation in accordance with some embodiments. FIG. 13 is a flowchart illustrating an exemplary method associated with an instructor node ensuring transaction consistency within a system, according to some embodiments. FIG. 14 is a flow chart illustrating an exemplary method associated with a worker node interacting with an instructor node to obtain history information describing a history of approved records, in accordance with some embodiments. FIG. 15 is a flow diagram illustrating an exemplary method related to a worker node that selects a proposed time associated with performing an operation of a transaction, according to some embodiments. FIG. 16 is a flow diagram illustrating an exemplary method associated with a worker node that selects a proposed snapshot time of a transaction, according to some embodiments. FIG. 17 is a flow chart illustrating an exemplary method associated with an instructor node attempting to align the time observed by the instructor node with the time observed by other instructor nodes, in accordance with some embodiments. Fig. 18 is a flow chart illustrating an exemplary method associated with an instructor node that attempts to align the time observed by the instructor nodes in accordance with some embodiments. Fig. 19 is a flow chart illustrating an exemplary method associated with an assistant node that observes the work performed by a worker node in accordance with some embodiments. Fig. 20 is a flow chart illustrating another exemplary method related to an assistant node that observes the work performed by a worker node, according to some embodiments. Fig. 21 is a block diagram illustrating elements of a multi-tenant system in accordance with some embodiments. FIG. 22 is a block diagram illustrating elements of a computer system for implementing various systems described in the disclosure, according to some embodiments. Detailed Description As previously mentioned, cloud providers are turning to using cheaper, and therefore less reliable, hardware in their cloud infrastructure. The number of reports from the randomly slowed down servers increases due to the use of inexpensive h