US 12,235,837 B2
Hedged reads
Therese Avitabile, New York, NY (US); Misha Tyulenev, Brooklyn, NY (US); Jason Carey, Austin, TX (US); Andrew Michalski Schwerin, Brooklyn, NY (US); Ben Caimano, Brooklyn, NY (US); Amirsaman Memaripour, Knoxville, TN (US); Cheahuychou Mao, Brooklyn, NY (US); Jeff Yemin, Wayland, MA (US); and Garaudy Etienne, West Orange, NJ (US)
Assigned to MongoDB, Inc., New York, NY (US)
Filed by MongoDB, Inc., New York, NY (US)
Filed on Jun. 8, 2021, as Appl. No. 17/341,747.
Claims priority of provisional application 63/036,191, filed on Jun. 8, 2020.
Prior Publication US 2021/0382888 A1, Dec. 9, 2021
Int. Cl. G06F 16/00 (2019.01); G06F 16/2453 (2019.01)
CPC G06F 16/2453 (2019.01) 17 Claims
OG exemplary drawing
 
1. A computer-implemented method for managing hedged read operations in a database system, the method comprising:
dynamically determining, responsive to a read request received from a client system, whether a hedged read operation is enabled for each node of a set of nodes hosting target data for servicing the read request, wherein dynamically determining whether the hedged read operation is enabled for each node of the set of nodes comprises:
determining a read preference mode for servicing the read request, wherein the read preference mode indicates which nodes of the set of nodes can service read requests received from the client system, wherein the read preference mode comprises one of a first read preference mode indicating that a primary node can service the read requests, a second read preference mode indicating that only secondary nodes can service the read requests, and a third read preference mode indicating that any primary or secondary node whose network latency falls within a first latency window can service the read requests, and
determining whether the hedged read operation is enabled for the determined read preferences mode, wherein determining whether the hedged read operation is enabled comprises determining that the hedged read operation is enabled when the determined read preference mode is either the second read preference mode or the third read preference mode; and
in response to a determination that the hedged read operation is enabled for multiple nodes of the set of nodes hosting the target data for the read request:
determining one or more eligible nodes for the hedged read operation at least in part by pinging the multiple nodes of the set of nodes for which the hedged read operation is determined to be enabled, wherein determining the one or more eligible nodes comprises:
determining a lowest average roundtrip time based on pinging the multiple nodes;
determining a second latency window based on the lowest average roundtrip time;
identifying a first node of the set of nodes with a first average roundtrip time within the determined second latency window as a first eligible node for the hedged read operation; and
identifying a second node of the set of nodes with a second average roundtrip time within the determined second latency window as a second eligible node for the hedged read operation;
establishing a first connection with the first eligible node and a second connection with the second eligible node; and
communicating the read request to both the first and second eligible nodes at least in part by:
communicating the read request to the first eligible node via the first connection, and
communicating the read request to the second eligible node via the second connection.