Computing and tracking client staleness using transaction responses
First Claim
1. A system, comprising:
- one or more processors; and
a memory coupled to the one or more processors, the memory storing program instructions executable by the one or more processors to implement a server node of a distributed data system;
wherein the server node is configured to;
receive a message from a client comprising a request to read a data item; and
in response to receiving the message;
determine a node staleness value that is associated with the data item from a perspective of the server node, wherein the node staleness value represents an upper bound on the amount of time that has elapsed, at the time when the node staleness value is determined, since the data item or a state associated with the data item was known by the server node to be valid and during which the requested data item or the state was subject to invalidation by updates to the requested data item or the state associated with the requested data item at one or more other server nodes of the distributed data system;
assemble a response message, wherein the response message comprises the data item and an indication of the node staleness value, wherein the node staleness value is usable by the client to determine a staleness of the requested data item that includes the amount of time that elapsed prior to the node staleness value being determined; and
send the response message to the client.
1 Assignment
0 Petitions
Accused Products
Abstract
Distributed systems that maintain data items or state on multiple server nodes (e.g., a storage system or lock service) may receive transaction requests from clients that include read requests and/or write requests. If a transaction request includes a read request, a server node may determine a node staleness value for the requested data from the server'"'"'s perspective, and may return a transaction response to the client that includes the requested data and the node staleness value. The client may compute a client staleness value for the requested data dependent on the node staleness value in the transaction response, rather than on a separate heartbeat process. If the transaction also includes a write request, the server may return the transaction response for the read request before the write commits. In this case, the client may not use the requested data until it receives another response indicating that the write committed.
97 Citations
27 Claims
-
1. A system, comprising:
-
one or more processors; and a memory coupled to the one or more processors, the memory storing program instructions executable by the one or more processors to implement a server node of a distributed data system; wherein the server node is configured to; receive a message from a client comprising a request to read a data item; and in response to receiving the message; determine a node staleness value that is associated with the data item from a perspective of the server node, wherein the node staleness value represents an upper bound on the amount of time that has elapsed, at the time when the node staleness value is determined, since the data item or a state associated with the data item was known by the server node to be valid and during which the requested data item or the state was subject to invalidation by updates to the requested data item or the state associated with the requested data item at one or more other server nodes of the distributed data system; assemble a response message, wherein the response message comprises the data item and an indication of the node staleness value, wherein the node staleness value is usable by the client to determine a staleness of the requested data item that includes the amount of time that elapsed prior to the node staleness value being determined; and send the response message to the client. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system, comprising:
-
one or more processors; and a memory coupled to the one or more processors, the memory storing program instructions executable by the one or more processors to implement a client; wherein the client is configured to; send a message to a server of a distributed data system, wherein the message comprises a request for a data item maintained by the distributed data system; receive a response message from the server, wherein the response message comprises the requested data item and an indication of a node staleness value that is associated with the requested data item from a perspective of the server, wherein the node staleness value represents an upper bound on the amount of time that has elapsed, prior to the server determining the node staleness value, since the requested data item or a state associated with the requested data item was known by the server to be valid according to the distributed data system; compute a client staleness value for the requested data item or the state associated with the requested data item from a perspective of the client, wherein said computing is dependent on the indication of the node staleness value that was included in the response message, and wherein the client staleness value represents an upper bound on the amount of time that has elapsed, at the time of said computing, since the requested data item or the state associated with the requested data item, as returned in the response message, could have been considered by the client to be valid according to the distributed data system; determine whether the client staleness value exceeds a pre-determined value for the requested data item or the state associated with the requested data item; and in response to determining the client staleness value does not exceed the pre-determined value, use the requested data item received in the response message. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A method, comprising:
-
sending, by a client, a transaction request message to a server of a distributed data system, wherein the transaction request comprises a request for a data item that is maintained by the distributed data system; receiving, by the client, a transaction response message from the server, wherein the transaction response message comprises the requested data item and an indication of a node staleness value that is associated with the requested data item from a perspective of the server, wherein the node staleness value represents an upper bound on the amount of time that has elapsed, prior to the server determining the node staleness value, since the requested data item or a state associated with the requested data item was known by the server to be valid according to the distributed data system; computing, by the client, a client staleness value for the requested data item or the state associated with the requested data item from a perspective of the client, wherein said computing is dependent on the indication of the node staleness value that was included in the transaction response message, and wherein the client staleness value represents an upper bound on the amount of time that has elapsed, at the time of said computing, since the requested data item or the state associated with the requested data item, as returned in the transaction response message, could have been considered by the client to be valid according to the distributed data store; determining, by the client, whether the client staleness value exceeds a pre-determined value for the requested data item or the state associated with the requested data item; and in response to determining the client staleness value does not exceed the pre-determined value, using by the client, the requested data item received in the transaction response message. - View Dependent Claims (16, 17, 18, 19)
-
-
20. A method, comprising:
-
receiving, at a given server, a transaction request message from a client comprising a request for a data item that is stored in a distributed data store, wherein the given server is one of a plurality of servers that coordinate with one another to maintain a shared state of the distributed data store; and in response to said receiving; determining, by the given server, a node staleness value that is associated with the requested data item from a perspective of the server, wherein the node staleness value represents an upper bound on an amount of time that has elapsed, at the time of said determining, since the requested data item or a state associated with the requested data item was known by the given server to be valid and during which the requested data item or the state known to the server was subject to invalidation by updates to the requested data item or the state at one or more other servers of the plurality of servers; assembling, by the given server, a transaction response message, wherein the transaction response message comprises the requested data item and an indication of the node staleness value, wherein the indication of the node staleness value is usable by the client to determine a staleness of the requested data item that includes the amount of time that elapsed prior to the node staleness value being determined; and sending, by the given server, the transaction response message to the client. - View Dependent Claims (21, 22)
-
-
23. A non-transitory computer-readable storage medium storing program instructions that when executed on one or more computers cause the one or more computers to implement a client;
wherein the client is configured to; send a transaction request message to a server of a distributed data system, wherein the requested transaction comprises a read request and a write request; receive a transaction response message from the server, wherein the transaction response message comprises a data item targeted by the read request and an indication of a node staleness value that is associated with the data item from a perspective of the server, wherein the node staleness value represents an upper bound on the amount of time that has elapsed, prior to the server determining the node staleness value, since the data item or a state associated with the data item was known by the server to be valid according to the distributed data system; compute a client staleness value for the data item or the state associated with the data item from a perspective of the client, wherein said computing is dependent on the indication of the node staleness value that was included in the transaction response message, and wherein the client staleness value represents an upper bound on the amount of time that has elapsed, at the time of said computing, since the data item or the state associated with the data item, as returned in the transaction response message, could have been considered by the client to be valid according to the distributed data system; determine whether the client staleness value exceeds a pre-determined value for the requested data item or the state associated with the requested data item; and subsequent to determining the client staleness value does not exceed the pre-determined value, refrain from using the data item until another transaction response message is received from the server indicating whether another data item targeted by the write request was successfully written. - View Dependent Claims (24, 25)
-
26. A non-transitory computer-readable storage medium storing program instructions that when executed on one or more computers cause the one or more computers to implement a server node in a distributed data system;
wherein the server node is configured to; receive a transaction request message, wherein the requested transaction comprises a read request and a write request; and in response to receiving the transaction request message; determine a node staleness value that is associated with a data item targeted by the read request from a perspective of the server node, wherein the node staleness value represents an upper bound on the amount of time that has elapsed, at the time when the node staleness value is determined, since the data item or a state associated with the data item was known by the server node to be valid and during which the data item or the state known to the server node was subject to invalidation by updates to the data item or the state at one or more other servers of the distributed data system; assemble a response message, wherein the response message comprises the data item and an indication of the node staleness value, wherein the node staleness value is usable by the client to determine a staleness of the requested data item that includes the amount of time that elapsed prior to the node staleness value being determined; and send the response message to the client; wherein the server node is configured to determine the node staleness value, assemble the response message, and send the response message to the client without waiting for the write request to be committed. - View Dependent Claims (27)
Specification