Clock synchronization

By introducing the master clock mechanism and uncertainty measurement management into the distributed storage system, the problem of clock synchronization between nodes is solved, timeline consistency and reliability after failure or reconfiguration is achieved, and expensive external clocks are avoided. rely.

CN118760347APending Publication Date: 2024-10-11MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410984647.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-03-22
Filing Date
2019-03-13
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

In a distributed storage system, clock synchronization between nodes is difficult to achieve, leading to problems with the order and consistency of transaction execution, especially when nodes fail or are reconfigured. Existing technologies need to rely on expensive external clocks, and clock drift Leading to timestamp uncertainty.

Method used

By introducing a master clock mechanism in the node cluster, the old master node provides the master clock value, the new master node resynchronizes after reconfiguration, the slave node disables the local clock, waits for the lease to expire, and sets the clock value to ensure synchronization and avoid expensive external Clock dependence and managing clock drift through uncertainty measures.

Benefits of technology

It achieves sequential and consistent synchronization of clocks within the cluster after node failure or reconfiguration, reduces dependence on expensive external clocks, and improves the timeline integrity and reliability of the distributed storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760347A_ABST
    Figure CN118760347A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to clock synchronization. In various examples, a method performed by a node in a cluster of nodes to establish a master clock at a new master node after reconfiguration of nodes included in the cluster is provided, where the master clock is provided by an old master node prior to reconfiguration, and a local clock of a slave node is synchronized to a clock of the new master node. The new master node sends messages to the slave nodes that instruct them to disable their respective local clocks, receives an acknowledgement that the local clocks have been disabled, waits until all rents for any node removed from the cluster have expired, the value of its clock is set to be greater than the maximum value originally provided by the old master node at the expiration of the rental, and other nodes are indicated to reactivate their local clock.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Related Applications

[0002] This application is a divisional application of the invention patent application with application number 201980020256.X and invention name “Clock Synchronization”. Background Art

[0003] Many different types of applications can be arranged to run on a cluster of computing nodes. By splitting computing tasks and data storage between the nodes of the cluster, applications can be more easily expanded by including additional nodes within the cluster. However, in the design of such applications, it is necessary to mitigate any problems that may arise due to the failure of the nodes within the cluster. Such applications may require that each of the nodes in the cluster be synchronized so that it can be considered that there is a master clock with which the operations within the cluster can be executed relative to it. An example of such an application is a distributed transactional memory system. In a distributed transactional memory system, it is necessary to ensure that transactions are executed in a strict sequential order within the cluster so that the integrity of the memory system is preserved, even if the transactions are processed by different nodes in the cluster. Similarly, the timing of other operations related to the memory system (such as garbage collection of historical versions of objects (wherein the memory system supports multiple versions)) also requires precise coordination between the nodes of the cluster. A known solution for synchronizing the nodes of a cluster is to provide a resilient (i.e., highly reliable) master clock signal to each of the nodes in the cluster.

[0004] The embodiments described below are not limited to implementations that address any or all of the shortcomings of known clusters of nodes. Summary of the invention

[0005] A simplified summary of the present disclosure is presented below to provide the reader with a basic understanding. The present disclosure is not intended to identify the key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Its sole purpose is to present a series of concepts disclosed herein in a simplified form as a prelude to a more detailed description presented later.

[0006] In various examples, methods are provided for execution by nodes in a cluster of nodes to establish a master clock at a new master node following a reconfiguration of the nodes included in the cluster, wherein the master clock was provided by the old master node prior to the reconfiguration, and to synchronize local clocks of slave nodes to the clock of the new master node. The new master node sends a message to the slave nodes instructing them to disable their respective local clocks, receives an acknowledgement that the local clocks have been disabled, waits until a time when all leases for any node removed from the cluster have expired, sets its clock to a value greater than a maximum value that would have been provided by the old master node at the time the lease expired, and instructs other nodes to re-enable their local clocks.

[0007] As the features become better understood by reference to the following detailed description taken in conjunction with the accompanying drawings, many of the attendant features will likewise be more readily understood. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The present description will be better understood from the following detailed description in view of the accompanying drawings, in which:

[0009] Figure 1 An exemplary computing-based device is illustrated in which embodiments of the systems and methods are implemented.

[0010] Figure 2A illustrates an exemplary cluster of computing nodes upon which embodiments of the systems and methods may be implemented;

[0011] Figure 2B Figure 2 shows the cluster after an exemplary reconfiguration. Figure 2A An exemplary cluster of computing nodes is shown in FIG.

[0012] Figure 3 An exemplary method performed by slave nodes to synchronize their local clocks with a master clock is illustrated;

[0013] Figure 4 An exemplary method for synchronizing two or more local clocks on slave nodes with a master clock is illustrated;

[0014] Figure 5 illustrates an exemplary method to be performed by a new master node of a cluster to establish a master clock following reconfiguration of the cluster;

[0015] Figure 6 illustrates an exemplary method to be performed by a slave node of a cluster to synchronize its local clock with a master clock;

[0016] Figure 7 An exemplary method for executing a transaction including one or more read operations within a distributed transactional memory system operating on a cluster of nodes is illustrated;

[0017] Figure 8 An exemplary method for performing a transaction including one or more write operations within a distributed transactional memory system operating on a cluster of nodes is illustrated;

[0018] Fig. 9 An exemplary method for performing a read transaction in a multi-version transactional memory system is illustrated;

[0019] Fig.10 An exemplary method for performing a write transaction in a multi-version transactional memory system is illustrated; and

[0020] Fig.11 An exemplary method for performing garbage collection on previous versions of an object stored at a node in a distributed multi-version memory system is illustrated.

[0021] Like reference numerals are used to refer to like parts in the drawings. DETAILED DESCRIPTION

[0022] The detailed description provided below in conjunction with the accompanying drawings is intended as a description of the current examples and is not intended to represent the only form in which the current examples are constructed or utilized. The description sets forth the functions of the examples and the sequence of operations for constructing and operating the examples. However, the same or equivalent functions and sequences may be implemented by different examples.

[0023] Some of the examples set forth below allow a master clock to be provided by a local clock of one of the nodes, thereby avoiding the need for a more expensive resilient clock to be connected to each node. In the event of a failure of the node that was providing the master clock, these examples enable a new node in the cluster to begin providing the master clock in its place in a manner that preserves the sequential order of any actions performed by the nodes in the cluster that depend on the master clock.

[0024] Although the current examples are described and illustrated herein as being implemented in a computer system, the described system is provided as an example and not a limitation. As will be appreciated by those skilled in the art, the current examples are suitable for application in a variety of different types of computer systems.

[0025] Figure 1 Illustrated is an exemplary computing-based device 100 that is implemented as any form of computing and / or electronic device and in which embodiments of the systems and methods disclosed herein are implemented in some examples.

[0026] The computing-based device 100 includes one or more processors 102, which are microprocessors, controllers, or any other suitable type of processors for processing computer executable instructions to control the operation of the device. In some examples, such as when a system-on-chip architecture is used, the processor 102 includes one or more fixed function blocks (also referred to as accelerators) that implement a portion of the various methods disclosed herein in hardware (rather than software or firmware). In some examples, one or more or all of the processors 102 include two or more cores 104, each core having its own corresponding clock 106. Two or more cores 104 are capable of processing instructions independently of each other, thereby allowing the processor 102 to process multiple instructions simultaneously. Each core in the core 104 supports multithreading, wherein each execution thread processed by the core is processed in parallel with each other by fast context switching of the core between each execution thread in the execution thread. Each core in the core 104 includes a corresponding clock 106, which the thread executed on the core can refer to to obtain a timestamp representing the current time.

[0027] Platform software including an operating system or any other suitable platform software is provided at the computing-based device to enable application software to be executed on the device.

[0028] Computer executable instructions are provided using any computer readable medium accessible by the computing-based device 100. Computer readable media include, for example, computer storage media, such as memory 108, and communication media. Computer storage media such as memory 108 include volatile and non-volatile media, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules, etc. Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, cassettes, magnetic tapes, magnetic disk storage devices or other magnetic storage devices, or any other non-transmission media used to store information accessed by a computing device. In contrast, communication media embodies computer readable instructions, data structures, program modules, etc. in modulated data signals such as carrier waves or other transmission mechanisms. As defined herein, computer storage media do not include communication media. Therefore, computer storage media should not be understood as propagating signals themselves. Although computer storage media (memory 108 ) is shown within computing-based device 100 , it will be appreciated that storage in some examples is distributed or remotely located and accessed via a network or other communication link (eg, using communication interface 110 ).

[0029] The computing-based device 100 also includes an input / output controller 112 arranged to output display information to a display device 114 (which may be separate from or integrated with the computing-based device 100). The display information may provide a graphical user interface. The input / output controller 112 is also arranged to receive and process input from one or more devices such as a user input device 116 (e.g., a mouse, keyboard, camera, microphone, or other sensor). In some examples, the user input device 116 detects voice input, user gestures, or other user actions and provides a natural user interface (NUI). In an embodiment, the display device 114 also serves as the user input device 116 (if it is a touch-sensitive display device). In some examples, the input / output controller 112 outputs data to a device other than the display device, such as a locally connected printing device (not shown in FIG. 1 ). Figure 1 middle).

[0030] Any of the input / output controller 112, the display device 114, and the user input device 116 may include NUI technology that enables a user to interact with a computing-based device in a natural way, free from artificial constraints imposed by input devices (such as a mouse, keyboard, remote control, etc.). Examples of NUI methods provided in some examples include, but are not limited to, those that rely on speech and / or voice recognition, touch and stylus recognition (touch-sensitive displays), gesture recognition on and adjacent to the screen, air gestures, head and eye tracking, speech and voice, vision, touch, gestures, and machine intelligence. Other examples of NUI technologies used in some examples include intent and target understanding systems, motion gesture detection systems using depth cameras (e.g., stereo camera systems, infrared camera systems, red, green, blue (rgb) camera systems, and combinations of these), motion gesture detection using accelerometers / gyroscopes, facial recognition, three-dimensional (3D) displays, head, eye, and gaze tracking, immersive augmented reality and virtual reality systems, and technologies for sensing brain activity using electric field sensing electrodes (electroencephalograms (EEGs) and related methods).

[0031] In some examples, the computing-based device 100 functions as a headless server and does not include any display device 114 or user input device 116. Instead, in such examples, the computing-based device 100 utilizes the communication interface 110 to receive instructions and communicate across a network (not shown). Figure 1 ) provides the response to other computing-based devices.

[0032] Figure 2A Illustrated is an exemplary cluster 200 of computing nodes upon which embodiments of the systems and methods disclosed herein may be implemented in some examples.

[0033] The cluster 200 of computing nodes (which may also be simply referred to as a cluster) includes a plurality of computing nodes 210 (or simply nodes). The plurality of computing nodes 210 are arranged to communicate with each other via a network 220. Figure 2A In the exemplary cluster 200 illustrated in FIG. 1 , the cluster 200 includes four nodes 210(1), 210(2), 210(3), and 210(4). However, it will be appreciated that in other examples, a greater or lesser number of nodes 210 may be included in the cluster 200. The network 220 also enables the nodes 210 to communicate with other computing-based devices 100 connected thereto.

[0034] The cluster 200 of computing nodes can change configuration during its operation. In order to determine when the configuration should be changed and what the new configuration should be, various existing configuration protocols can be used. In some examples, the configuration protocol allows the nodes 210 in the cluster 200 to self-select a configuration master node that is responsible for determining the new configuration of the cluster 200. For example, in Figure 2A In the cluster illustrated in , node 210(1) serves as the configuration master node for cluster 200 and identifies nodes 210(1), 210(2), 210(3), and 210(4) as belonging to cluster 200. However, in other examples, any of the other nodes 210 in cluster 200 may serve as the configuration master node for cluster 200. In some examples, the configuration protocol described in the Microsoft research article “No compromises: distributed transaction with consistency, availability, and performance” by Dragojevic, Narayanan, Nightingale, Renzelmann, Shamis, Badam, and Castro (a copy available at https: / / dl.acm.org / citation.cfm?id=2815425) may be used.

[0035] Figure 2B The diagram shows the cluster 200 after an exemplary reconfiguration. Figure 2A 2. As part of a reconfiguration of cluster 200, node 210(1) has been removed from cluster 200, and new node 210(5) (which was not previously part of cluster 200) has been added to cluster 200. Thus, after the exemplary reconfiguration of cluster 200, cluster 200 includes nodes 210(2), 210(3), 210(4), and 210(5).

[0036] Reconfiguration of cluster 200 may be performed periodically to remove any nodes 210 that degrade the performance of cluster 200 and / or to add additional nodes 210 to cluster 200 as required. Alternatively or additionally, reconfiguration of cluster 200 may be performed due to one or more of nodes 210 in cluster 200 becoming unavailable (e.g., due to hardware failure or routine maintenance). In the event that a node 210 serving as a master configuration node for cluster 200 is removed from cluster 200 following its reconfiguration (such as following a failure of the master configuration node, for example), the configuration protocol used in some examples provides a mechanism for allowing a new master configuration node 210 to be determined for cluster 200. For example, in Figure 2B Following removal of previous master configuration node 210(1) during reconfiguration of cluster 200 illustrated in FIG, node 210(2) may be determined as the new master configuration node for cluster 200. New master configuration node 210(2) may then notify nodes 210(3), 210(4), and 210(5) that cluster 200 includes nodes 210(2), 210(3), 210(4), and 210(5) after reconfiguration.

[0037] Each of the nodes 210 includes at least one local clock 230 with which it determines the appropriate time to perform the various computing tasks that may be assigned to the node. However, many applications that may be run on the cluster 200 of computing nodes 210 require that actions taken by processes running on different nodes 210 of the cluster 200 be coordinated across the entire cluster 200. This means that it is necessary for the local clocks 230 of the nodes 210 to be synchronized so that they provide approximately the same time as each other.

[0038] exist Figure 2A and Figure 2B In the exemplary cluster illustrated in , this is achieved by nominating one of the nodes to serve as the master clock for cluster 200. That is, one of the nodes 210 provides a reference clock (i.e., the master clock) to which the other nodes can synchronize. The other nodes can then synchronize to the master clock provided by the node. This means that the nodes of cluster 200 do not require access to reliable external clocks (such as GPS or atomic clocks) that are expensive to provide. In some examples, the configuration protocol for cluster 200 may indicate that the management of the configuration of cluster 200 and the provision of the master clock are performed by the same master node 210 (which is the configuration master node, and the master node used to provide the master clock is the same).

[0039] In the context of providing a master clock for cluster 200, node 210 providing the master clock may be referred to as master node 210, while other nodes may be referred to as slave nodes (although in the context of other functions that may be performed within cluster 200, other nodes 210 may be considered master nodes).

[0040] As will be appreciated, the local timestamp generated by the slave node will inevitably be an approximation of the master clock, even when they are regularly synchronized with the master clock. This is due to several factors. First, in addition to the timing uncertainty introduced in the transmission of the timestamp across the network from the master node to the slave node, there are some timing uncertainties introduced by the processing performed by each node in the generation / processing remote timestamp. This means that the remote timestamp will inevitably represent a previous time point compared to the time point at which it is received by the slave node. Secondly, each node 210 utilizes the local clock provided in their corresponding processor 102. Due to the difference between the clock speed (or oscillation) in each processor, the local clock 230 will suffer from the clock drift phenomenon relative to other clocks in the cluster 200. This phenomenon means that even if the two clocks in the cluster start with the same value at the same time point, the values ​​of those clocks will diverge over time due to one of the clocks running faster than the other clock. This potential difference between the local clock on each slave node in the slave node and the value on the master clock of the master node can be encapsulated in the uncertainty measurement maintained by each slave node in the slave node. The uncertainty metric provides an indication of potential differences that may exist between a particular timestamp generated by a local clock of a slave node (which may be referred to as a local timestamp) and a timestamp provided by a master clock (which may be referred to as a global timestamp). Specifically, the uncertainty metric provides an indication of both the possible minimum and maximum values ​​of the remote master clock at the point in time when the local timestamp is measured from the local clock. This is required for certain applications that may run on cluster 200 (such as the distributed transactional memory system discussed below) that require a guarantee that the master clock will not be greater than (or in other cases less than) a particular value at a given point in time. That is, certain applications require a guarantee that none of the clocks of the nodes in the cluster will have a value that falls outside the range indicated by the uncertainty metric for the local clock of each node.

[0041] In the examples discussed herein, the clock increments over time. That is, the lower value of the clock represents an earlier time point than the higher value of the clock. Therefore, the maximum value of the master clock represented by the uncertainty metric will be a value greater than the local timestamp provided by the local clock, and the minimum value of the master clock represented by the uncertainty metric will be a value lower than the local timestamp. However, it will be appreciated that the clock can start with a high value and decrease over time. In such an example, the higher clock value represents an earlier time point than the lower value of the clock. Similarly, the maximum value of the master clock represented by the uncertainty metric will be a value lower than the local timestamp provided by the local clock, and the minimum value of the master clock represented by the uncertainty metric will be a value higher than the local timestamp. In either case, the minimum value of the master clock can be considered as how much earlier the time indicated by the master clock can be compared to the value of the local clock, while the maximum value of the master clock can be considered as how much later the time indicated by the master clock can be compared to the value of the local clock.

[0042] Figure 3 A method 300 performed by slave nodes 210 to synchronize their local clocks 230 to a master clock provided by a master node 210 is illustrated.

[0043] At operation 310 , the method 300 stores a first value representing a current value of a local clock.

[0044] At operation 320 , the method 300 receives a remote timestamp (or master timestamp) from the master node 210 indicating the current value of a remote clock, the remote clock of the master node 210 serving as a master clock for the cluster.

[0045] At operation 330, method 300 stores a second value representing the current value of local clock 230 when the remote timestamp was received. The second value stored at operation 330 represents a point in time known to be later than the time when the remote timestamp was generated (ie, when the remote timestamp was received).

[0046] The first value stored at operation 310 represents a time point known to be earlier than the time when the remote timestamp is generated. In some examples, the slave node may send a synchronization request to the master node to request a remote timestamp. In such examples, the first value may represent the time point when the request is sent to the master node. In other examples, the master node may periodically send the remote timestamp to the slave node. In such examples, the first value may represent the timestamp when the previous synchronization message was received. In other examples, a hybrid approach may be adopted, in which the master node periodically sends the remote timestamp and the slave node sends a synchronization request as needed. In order to minimize the uncertainty around the master clock value at the slave node, it is desirable that the first value represents the latest time point known to have occurred before the remote timestamp is generated.

[0047] At operation 340, method 300 sets local clock 230 to the current value of the remote clock based on the remote timestamp. The value of the local clock will thus approximately represent the value of the remote clock (within the bounds of uncertainty discussed above).

[0048] It will be appreciated that setting the value of clock 230 is an abstract operation and does not involve changing the actual value of the clock. Instead, information from the synchronization operation is stored that allows timestamps to be generated from the clocks so that they approximately represent the timestamps of the master clock. As an example, setting the value of clock 230 can be achieved by changing an offset value stored at the slave node that represents the difference between the local clock value and the master clock (as indicated by the master timestamp). In such an example, the offset value is used to adjust the value of the local clock when the local timestamp is generated.

[0049] At operation 350, if it is determined that synchronization should continue, then the method 300 returns to operation 310. Otherwise, the method 300 ends.

[0050] Figure 4 An exemplary method 400 for synchronizing two or more local clocks on a slave node 210 with a master clock 230 is illustrated. Each of the local clocks is provided by a respective clock 106 associated with a different processing core 104 of a processor 102 of the slave node 210. Each of the local clocks is synchronized by a thread (or, in some examples, multiple threads) associated with the processing core 104 to which the clock belongs. These threads may be referred to as synchronization threads. Each of the synchronization threads executes the above referenced Figure 3 The method 300 is described to synchronize the clocks 106 of the processing cores 104 while threads are being processed.

[0051] At operation 410, method 400 uses the first value stored by each thread to determine the corresponding maximum value of the remote clock for each thread. The corresponding maximum value of the remote clock is determined based on the received remote timestamp, and the predetermined maximum clock drift rate between the local clock of the slave node and the remote master clock, and the amount of time that has passed between the current time and the first stored value. Specifically, the time that has passed since the first value (which is the earlier of the two stored values) was stored can be calculated and multiplied by the maximum clock drift rate to calculate the maximum amount of clock drift that may have occurred since the remote timestamp was received. The clock drift is then added to the remote timestamp to determine the maximum value that the master clock may be at that point in time.

[0052] At operation 420, method 400 uses the second value stored by each thread to determine the corresponding minimum value of the remote clock for each thread. The corresponding minimum value of the remote clock is determined based on the received remote timestamp and the predetermined minimum clock drift rate between the local clock of the slave node and the remote master clock, and the amount of time elapsed between the current time and the second stored value. Specifically, the time elapsed since the second value (which is the later of the two values) can be calculated and multiplied by the minimum clock drift rate that may have occurred since the remote timestamp was received. The clock drift is then added to the remote timestamp to determine the minimum value that the master clock may be at that point in time.

[0053] In some examples, the minimum and maximum values ​​of the remote clock may be determined for each thread by the thread itself. Alternatively, in other examples, these determinations may be performed by other processes running on slave node 210.

[0054] Having determined minimum and maximum values ​​based on the synchronization that has been performed by each thread, the method 400 integrates these values ​​as a whole into a single minimum and maximum value for the remote clock of the slave node 210. Specifically, the method 400 selects the lowest (i.e., earliest) maximum value of the remote clock from among the maximum values ​​determined for each thread. Similarly, the method 400 selects the largest (i.e., latest) minimum value of the remote clock from among the minimum values ​​determined for each thread.

[0055] At operation 430, method 400 provides an indication of the lowest maximum value and the largest minimum value as an uncertainty measure for a local timestamp provided by each local clock in the corresponding local clock on the slave node. By integrating the minimum and maximum values ​​from across multiple threads in this way, a better and more accurate uncertainty measure can be provided for the remote clock at the slave node 210. This is because different threads on different processing cores 104 can achieve better synchronization with the remote clock. This can be, for example, due to one or more threads in the slow-running thread. In some examples, one or more of the synchronization threads receive a remote timestamp from the master node via a communication protocol different from the communication protocol used by other threads. Since different communication protocols can be better suited to different network conditions, one of the communication protocols can provide better synchronization than other network protocols for a given set of network conditions encountered by the slave node. Additionally or alternatively, in other examples, one or more of the synchronization threads can receive a remote timestamp via a communication medium different from the communication medium used by other threads. Since different communication media have different properties, synchronization to the master clock can be performed more effectively via one of the communication media than via another communication medium. The lowest maximum and the largest minimum values ​​may be provided by two different synchronization threads, respectively. Any synchronization thread that is determined not to contribute to the lowest maximum and the largest minimum values ​​may be stopped, so that synchronization continues using only those threads that are more efficiently synchronized. Any local clock that is not directly synchronized to the master clock by the corresponding synchronization thread may instead be synchronized to one of the other local clocks (using a specified tolerance for internal clock drift between clocks 106 of different cores 104 within the processor 102).

[0056] In some examples, the slave node can monitor the actual clock drift rate it experiences relative to the master clock, and can leave the cluster 200 (i.e., stop participating in it) if the actual clock drift rate exceeds a predetermined minimum or maximum clock drift rate. This is determined by looking at the stored values ​​from two separate synchronizations with the master clock. Specifically, the range between the value of the first storage of the earlier synchronization and the value of the second storage of the later synchronization is calculated as the maximum clock difference between the two synchronizations, and the range between the value of the second storage of the earlier synchronization and the value of the first storage of the later synchronization is calculated as the minimum clock difference. If the time between the two synchronizations divided by the calculated maximum clock difference exceeds the predetermined maximum clock drift rate, or if the time between the two synchronizations divided by the minimum clock difference is less than the predetermined minimum clock drift rate, then the actual clock drift rate is considered to exceed the predetermined minimum or maximum clock drift rate. In some examples, the predetermined minimum and maximum clock drift rates can be adjusted by a safety factor during this determination to ensure that the clock drift safely falls within the boundaries specified by the predetermined minimum and maximum clock drift rates.

[0057] At operation 440, the method 400 may re-iterate to perform additional synchronizations. Since the amount of clock drift depends on the time that elapses between synchronizations, it is desirable that the method 400 be repeated periodically so that the time between any two synchronizations remains low.

[0058] Figure 5 An exemplary method 500 to be performed by a new master node 210 of a cluster 200 of nodes to establish a master clock by using its local clock is illustrated. The method 500 is performed after the reconfiguration of the nodes 210 included in the cluster. Before the reconfiguration, the master clock is provided by the old master node 210, and the other nodes 210 in the cluster 200 synchronize their local clocks 230 to the master clock. In some examples, the reconfiguration of the cluster 200 involves adding and / or removing nodes 210 from the cluster 200. For example, the old master node 210 may have been removed from the cluster 200, making the establishment of a new master clock necessary. Of course, in other examples, the reconfiguration of the cluster can nominate a new master node 210 to provide a master clock for the cluster 200, even if the old master node 210 has not been removed. In some examples, the new master node 210 can be a node 210 that has been added to the cluster 200. That is, the new master node 210 may not yet exist in the cluster of nodes before the reconfiguration. In general, the term "old" is intended to refer to a particular node that was performing a particular role before a reconfiguration of the cluster, while the term "new" is intended to refer to a particular node that is performing a particular role after a reconfiguration of the cluster.

[0059] At operation 510, method 500 sends a message to other nodes in the node's cluster to instruct them to disable their respective local clocks. With their local clocks disabled, other nodes will cause any processing (e.g., transactions in distributed memory) that requires timestamps from local clocks to be suspended.

[0060] At operation 520, the method 500 waits until it has received confirmation from all other nodes in the node's cluster indicating that their respective local clocks have been disabled.

[0061] At operation 530, the method 500 identifies the time at which all leases of any nodes 210 that have been removed from the cluster 200 of nodes by reconfiguration will have expired, and waits until the identified time has passed. Since these nodes 210 are no longer in the cluster 200 after the reconfiguration, they will not be able to receive instructions to disable their local clocks and will continue any processing (e.g., transactions in distributed memory) that had been received before the reconfiguration, including obtaining timestamps from their local clocks. After their leases expire, these nodes 210 will no longer be able to interact with the cluster 200, meaning that no timestamps from these nodes will be able to exist in the cluster 200 after this moment.

[0062] At operation 540, method 500 determines the maximum value that the master clock provided by the old master node 210 could have been at the time when the lease of the node 210 removed from the cluster 200 expires. This value is the maximum value that the local clocks of these nodes could have provided until the moment their leases expire. In some examples, this maximum value can be determined by simply adding a relatively "large" predetermined amount to the previous master clock. This "large" amount can be an order of magnitude or more larger than the measure of normal operation on the clock to ensure that it is likely to be larger than any timestamp that may have been previously issued by the node 210 in the cluster 200. However, in other examples, the nodes 210 of the cluster 200 maintain uncertainty metrics about their synchronization with the old master clock, as described earlier. These uncertainty metrics indicate the maximum value of the master clock based on a predetermined maximum clock drift rate and the amount of time that has passed since the last synchronization of the node 210 with the master clock. The new master node 210 may therefore determine the maximum value of the old master clock at the time the lease expires as the maximum (i.e., most recent) value indicated by any of the nodes that remain in the cluster after the reconfiguration (and which are therefore synchronized to the old master clock). In some examples, the nodes may provide an indication of the maximum value of the master clock and an acknowledgement that their local clock has been disabled after receiving the message sent in operation 510. This reduces the number of messages that need to be sent between nodes 210 in the cluster 200.

[0063] At operation 550, method 500 sets its local clock to be greater than the maximum value, effectively "jumping" the master clock forward to the guaranteed "new" value for the cluster. As discussed earlier, the local "set" is an abstract operation that affects the timestamps generated by the clock, not the actual underlying value of the clock itself. It is advantageous to make this "jump" as small as possible while still ensuring that no timestamps indicating times that occur after the new master clock value will likely be emitted. This is because, when time is represented as a fixed number of bits in a computer system, there are only certain time ranges that can be represented. By keeping the "jump" to a minimum, it maximizes the amount of time available before a master clock overflow occurs.

[0064] At operation 560, method 500 indicates to slave nodes 210 that their local clocks 230 can be re-enabled. This means that slave nodes 210 will synchronize to the new master clock and continue any processing that may have been previously suspended when the local clock is disabled. In some examples, master node 210 can send a message to the slave nodes to explicitly instruct them to re-enable their local clocks 230. In other examples, an indication can be given implicitly. For example, slave nodes 210 can be arranged to periodically attempt their resynchronization with new master nodes 210 after their local clocks 230 have been disabled. The indication of re-enabling the clock can therefore be provided by the new master node 210 by responding to the synchronization request from the slave node 210 (wherein previously, master node 210 did not respond to those requests or responded with an error).

[0065] Figure 6 Illustrated is an exemplary method 600 to be performed by a slave node 210 of a cluster of nodes 200 to synchronize its local clock to a master clock provided by a master node in the cluster of nodes.

[0066] At operation 610, method 600 synchronizes the local clock to the master node of cluster 200. This synchronization can be performed as described above with respect to Figure 3 and Figure 4 The method may be executed in the manner described (i.e., with or without using multiple local clocks and threads).

[0067] At operation 620, the method 600 receives an indication of a new configuration for the cluster, the new configuration 210 indicating a new master node 210 for the cluster 200. The indication of the new configuration may be indicated using an existing configuration protocol for the cluster 200.

[0068] At optional operation 630, method 600 maintains an uncertainty metric for synchronizations performed with the master node (i.e., the previous master node) prior to reconfiguration of cluster 200. The uncertainty metric indicates a maximum value of the master clock (i.e., the previous master clock) based on a predetermined maximum clock drift rate and an amount of time that has passed since the last synchronization with the master clock (again, which is the previous master clock).

[0069] At operation 640, method 600 receives a message from the new master node instructing the slave node to disable the local clock. In some examples, the message is provided implicitly. That is, the disabling of the clock can be performed by the slave node in response to receiving an indication that the new node is providing a new configuration of the master clock.

[0070] At operation 650, the method 600 disables the local clock. Disabling the local clock 230 means that the slave node 210 stops providing timestamps for any processing being executed. In the event that the processing being executed requires timestamps, disabling the local clock 230 thus causes the processing to be suspended until the local clock 230 is re-enabled and timestamps can be obtained.

[0071] At operation 660 , the method 600 sends a message to the new master node 210 indicating that the local clock 230 has been disabled.

[0072] At optional operation 670, method 600 provides an indication of the maximum value of the previous master clock from the uncertainty metric maintained at operation 620 to the new master node 210. In some examples, the indication is included in the message sent at operation 650 indicating that the local clock 230 sent at operation 640 has been disabled.

[0073] At operation 680, the method 600 receives an indication from the new master node 210 that the local clock should be re-enabled. In some examples, the slave node may periodically attempt to synchronize to the master node 210. The indication that the local clock should be re-enabled is received when the master node 210 responds to one of the synchronization attempts with a timestamp for the new master clock. In other examples, the indication may simply be a message indicating that the local clock 230 should be re-enabled, after which the slave node 210 may begin attempting to synchronize to the master clock provided by the new master node 210 at operation 690. With the clock re-enabled and synchronized to the new master clock, any processing that requires a timestamp assigned to the slave node 210 may continue.

[0074] In some examples, the messages required for synchronization between the slave nodes 210 and the new master node (such as a message instructing the slave node to disable the local clock, a message from the slave node indicating that the local clock has been disabled, and an indication from the new master node 210 to the slave node 210 that the local clock 230 should be re-enabled) are provided by inserting additional information into existing messages used as part of the configuration protocol for the cluster. This reduces the need to send additional messages between the nodes 210 in the cluster 200 to synchronize the local clock to the master clock.

[0075] Through the above techniques, the cluster 200 of nodes can allow applications to synchronize actions across the nodes 210 of the cluster 200 without requiring expensive external resilient (or reliable) clocks, such as GPS or atomic clocks. In addition, even if a node providing a master clock within the cluster 200 fails, the cluster 200 can resynchronize the master clock from the new master node in a manner that ensures the integrity of the timeline for actions within the cluster. The properties provided by these techniques are useful for a wide variety of applications that can run on the cluster 200. One example of an application that requires such a feature is a distributed transactional memory system.

[0076] A distributed transactional memory system is an example of an application that can be run on a cluster of nodes 200. The distributed memory system stores objects on nodes 210 within the cluster and provides a single global address space for accessing those objects (i.e., a single address space for all objects stored in the distributed memory system, regardless of which node 210 they currently reside on). This enables objects to be accessed without knowing on which of the nodes 210 the object resides.

[0077] In some examples, the distributed memory system replicates objects stored between nodes 210 of the cluster 200 so that identical copies of a particular object are stored by at least two nodes 210 in the cluster 200. In such examples, one of the copies may be identified as a primary or authoritative copy of the object, while the other is identified as a backup copy. By replicating copies of objects, the distributed memory system can continue to operate without any data loss in the event that one or more of the nodes 210 of the cluster 200 become unavailable (such as due to a hardware failure, for example).

[0078] Transactions that read and / or write data to the distributed memory system are also distributed among the nodes 210 of the cluster 200 and executed in parallel. This provides scalability for the distributed memory system, allowing for greater transaction throughput. However, when transactions are executed in parallel by different nodes 210 of the cluster 200, it is necessary to ensure correct serialization (and in some cases strict serialization) of the transactions.

[0079] Figure 7 An exemplary method 700 for executing a transaction including one or more read operations within a distributed transactional memory system operating on a cluster 200 of nodes is illustrated.

[0080] At optional operation 710, method 700 determines the maximum value of the master clock at the current time. In some examples, this is done by reference (as described above with respect to Figure 3 and Figure 4As discussed above, the uncertainty measure for the master clock is implemented by the node 210. However, in other examples, different techniques are used, such as assuming a predetermined "large" value for error in clock synchronization (which is not based on the time elapsed since the last synchronization).

[0081] At optional operation 720 , method 700 waits until the current minimum value of the master clock is after (ie, later than) the maximum value determined in operation 710 (as indicated by the uncertainty metric).

[0082] Optional operations 710 and 720 together enable method 700 to provide strict serialization of read transactions. However, in some examples, optional operations 710 and 720 are not performed, and method 700 begins at operation 730. Even if operations 710 and 720 are not performed, method 700 still guarantees correct serialization of read transactions (but not strict).

[0083] At operation 730, method 700 generates a read timestamp that is earlier than the minimum value of the master clock at the current time. When optional operations 710 and 720 are performed, the generated read timestamp is also after (or equal to) the maximum value of the master clock determined in operation 710. The read timestamp indicates a point in time at which the read transaction is considered to have occurred, which will be earlier than any possible current timestamp that may be provided by any of the nodes 210 in cluster 200. As discussed further below, the read timestamp may also determine which version of the object is read if the memory system is a multi-version memory system.

[0084] At operation 740, method 700 reads the object from the corresponding node 210 of the cluster 200 on which the object resides. In some examples, the object can be read using remote direct memory access (RDMA) so that the processor of the node 210 on which the object is located is not involved in reading the object. Each of the objects read is associated with a timestamp indicating when the object was created (which is the write timestamp of the transaction that wrote the object).

[0085] At operation 750, method 700 verifies that the timestamp associated with each of the objects is earlier than the read timestamp for the transaction. If any of the timestamps associated with the read objects represent a time after the read timestamp, then this means that the object has been written by a subsequent transaction.

[0086] Thus, at operation 760, if any of the timestamps associated with the read object indicates a time after the read timestamp, then the method 700 performs error handling for the read transaction because, if the transaction were to complete using the read object, an invalid result would be provided. In some examples, the error handling simply involves aborting the transaction. In other examples, the error handling involves attempting to find a previous version of the object in a form that existed at the time indicated by the read timestamp for the transaction. The transaction can then complete using the previous version of the object. This is discussed below with respect to Fig.10 Discussing in more detail, the diagram provides a method for reading a specific version of an object, and can be used to find the version of the object as it existed at the time of the read timestamp for a transaction.

[0087] However, if none of the timestamps associated with the read objects is later than the read timestamp, then method 700 continues to complete the read transaction using the objects that have been read.

[0088] Figure 8 An exemplary method for executing a transaction including one or more write operations within a distributed transactional memory system operating on a cluster 200 of nodes is illustrated.

[0089] At operation 810, method 800 reads the object to be written. Figure 7 As discussed, RDMA reads may be used to read objects residing on other nodes 210 in cluster 200. In reading an object to be written, operation 810 in some examples creates a temporary copy of the object upon which the write operation is performed before completing the transaction.

[0090] At operation 820, method 800 locks each of the objects to be written. Any conventional technique for locking objects may be used.

[0091] At operation 830, method 800 waits until each of the objects has been locked. Once an object is locked, other transactions operating on the object after this moment will see the lock and be able to determine that the object may be about to be written, even if other transactions are processed before the transaction is committed.

[0092] At operation 840, method 800 checks whether any of the objects to be written have changed since they were read and locked. This is achieved by checking that the timestamp associated with each object has not changed since it was read at operation 810.

[0093] If any of the objects has changed since it was read at operation 810, then method 800 performs error handling at operation 850 and aborts the transaction.

[0094] Otherwise, if none of the objects have changed since they were read at operation 810, then method 800 generates a write timestamp for the transaction at operation 860. The write timestamp represents the point in time at which the transaction is considered to have occurred. The write timestamp is generated so that it is after the maximum value of the master clock (at the point in time when all corresponding objects to be written have been locked). This can be determined using an uncertainty metric maintained at node 210.

[0095] At operation 870, method 800 waits until the current minimum value of the master clock (as indicated by the uncertainty metric maintained by the node) is after the write timestamp.

[0096] At operation 880 , method 800 performs a write operation on the object to be written, thereby completing the transaction.

[0097] By generating write timestamps in this manner (so that the write is unambiguously in the future relative to the master clock at the time the lock was acquired) and then waiting until the write timestamp is unambiguously in the past relative to the master clock (using an uncertainty measure), correct serialization of transactions between nodes 210 in cluster 200 can be ensured.

[0098] will realize that Figure 8 The method 800 shown in FIG. Figure 7 700 to handle transactions that include both read operations and write operations. In doing so, an additional check is performed to verify that the object that has been read (but not written) has not changed since the read timestamp. This check is in addition to the check performed during execution at operation 750 of method 700. This additional check is performed at Figure 8 880 occurs before (i.e., after waiting for the current minimum value of the master clock to be later than the write timestamp). Thus, for objects that are read but not written, two checks are performed to check that the object has not changed, one during the execution of the transaction and one immediately before the transaction is committed.

[0099] The above about Figure 7 and Figure 8The described method allows optimistic concurrency control to be used in a distributed transactional memory system. This means that it is possible to benefit from using remote direct memory access (RDMA) reads to read objects residing on one node 210 at another node 210 in a cluster 200, because the use of RDMA reads prevents the use of pessimistic concurrency control. Using RDMA reads to access objects helps improve the speed at which objects can be accessed by nodes 210 within the cluster, and helps prevent bottlenecks (because a remote node 210 can read an object residing on another node 210 without involving the processors of the other nodes 210).

[0100] In some examples, the distributed transactional memory system is a multi-version memory system. This means that the memory system can store previous versions of the objects it stores. Each of the previous versions of the object is associated with a version timestamp indicating the time when the version of the object was initially created (i.e., the write timestamp of the transaction that created the version of the object, not the write timestamp of the transaction that overwrote it).

[0101] Fig. 9 An exemplary method 900 for performing a read transaction in a multi-version transactional memory system is illustrated. A read transaction may request a specific version of an object to be read. The specific version represents the object as it existed at a specific point in time. Specifically, a read transaction has a read timestamp associated with it requesting the version of the object as it existed at the point in time indicated by the read transaction to be read.

[0102] At operation 910, method 900 retrieves the latest version of the object from the memory system.The memory allocated in each node 210 for storing the current version of the object may be separate from the memory allocated for storing the previous version of the object.

[0103] At operation 920, method 900 determines whether the version timestamp of the retrieved version of the object is older than the read timestamp. If it is, then the version of the object is the version of the object that existed at the time indicated by the read timestamp, and at operation 930, the version of the object is provided. Otherwise, an older version of the object is required.

[0104] At operation 940, method 900 determines whether the version history for the retrieved object has been truncated. In some examples, each version of the object is associated with a pointer indicating the memory address of the previous version of the object. In such examples, a null pointer value indicates that the version history has been truncated. However, in other examples, different techniques for indicating the truncation of the version history (such as using a bit flag in a memory allocation table) are used instead.

[0105] If the version history has been truncated, an error is encountered when a previous version of the object is needed for the transaction but is not available. Therefore, at operation 950, method 900 aborts the read transaction.

[0106] However, if the version history has not been truncated, the method 900 proceeds to retrieve the previous version of the object at operation 960. This is accomplished, for example, by following a pointer associated with the current version of the object that indicates the memory location of the previous version. The method iterates back to operation 920 to evaluate whether the previous version is the version of the object required for the read transaction.

[0107] Fig.10 An exemplary method 1000 for performing a write transaction in a multi-version transactional memory system is illustrated.

[0108] At operation 1010, method 1000 determines whether there is enough memory to store both the new version of the object and the current version of the object. In some examples, the memory allocated to store the current version of the object is different from the memory allocated to store the previous version. Therefore, determining whether there is enough memory involves determining whether there is enough space in the memory allocated to store the previous version to store a copy of the current version of the object and determining whether there is enough space in the memory to store the new version by overwriting the current version.

[0109] If there is not enough memory to store both versions of the object, then method 1000 truncates the version history for the object at operation 1020. In some examples, each version of an object in a multi-version memory system is associated with a pointer indicating a memory location where a previous version of the object was stored. In such examples, truncating the version history for the object is accomplished by setting the pointer to null in the new object.

[0110] Otherwise, if there is enough memory to store both versions of the object, then method 1000 allocates memory for storing a copy of the current version of the object at operation 1030. The method then creates a copy of the object in the allocated memory at operation 1040 and associates an indication of the location of the copy of the current version of the object with the new version of the object to be written. In some examples, the indication is provided by a pointer.

[0111] At operation 1060, method 1000 associates with the new version of the object an indication of whether the version history has been truncated. The indication may be provided, for example, by setting a flag associated with the object to a suitable value. Alternatively, the indication may be provided by the same pointer used to indicate the location of the current (soon to be previous) version of the object. Specifically, the pointer may be set to null to indicate that the version history has been truncated and to any other value to indicate that the version history has been maintained.

[0112] At operation 1070, method 1000 writes the new version of the object to the memory system, thereby replacing the current version. In some examples, the new version of the object is overwritten on the current version of the object (i.e., so that it occupies the same memory address). The previous version of the object is then provided by a copy (at the new memory address). This is advantageous when a remote direct memory access (RDMA) read is used to access an object residing on one node by another node, because it means that the global address for the current version of the object remains unchanged. However, other examples (such as those that do not utilize RDMA reads to read objects) can write the new version of the object to a newly allocated memory (with a memory address different from the current version of the object).

[0113] In some examples, methods 900 and 1000 are combined with the above Figure 7 and Figure 8The described methods for executing transactions involving read operations and write operations, respectively, are combined. However, in other examples, methods 900 and 100 can be performed independently of these methods 700 and 800. In either case, methods 900 and 1000 provide the ability for write operations to continue even when there is not enough space to store a copy of a previous version of an object. This means that there is no need to make the write operation wait until enough space to store the copy becomes available. Instead, the write operation can write the object and simply truncate its version history. In such a situation where the version history of the object is truncated, there is the possibility that the truncation of the history will not affect any future transactions. That is, there is the possibility that no future transactions will require the version of the object that has been truncated. However, even if they are required, the method 900 for reading the object can also detect that the version history has been truncated and simply abort the transaction, thereby preventing invalid data from being read. In addition, by allowing transactions to gracefully handle situations where a read operation encounters an object for which a previous version is needed but the version has been truncated, methods 900 and 1000 enable a distributed memory system to maintain only the previous version of an object on the same node 210 as the primary version of the object without replicating the previous version of the object to a node 210 storing a backup copy of the object. This is because, if a node were to fail, the backup copies of the object can be treated as if their version history had been truncated, which can be gracefully handled by the read transaction. Therefore, the amount of memory and processing and communication overhead required to maintain previous versions of objects in a distributed multi-version memory system can be greatly reduced.

[0114] In a multi-version memory system, it is desirable to keep previous versions of an object available only until such time that they will no longer be needed by any transaction running in the system. Otherwise, storing previous versions of objects that will no longer be used uses up memory. The process of identifying and freeing memory used by previous versions of objects that will no longer be used is called garbage collection. To aid in garbage collection, each previous version of an object stored in the memory system is associated with two timestamps, a first timestamp and a second timestamp, the first timestamp being the timestamp associated with the version of the object (that is, from this timestamp, the version of the object is current, and any earlier timestamp is before the object is created or associated with a previous version of the object), and the second timestamp being the write timestamp of the transaction that created the copy of the object as the previous version of the object (that is, the version of the object is the current latest timestamp, and any subsequent timestamps are associated with updated versions of the object). Although the first timestamp is used to determine whether the version of the object is the expected version for a particular timestamp, it is the second timestamp that is used to determine whether the version of the object is to be garbage collected.

[0115] The distributed multi-version memory system supports distributed transactions. That is, one of the nodes 210 can start a transaction at a specific read time and "fan-out" the transaction by providing it to multiple other nodes for processing.

[0116] Fig.11 An exemplary method 1100 for performing garbage collection on previous versions of an object stored at a node 210 in a distributed multi-version memory system is illustrated.

[0117] At operation 1110, method 1100 maintains a first local timestamp indicating a read time of the oldest transaction currently being processed by node 210. As old transactions are completed on node 210, the local timestamp is updated to reflect the read timestamp of the new oldest transaction. Although node 210 can guarantee that no transaction on the node will require any previous versions of the object older than the first local timestamp, it is possible that transactions currently being processed by nodes in other nodes 210 may still require access to those previous versions.

[0118] At operation 1120, the method 1100 provides the first local timestamp to the master node 210 for the cluster 200. The master node 210 determines the oldest active transaction for the cluster 200 from each of the timestamps received from the slave nodes 210 and provides the read timestamp of the oldest active transaction for the cluster 200 back to the slave nodes 210 as the first global timestamp.

[0119] At operation 1130, the method 1100 receives a first global timestamp from the master node 210. The first global timestamp corresponds to the earliest first local timestamp recorded by any node 210 in the cluster 200 (ie, the first global timestamp provides a read timestamp of the oldest active transaction in the cluster).

[0120] At operation 1140, the method 1100 stores the first global timestamp. The first global timestamp that is stored is the most recently received first global timestamp, overwriting any previously received first global timestamp.

[0121] At operation 1150 , the method 1100 rejects any transactions having a read timestamp older than the first global timestamp.

[0122] At operation 1160, method 1100 provides the currently stored first global timestamp to master node 210. Master node 210 determines the earliest first global timestamp still stored by any of nodes 210 in the cluster and provides the earliest first global timestamp for cluster 200 back to slave node 210 as the second global timestamp.

[0123] At operation 1170, method 1100 receives a second global timestamp from master node 210. The second global timestamp may be earlier than the first global timestamp already stored at the node. Specifically, this may occur when one (or more) of nodes 210 in cluster 200 has not received an updated first global timestamp when the current second global timestamp is generated.

[0124] At operation 1180, the method 1100 stores the second global timestamp. The stored second global timestamp is the most recently received second global timestamp, overwriting any previously received second global timestamp.

[0125] At operation 1190, method 1100 performs garbage collection of any previous versions of the object that have a write timestamp that is less than the stored second global timestamp (that is, the write timestamp of the transaction that created a copy of the object before overwriting it as the previous version). In essence, garbage collection of previous versions deallocates memory that was allocated to store those previous versions, making it available for future use. This means that it is important to ensure that a previous version is not read after it has been garbage collected, as the data may have been corrupted by subsequent writes to the deallocated memory space.

[0126] It should be noted that although the first global timestamp can be used as a garbage collection point in a memory system that does not support parallel execution of transactions across clusters, it is not sufficient to ensure that when parallel execution of transactions across clusters is supported, no previous versions that may still be needed are garbage collected. This is because, when a distributed transaction with a specific read timestamp is created within the system, the node that sends the transaction can transmit the transaction to another machine for execution and may fail before the transaction is received by other machines. This means that the first global timestamp can be carried out of the read timestamp of the distributed transaction before it is received by other machines, because none of the remaining nodes in the cluster know the read timestamp for the distributed transaction after the initiating node has failed. This means that some of the nodes in the cluster can start to perform garbage collection on previous versions of objects with timestamps later than the read timestamp of the distributed transaction. At the same time, the distributed transaction can be subsequently received by other nodes before the new first global value is received by other nodes (the receipt of the transaction can be postponed, for example due to network congestion). Since other nodes do not yet know the new first global value, they cannot reject the distributed transaction. However, since other nodes in the system may have garbage collected the previous version of the object that the distributed transaction depends on, the result of processing the distributed transaction will be incorrect. Therefore, it is necessary to generate a second global timestamp as described above to prevent this from happening.

[0127] It will be appreciated that generation of the first and second global timestamps for the cluster is ongoing such that the current first and second global timestamps will advance as transactions are completed within the cluster 200 .

[0128] In some examples, method 1100 can be combined with the above Fig. 9 and Fig.10 The method described for writing and reading previous versions of an object to a distributed multi-version memory system is performed. However, in other examples, method 1100 can be performed independently of those methods 900 and 1000. Method 1100 allows previous versions of an object to be garbage collected within the memory system at the earliest opportunity (thereby saving memory) while ensuring that no transactions currently being processed in the distributed system may still need to access them.

[0129] Alternatively or additionally, the functions described herein are at least partially performed by one or more hardware logic components. For example, but not limited to, illustrative types of hardware logic components that may be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), graphics processing units (GPUs), etc.

[0130] As an alternative or in addition to other examples described herein, the examples include any combination of the following numbered paragraphs (NP):

[0131] NP1. A method, performed by a new master node in a cluster of nodes to establish a master clock using a local clock on the new master node after reconfiguration of the nodes included in the cluster, wherein each of the nodes in the cluster includes a corresponding local clock synchronized to the master clock, the master clock being provided by the old master node prior to the reconfiguration, the method comprising: sending a message to other nodes in the cluster of nodes instructing them to disable their corresponding local clocks; receiving corresponding confirmations from other nodes in the cluster of nodes indicating that their corresponding local clocks have been disabled; identifying a time at which all leases of any node that has been removed from the cluster of nodes by the reconfiguration will have expired; waiting until the identified time has passed; determining the maximum value that the master clock provided by the old master node would have been at the identified time; setting the local clock to be greater than the maximum value; and instructing other nodes in the cluster of nodes to re-enable their corresponding local clocks.

[0132] NP2. A method according to NP1, wherein: each of the nodes in the cluster also maintains a corresponding uncertainty metric for their corresponding local clock, the corresponding uncertainty metric indicating a maximum value of the master clock based on a predetermined maximum rate of clock drift and the amount of time that has passed since the corresponding local clock was last synchronized with the master clock; and determining the maximum value that the master clock provided by the old master node would have been at the identified time includes: determining the maximum value from the corresponding uncertainty metrics maintained by all nodes that existed in the cluster before reconfiguration and are still in the cluster after reconfiguration based on synchronization with the old master node before reconfiguration.

[0133] NP3. A method according to NP2, wherein confirmations received from other nodes in the node's cluster indicating that their respective local clocks have been disabled include: corresponding indications of a maximum value of the master clock based on an uncertainty measure maintained by the node when the node existed in the cluster prior to the reconfiguration based on synchronization with an old master node prior to the reconfiguration.

[0134] NP4. A method according to any of NP1-3, wherein the new master node does not exist in the cluster of nodes before reconfiguration.

[0135] NP5. A method according to any one of NP1-4, wherein instructing other nodes in the cluster of nodes to re-enable their respective local clocks comprises: sending a message to the other nodes in the cluster of nodes instructing them to re-enable their respective local clocks.

[0136] NP6. The method of any of NP1-4, wherein instructing other nodes in the cluster of nodes to re-enable their respective local clocks comprises responding to requests from the other nodes to synchronize with the master clock.

[0137] NP7. A method performed by a slave node in a cluster of nodes to synchronize the local clock of the slave node with the master clock for the cluster of nodes, the master clock being provided by the master node of the cluster of nodes, the method comprising: synchronizing the local clock with the master node; receiving an indication of a new configuration for the cluster, the new configuration indicating a new master node for the cluster; receiving a message from the new master node instructing the slave node to disable the local clock; disabling the local clock; sending a message to the new master node indicating that the local clock has been disabled; receiving an indication from the new master node that the local clock should be re-enabled; and synchronizing the local clock based on a timestamp received from the new master node.

[0138] NP8. A method according to NP7, wherein the method further comprises: maintaining an uncertainty metric for a local clock, the uncertainty metric indicating a maximum value of the master clock based on a predetermined maximum rate of clock drift and an amount of time that has elapsed since the corresponding local clock was last synchronized with the master clock; and providing an indication of the maximum value of the master clock indicated by the uncertainty metric maintained based on synchronization with the master node to the new master node.

[0139] NP9. A method according to NP8, wherein the message sent to the new master node indicating that the local clock has been disabled includes an indication of a maximum value of the master clock.

[0140] NP10. A method according to any one of NP7-9, wherein the method further comprises: receiving a message from the master node instructing the slave node to re-enable the local clock.

[0141] NP11. A method according to any one of NP7-9, wherein the method further comprises: sending one or more synchronization requests to a new master node, wherein an indication that the local clock should be re-enabled is provided by the master node in response to one of the synchronization requests.

[0142] NP12. A method according to any one of NP7-12, wherein the cluster of nodes utilizes a configuration protocol for reconfiguring the cluster of nodes and selecting a node for managing the configuration of the cluster of nodes, wherein the master clock is provided by the node selected for managing the configuration of the cluster.

[0143] NP13. A method according to NP12, wherein one or more or all of the following are provided by inserting additional information into the message of the configuration protocol: a message from the new master node instructing the slave node to disable the local clock; a message from the slave node to the new master node indicating that the local clock has been disabled; and an indication from the new master node to the slave node that the local clock should be re-enabled.

[0144] NP14. A method according to NP8, wherein the slave node includes two or more threads, each thread is associated with a corresponding local clock, and synchronizing the local clock to the master node includes: synchronizing each corresponding local clock with a remote clock by the following operations in each thread: storing a first value for the local clock of the thread; receiving a remote timestamp indicating the current value of the remote clock from the master node; storing a second value for the local clock of the thread when the remote timestamp is received; and setting the local clock for the thread to the current value of the remote clock based on the remote timestamp; wherein the method further includes: for each thread in the threads, based on the remote timestamp received by the thread, the amount of time that has passed since the first value stored for the thread according to the corresponding local clock , and a predetermined maximum rate of clock drift; determining, for each thread in the threads, a corresponding minimum value of the remote clock based on a remote timestamp received by the thread, an amount of time elapsed since a second value stored for the thread according to the corresponding local clock, and a predetermined minimum rate of clock drift; determining a lowest maximum value of the remote clock from among the corresponding maximum values ​​determined for each thread in the threads; determining a largest minimum value of the remote clock from among the corresponding minimum values ​​determined for each thread in the threads; and providing an indication of the lowest maximum value and the largest minimum value of the remote clock as an uncertainty measure for a local timestamp provided by each of the corresponding local clocks.

[0145] NP15. The method of NP14, wherein one or more of the threads receive a remote timestamp from the master node via a communication protocol different from a communication protocol used by other threads.

[0146] NP16. The method of NP14 or NP15, wherein one or more of the threads receive a remote timestamp from the master node via a communication medium different from a communication medium used by other threads.

[0147] NP17. A method according to any one of NP14-16, wherein synchronizing each corresponding local clock with the remote clock further comprises: requesting a timestamp of the remote clock from the master node, wherein the first value of the stored local clock is the value of the local clock when the request is sent to the master node.

[0148] NP18. A method according to any one of NP14-17, wherein the method further includes: determining, for each thread, whether an actual rate of drift experienced by a local clock exceeds a predetermined maximum rate or a predetermined minimum rate of drift based on stored first values ​​and second values ​​associated with two separate synchronizations; and disabling a slave node in response to determining that a received remote timestamp is lower than a determined maximum minimum value or higher than a determined lowest maximum value of a remote clock for the thread.

[0149] NP19. A system for use in a cluster of nodes, the system comprising: a local clock; and a clock synchronization module, which is arranged to synchronize to a master clock for the cluster of nodes provided by a master node in the cluster of nodes, wherein, after receiving a new configuration for the cluster indicating a new master node, the clock synchronization module is arranged to: disable the local clock in response to receiving a message from the new master node instructing the slave node to disable the local clock; send a message to the new master node indicating that the local clock has been disabled; re-enable the local clock in response to receiving an indication from the new master node that the local clock should be re-enabled; and synchronize the local clock based on a timestamp received from the master node.

[0150] NP20. A system according to NP19, wherein the system further comprises two or more processing cores, each core having a corresponding local clock, and the clock synchronization module comprises two or more synchronization threads, the two or more synchronization threads being arranged to be executed on corresponding processing cores in the two or more processing cores to synchronize the corresponding local clocks for the corresponding processing cores in the two or more processing cores by: storing a first value of the local clock for the thread; receiving a remote timestamp indicating a current value of the remote clock from a master node; storing a second value of the local clock for the thread when the remote timestamp is received; and setting the local clock for the thread to the current value of the remote clock based on the remote timestamp, wherein the clock synchronization module is further configured to: for each of the threads, based on the remote timestamp received by the thread, determining, for each of the threads, a respective maximum value of the remote clock based on an amount of time that has passed since a first value stored for the thread according to the respective local clock, and a predetermined maximum rate of clock drift; determining, for each of the threads, a respective minimum value of the remote clock based on a remote timestamp received by the thread, an amount of time that has passed since a second value stored for the thread according to the respective local clock, and a predetermined minimum rate of clock drift; determining, from among the respective maximum values ​​determined for each of the threads, a lowest maximum value of the remote clock; determining, from among the respective minimum values ​​determined for each of the threads, a greatest minimum value of the remote clock; and providing an indication of the lowest maximum value and greatest minimum value of the remote clock as a measure of uncertainty for a local timestamp provided by each of the respective local clocks.

[0151] NP21. A method for executing a transaction at a node in a cluster of nodes, the transaction including one or more read operations to read corresponding objects in a distributed transactional memory system, wherein the node includes a local clock synchronized with a master clock of the cluster of nodes and maintains an uncertainty measure indicating a current minimum value and a current maximum value of the master clock, the method comprising: generating a read timestamp representing a time point earlier than the current minimum value of the master clock, the read timestamp representing a time point at which the read operation of the transaction is considered to have occurred; performing one or more read operations to read the corresponding objects; for each of the corresponding objects, determining whether a timestamp associated with the object representing a time point at which the object was written indicates a time after the time indicated by the read timestamp; in response to determining that a timestamp associated with one of the corresponding objects indicates a time after the time indicated by the read timestamp, performing an error handling process for the object.

[0152] NP22. The method according to NP21 also includes, before generating a read timestamp: determining the maximum value of the master clock at a current point in time based on an uncertainty measure; and waiting until the current minimum value of the master clock indicated by the uncertainty measure is after the previously determined maximum value of the master clock, wherein the time point represented by the generated read timestamp is after or equal to the determined maximum value of the master clock.

[0153] NP23. A method according to NP21 or NP22, wherein the error handling process includes aborting the transaction.

[0154] NP24. A method according to NP21 or NP22, wherein the memory system is a multi-version memory system, and the error handling process is responsive to determining that an object is associated with a pointer indicating a location of a previous version of the object stored by a distributed transactional memory system: reading the previous version of the object from the location indicated by the pointer; in response to determining that a timestamp associated with the previous version of the object indicates a time before or equal to a time indicated by the read timestamp, using the previous version of the object to complete a transaction; and in response to determining that the timestamp associated with the previous version of the object indicates a time after the time indicated by the read timestamp, re-executing the error handling process with respect to the previous version of the object.

[0155] NP25. A method according to any one of NP21-24, wherein one or more of the corresponding objects read by the read operation are stored locally on the node.

[0156] NP26. A method according to any one of NP21-25, wherein one or more of the corresponding objects read by the read operation are stored remotely on another node in the cluster of nodes.

[0157] NP27. A method according to any one of NP21-26, wherein the memory system is a multi-version memory system, and the read operation is arranged to read a specific version of an object stored in the multi-version memory system, the specific version representing the object when it existed at a specific point in time, the method further comprising: determining that a previous version of the object is required based on a timestamp associated with the retrieved version of the object indicating a time point after the specific time point; determining whether the version history for the retrieved version of the object has been truncated; in response to determining that the version history for the retrieved version of the object has been truncated, providing an error; in response to determining that the version history for the retrieved version of the object has not been truncated, retrieving the previous version of the object and repeating the previous steps with respect to the previous version of the object until a version of the object having an associated timestamp indicating a time point before or equal to the specific time point is retrieved or an error is provided.

[0158] NP28. A method according to NP27, wherein: each version of an object is associated with a corresponding pointer indicating the location of a previous version of the object; and determining whether the version history for the retrieved version of the object has been truncated includes determining whether the value of the corresponding pointer for the retrieved version of the object is null.

[0159] NP 29. A method for executing a transaction at a node in a cluster of nodes, the transaction comprising one or more write operations to corresponding objects in a distributed transactional memory system, wherein the node comprises a local clock synchronized with a master clock of the cluster of nodes and maintains an uncertainty metric indicating a current minimum value and a current maximum value of the master clock, the method comprising: reading the corresponding objects to be written; locking the corresponding objects to be written by the one or more write operations; for each object in the corresponding objects for which a lock is obtained, determining that a timestamp representing a point in time associated with the object has not changed since it was read; generating a write timestamp representing a point in time at which the write operation of the transaction is believed to have occurred based on the uncertainty metric, the time point represented by the write timestamp being after the maximum value of the master clock at the time points at which all corresponding objects to be written have been locked; waiting until the current minimum value of the master clock indicated by the uncertainty metric is after the time represented by the write timestamp; performing the one or more write operations on the corresponding objects to be written, and committing the transaction by unlocking the corresponding objects, wherein performing the one or more write operations comprises associating the corresponding objects to be written with the write timestamp.

[0160] NP30. A method according to NP29, wherein the memory system is a multi-version memory system, and the method further includes: determining whether the version history for an object should be truncated based on whether there is sufficient memory available to store both a new version of the object and a current version of the object; associating an indication of whether the version history for the object has been truncated with the new version of the object; and when the version history for the object should not be truncated, associating an indication of the location of a copy of the current version of the object with the new version of the object; and writing the new version of the object to the multi-version transactional memory system.

[0161] NP31. A method according to NP30, wherein the indication of whether the version history for the object has been truncated includes a pointer that provides an indication of the location of a copy of the current version of the object when the version history is to be maintained, or provides a null value when the version history is to be truncated.

[0162] NP32. The method according to NP30 or NP31 also includes, in response to determining that a version history for an object should be maintained: allocating memory for storing a copy of a current version of the object; and creating a copy of the current version of the object in the allocated memory, wherein the new version is overwritten on the current version of the object and an indication of the location of the copy of the current version of the object indicates the allocated memory.

[0163] NP33. A method according to any of NP32, wherein each node in the cluster is arranged to perform remote direct memory access reads to read and write objects stored on other nodes in the cluster.

[0164] NP34. A method according to any one of NP21-33, wherein the memory system is a multi-version memory system, and the method further includes: maintaining a first local timestamp indicating a read time of the oldest transaction currently being processed by the node; providing the first local timestamp to a master node in a cluster of nodes; receiving from the master node a first global timestamp corresponding to the earliest first local timestamp received by the master node from a node in the cluster; storing the first global timestamp, the stored first global timestamp being the most recently received first global timestamp; rejecting any transaction including a read timestamp indicating a time older than the stored first global timestamp; providing the stored first global timestamp to the master node; receiving from the master node a second global timestamp corresponding to the earliest stored first global timestamp received by the master node from a node in the cluster; storing the second global timestamp, the stored second global timestamp being the most recently received second global timestamp; and performing garbage collection on each of multiple previous versions of the object stored on the node when the corresponding write timestamp associated with the previous version is less than the stored second global timestamp.

[0165] NP35. A system for a node in a cluster of nodes forming a distributed transactional memory system, the system comprising: a local clock; a clock synchronization module configured to synchronize the local clock with a master clock of the cluster of nodes and maintain an uncertainty measure indicating a current minimum value and a current maximum value of the master clock; and a transaction processing module arranged to perform a transaction including one or more read operations to read corresponding objects in the distributed transactional memory system by: generating a read timestamp from the local clock indicating a time point earlier than a current minimum value of the master clock, the read timestamp indicating a time point at which the read operation of the transaction is considered to have occurred; performing one or more read operations to read corresponding objects; for each of the corresponding objects, determining whether a timestamp associated with the object indicating a time point at which the object was written indicates a time after the time indicated by the read timestamp; and in response to determining that the timestamp associated with one of the corresponding objects indicates a time after the time indicated by the read timestamp, performing an error handling process for the object.

[0166] NP36. A system according to NP35, wherein, before generating a read timestamp, the transaction processing module is further arranged to: determine a maximum value of the master clock at a current point in time based on an uncertainty measure; and wait until a current minimum value of the master clock indicated by the uncertainty measure is after a previously determined maximum value of the master clock, wherein the time point represented by the generated read timestamp is after or equal to the determined maximum value of the master clock.

[0167] NP37. A method according to NP35 or NP36, wherein the memory system is a multi-version memory system, and the transaction processing module is further arranged to perform an error handling process by: in response to determining that an object is associated with a pointer indicating a location of a previous version of the object stored by the distributed transactional memory system: reading the previous version of the object from the location indicated by the pointer; in response to determining that a timestamp associated with the previous version of the object indicates a time before or equal to a time indicated by the read timestamp, using the previous version of the object to complete the transaction; and in response to determining that the timestamp associated with the previous version of the object indicates a time after the time indicated by the read timestamp, re-executing the error handling process with respect to the previous version of the object.

[0168] NP38. A system according to any one of NP35-37, wherein the transaction processing module is further arranged to process a read operation, the read operation reading a specific version of an object stored in a multi-version memory system, the specific version representing the object as it existed at a specific point in time by: determining that a previous version of the object is needed based on a timestamp associated with the retrieved version of the object indicating a time point after the specific time point; determining whether the version history for the retrieved version of the object has been truncated; in response to determining that the version history for the retrieved version of the object has been truncated, providing an error; and in response to determining that the version history for the retrieved version of the object has not been truncated, retrieving the previous version of the object and repeating the previous steps with respect to the previous version of the object until a version of the object having an associated timestamp indicating a time point before or equal to the specific time point is retrieved or an error is provided.

[0169] NP39. A system according to any one of NP35-38, wherein the transaction processing module is further arranged to perform a transaction including one or more write operations to corresponding objects in a distributed transactional memory system by: reading the corresponding objects to be written; locking the corresponding objects to be written by the one or more write operations; for each object in the corresponding objects for which a lock is obtained, determining that a timestamp representing a time point associated with the object has not changed since it was read; generating a write timestamp representing a time point at which the write operation of the transaction is believed to have occurred based on an uncertainty measure, the time point represented by the write timestamp being within the time point of the corresponding objects to be written; after the maximum value of the master clock at a time point at which the corresponding object has been locked; waiting until the current minimum value of the master clock indicated by the uncertainty measure is after the time indicated by the write timestamp; after waiting until the current minimum value of the master clock is after the time indicated by the write timestamp, determining that the corresponding timestamp associated with each of the corresponding objects read by one or more read operations is still after the time indicated by the read timestamp; performing one or more write operations on the corresponding objects to be written and committing the transaction by unlocking the corresponding objects, wherein performing the one or more write operations includes associating the corresponding objects to be written with the write timestamp.

[0170] NP40. A system according to any one of NP35-39, wherein the memory system is a multi-version memory system, and the system also includes a garbage collection module, which is arranged to release memory used by previous versions of objects stored in the memory system by: maintaining a first local timestamp indicating a read time of the oldest transaction currently being processed by the node; providing the first local timestamp to a master node in a cluster of nodes; receiving from the master node a first global timestamp corresponding to the earliest first local timestamp received by the master node from a node in the cluster; storing the first global timestamp, the stored first global timestamp being the most recently received first global timestamp; reject any transaction that includes a read timestamp indicating a time older than the stored first global timestamp; provide the stored first global timestamp to the master node; receive from the master node a second global timestamp corresponding to the earliest stored first global timestamp received by the master node from a node in the cluster; store the second global timestamp, the stored second global timestamp being the most recently received second global timestamp; and perform garbage collection on each of multiple previous versions of the object stored on the node when the corresponding write timestamp associated with the previous version is less than the stored second global timestamp.

[0171] NP41. A method for performing garbage collection in a distributed multi-version transactional memory system, the distributed multi-version transactional memory system being provided by a cluster of nodes, the method comprising: at a node in the cluster: maintaining a first local timestamp indicating a read time of the oldest transaction currently being processed by the node; providing the first local timestamp to a master node in the cluster of nodes; receiving from the master node a first global timestamp corresponding to the earliest first local timestamp received by the master node from a node in the cluster; storing the first global timestamp, the stored first global timestamp being the most recently received first global timestamp; rejecting any transaction including a read timestamp indicating a time older than the stored first global timestamp; providing the stored first global timestamp to the master node; receiving from the master node a second global timestamp corresponding to the earliest stored first global timestamp received by the master node from a node in the cluster; storing the second global timestamp, the stored second global timestamp being the most recently received second global timestamp; and performing garbage collection on each of multiple previous versions of an object stored on the node when the corresponding write timestamp associated with the previous version is less than the stored second global timestamp.

[0172] NP42. A method for writing a new version of an object in a multi-version memory system, the method comprising: determining whether the version history for an object should be truncated based on whether there is sufficient memory available to store both the new version of the object and the current version of the object; associating an indication of whether the version history for the object has been truncated with the new version of the object; and when the version history for the object should not be truncated, associating an indication of the location of a copy of the current version of the object with the new version of the object; and writing the new version of the object to the multi-version transactional memory system.

[0173] NP43. A method according to NP42, wherein the indication of whether the version history for the object has been truncated includes a pointer that provides an indication of the location of a copy of the current version of the object when the version history is to be maintained, or provides a null value when the version history is to be truncated.

[0174] NP44. The method according to NP42 or NP43 also includes, in response to determining that a version history for an object should be maintained: allocating memory for storing a copy of a current version of the object; and creating a copy of the current version of the object in the allocated memory, wherein the new version is overwritten on the current version of the object and an indication of the location of the copy of the current version of the object indicates the allocated memory.

[0175] NP45. A method for reading a specific version of an object stored in a multi-version memory system, the specific version representing the object as it existed at a specific point in time, the method comprising: determining that a previous version of the object is required based on a timestamp associated with the retrieved version of the object indicating a time point after the specific point in time; determining whether the version history for the retrieved version of the object has been truncated; in response to determining that the version history for the retrieved version of the object has been truncated, providing an error; in response to determining that the version history for the retrieved version of the object has not been truncated, retrieving the previous version of the object and repeating the previous steps with respect to the previous version of the object until a version of the object having an associated timestamp indicating a time point before or equal to the specific point in time is retrieved or an error is provided.

[0176] NP46. A method according to NP45, wherein: each version of an object is associated with a corresponding pointer indicating the location of a previous version of the object; and determining whether the version history for the retrieved version of the object has been truncated includes determining whether the value of the corresponding pointer for the retrieved version of the object is null.

[0177] NP47. A method for synchronizing a slave node in a cluster of nodes with a remote clock at a master node in the cluster of nodes, the slave node comprising two or more threads, each thread being associated with a corresponding local clock, the method comprising: synchronizing each corresponding local clock with the remote clock in each thread by: storing a first value for the local clock of the thread; receiving a remote timestamp indicating the current value of the remote clock from the master node; storing a second value for the local clock of the thread when the remote timestamp is received; and setting the local clock for the thread to the current value of the remote clock based on the remote timestamp; for each thread in the threads, based on the remote timestamp received by the thread, the time elapsed since the first value stored for the thread according to the corresponding local clock the amount of time that has passed since a second value was stored for the thread according to the corresponding local clock, and a predetermined maximum rate of clock drift; determining, for each thread in the threads, a corresponding minimum value of the remote clock based on a remote timestamp received by the thread, the amount of time that has passed since a second value was stored for the thread according to the corresponding local clock, and a predetermined minimum rate of clock drift; determining, from among the corresponding maximum values ​​determined for each of the threads, a lowest maximum value of the remote clock; determining, from among the corresponding minimum values ​​determined for each of the threads, a largest minimum value of the remote clock; and providing an indication of the lowest maximum value and the largest minimum value of the remote clock as an uncertainty measure for a local timestamp provided by each of the corresponding local clocks.

[0178] NP48. The method of NP47, wherein one or more of the threads receive a remote timestamp from a master node via a communication protocol different from a communication protocol used by other threads.

[0179] NP49. A method according to NP47 or NP48, wherein one or more of the threads receive a remote timestamp from the master node via a communication medium different from a communication medium used by other threads.

[0180] NP50. A method according to any one of NP47-49, wherein synchronizing each corresponding local clock with the remote clock further comprises: requesting a timestamp of the remote clock from the master node, wherein the first value of the stored local clock is the value of the local clock when the request is sent to the master node.

[0181] NP51. A method according to any one of NP47-50, wherein the method further includes: determining, for each thread, whether an actual rate of drift experienced by a local clock exceeds a predetermined maximum rate or a predetermined minimum rate of drift based on stored first values ​​and second values ​​associated with two separate synchronizations; and disabling a slave node in response to determining that a received remote timestamp is lower than a determined maximum minimum value or higher than a determined lowest maximum value of a remote clock for the thread.

[0182] The term "computer" or "computer-based device" is used herein to refer to any device having processing capabilities that enable it to execute instructions. Those skilled in the art will appreciate that such processing capabilities are incorporated into many different devices and therefore the terms "computer" and "computing-based device" both include personal computers (PCs), servers, mobile phones (including smartphones), tablet computers, set-top boxes, media players, game consoles, personal digital assistants, wearable computers, and many other devices.

[0183] In some examples, the methods described herein are performed by software in a machine-readable form on a tangible storage medium, such as in the form of a computer program, the computer program including computer program code modules adapted to perform all operations of one or more of the methods described herein when the program is run on a computer, and wherein the computer program may be embodied on a computer-readable medium. The software is suitable for execution on a parallel processor or a serial processor so that the method operations can be performed in any suitable order or simultaneously.

[0184] This recognizes that software is a valuable, separately tradable commodity. It is intended to cover software that runs on or controls "dumb" or standard hardware to perform a desired function. It is also intended to cover software that describes or defines the configuration of hardware, such as HDL (Hardware Description Language) software used to design silicon chips or to configure general-purpose programmable chips to perform a desired function.

[0185] Those skilled in the art will appreciate that the storage device for storing program instructions is optionally distributed across a network. For example, a remote computer can store an example of the described process as software. A local or terminal computer can access a remote computer and download part or all of the software to run the program. Alternatively, a local computer can download a fragment of the software as needed, or execute some software instructions at a local terminal and execute some software instructions at a remote computer (or computer network). Those skilled in the art will also appreciate that by utilizing conventional techniques known to those skilled in the art, all or part of the software instructions can be executed by a dedicated circuit (such as a digital signal processor (DSP), a programmable logic array, etc.).

[0186] Any range or device value given herein may be expanded or altered without losing the effect sought, as will be apparent to the skilled artisan.

[0187] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

[0188] It will be understood that the benefits and advantages described above may relate to one embodiment or may relate to several embodiments. The embodiments are not limited to those that solve any or all of the stated problems or have any or all of the stated benefits and advantages. It will also be understood that reference to "an" item refers to one or more of those items.

[0189] The operation of the method described herein can be performed in any suitable order or performed simultaneously in suitable circumstances. Additional, individual frame can be deleted from any method in the method without departing from the scope of the subject matter described herein. Any aspect in the example described above can be combined with any aspect in other examples described to form other examples without losing the effect sought.

[0190] The term "comprising" is used herein to mean including the identified method blocks or elements, but such blocks or elements do not comprise an exclusive list and the method or apparatus may include additional blocks or elements.

[0191] It will be understood that the above description is given by way of example only and various modifications may be made by those skilled in the art. The above description, examples and data provide a complete description of the structure and use of the exemplary embodiments. Although various embodiments have been described above with some degree of particularity or with reference to one or more individual embodiments, those skilled in the art will be able to make many changes to the disclosed embodiments without departing from the scope of this specification.

Claims

1. A method performed by a new master node in a cluster of nodes, the method for establishing a master clock using a local clock on the new master node after reconfiguration of the nodes included in the cluster, wherein each of the nodes in the cluster comprises a respective local clock synchronized to the master clock, the master clock being provided by an old master node before the reconfiguration, the method comprising: sending a message to other nodes in said cluster of nodes instructing them to disable their respective local clocks; receiving respective acknowledgments from said other nodes in said cluster of nodes indicating that their respective local clocks have been disabled; identifying a time at which all leases of any node that has been removed from said cluster of nodes by said reconfiguration are to expire; determining a maximum value of the master clock provided by the old master node from the identified time; generating a write timestamp for an object of a node in the cluster of nodes to be set later than the maximum value of the master clock at a write time; as well as The write timestamp is transmitted to the node to schedule a write operation of the object to the node.

2. The method according to claim 1, wherein: each of said nodes in said cluster further maintaining a respective uncertainty metric for their respective local clock, said respective uncertainty metric indicating said maximum value of said master clock based on a predetermined maximum rate of clock drift and an amount of time that has elapsed since a last synchronization of said respective local clock with said master clock; and Determining the maximum value that the master clock provided by the old master node would have been at the identified time includes: determining the maximum value from the corresponding uncertainty metrics maintained by all nodes that existed in the cluster before the reconfiguration and are still in the cluster after the reconfiguration based on synchronization with the old master node before the reconfiguration.

3. The method of claim 2, wherein the confirmation received from the other nodes in the cluster of nodes indicating that their respective local clocks have been disabled comprises: A corresponding indication of the maximum value of the master clock based on the uncertainty metric maintained by the node from synchronization with the old master node prior to the reconfiguration when the node existed in the cluster prior to the reconfiguration.

4. The method of claim 1, wherein the new master node does not exist in the cluster of nodes prior to the reconfiguration.

5. The method of claim 1 , wherein instructing the other nodes in the cluster of nodes to re-enable their respective local clocks comprises: A message is sent to the other nodes in the cluster of nodes instructing them to re-enable their respective local clocks.

6. The method of claim 1 , wherein instructing the other nodes in the cluster of nodes to re-enable their respective local clocks comprises: Responding to requests from the other nodes to synchronize with the master clock.

7. A method performed by a new master node in a cluster of nodes, the method for establishing a master clock using a local clock on the new master node after reconfiguration of the nodes included in the cluster, wherein each of the nodes in the cluster includes a respective local clock synchronized to the master clock, the master clock being provided by an old master node prior to the reconfiguration, the method comprising: sending a message to other nodes in said cluster of nodes instructing them to disable their respective local clocks; identifying a time at which all leases of any node that has been removed from said cluster of nodes by said reconfiguration are to expire; determining a maximum value of the master clock provided by the old master node from the identified time; identifying a particular node in the cluster of nodes having a write operation to be performed; generating a write timestamp for the object of the specific node, wherein the write timestamp is set to be later than the maximum value of the master clock at the write time; as well as The write timestamp is transmitted to the specific node to schedule the write operation.

8. The method according to claim 7, wherein the method further comprises: An uncertainty metric is maintained for a local clock, the uncertainty metric indicating the maximum value of the master clock based on a predetermined maximum rate of clock drift and an amount of time that has elapsed since a last synchronization of the corresponding local clock with the master clock.

9. The method of claim 7, wherein the particular node of the cluster of nodes is determined to have performed a read operation but not the write operation.

10. The method of claim 7, wherein the particular node comprises two or more threads, each thread being associated with a respective local clock that is synchronized to the new master node by the following operations, the operations comprising: In each thread, synchronize each corresponding local clock with the remote clock by doing the following: storing a first value of the local clock for the thread; receiving, from the old master node, a remote timestamp indicating a current value of the remote clock; storing a second value of the local clock for the thread at the time when the remote timestamp was received; as well as The local clock for the thread is set to the current value of the remote clock based on the remote timestamp.

11. The method according to claim 10, wherein the method further comprises: determining, for each of the threads, a respective maximum value of the remote clock based on the remote timestamp received by the thread, an amount of time that has elapsed since the first value stored for the thread according to the respective local clock, and a predetermined maximum rate of clock drift; determining, for each of the threads, a respective minimum value of the remote clock based on the remote timestamp received by the thread, an amount of time that has elapsed since the second value stored for the thread according to the respective local clock, and a predetermined minimum rate of clock drift; determining a lowest maximum value for the remote clock from among the respective maximum values ​​determined for each of the threads; determining a greatest minimum value of the remote clock from among the corresponding minimum values ​​determined for each of the threads; as well as An indication of the lowest maximum value and the largest minimum value of the remote clock is provided as the uncertainty measure for a local timestamp provided by each of the respective local clocks.

12. The method of claim 10, wherein one or more of the threads receive the remote timestamp from the old master node via a communication medium different from a communication medium used by other threads.

13. The method according to claim 10 further includes synchronizing each corresponding local clock with the remote clock by requesting a timestamp of the remote clock from the old master node, wherein the first value of the local clock stored is the value of the local clock at the time when the request is sent to the new master node.

14. The method of claim 7, further comprising creating a temporary copy of the object for the write operation.

15. The method according to claim 7, wherein the method further comprises: A message is received from the old master node instructing the specific node to re-enable a local clock synchronized with the master clock.

16. The method of claim 15, wherein the method further comprises synchronizing the new master node to the master clock.

17. The method according to claim 16, further comprising: transmitting, from the new master node, a message instructing the slave nodes to disable their local clocks; receiving a reply message from the slave node to the new master node indicating that the local clock has been disabled; as well as An indication is given from the new master node to the slave nodes that the local clock should be re-enabled at a later time.

18. The method of claim 7, wherein the cluster of nodes utilizes a configuration protocol for reconfiguring the cluster of nodes and selecting a node for managing the configuration of the cluster of nodes, wherein the master clock is provided by the node selected for managing the configuration of the cluster.

19. A system for use in a cluster of nodes, the system comprising: Local clock; as well as a clock synchronization module configured to synchronize to a master clock for a cluster of nodes provided by an old master node in the cluster of nodes, wherein upon receiving a new configuration for the cluster indicating a new master node, the clock synchronization module is arranged to: sending a message to other nodes in said cluster of nodes instructing them to disable their respective local clocks; receiving respective acknowledgments from said other nodes in said cluster of nodes indicating that their respective local clocks have been disabled; identifying a time at which all leases of any node that has been removed from said cluster of nodes by said reconfiguration are to expire; determining a maximum value of the master clock provided by the old master node from the identified time; generating a write timestamp for an object of a node in the cluster of nodes to be set later than the maximum value of the master clock at a write time; as well as The write timestamp is transmitted to the node to schedule a write operation of the object to the node.

20. The system of claim 19, wherein the system further comprises two or more processing cores, each core having a corresponding local clock, and the clock synchronization module comprises two or more synchronization threads, the two or more synchronization threads being configured to execute on corresponding ones of the two or more processing cores to synchronize the corresponding local clocks for the corresponding ones of the two or more processing cores by: storing a first value of a local clock for the thread; receiving a remote timestamp from the old master node indicating a current value of a remote clock; storing a second value of the local clock for the thread at the time when the remote timestamp was received; as well as The local clock for the thread is set to the current value of the remote clock based on the remote timestamp.