From 0f360fa806c4e927b4f21d8538a9c52c29f6e555 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Wed, 6 Mar 2024 21:22:30 -0800 Subject: [PATCH] Fill in "Checking point reads" --- .vscode/settings.json | 8 ++++++-- paper/paper.tex | 29 +++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ced9397..0e5c06f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,9 @@ { "files.associations": { "*.tikz": "latex" - } -} \ No newline at end of file + }, + "latex-workshop.view.pdf.invertMode.enabled": "compat", + "latex-workshop.view.pdf.invert": 1, + "latex-workshop.view.pdf.invertMode.sepia": 1, + "latex-workshop.view.pdf.invertMode.grayscale": 0.5 +} diff --git a/paper/paper.tex b/paper/paper.tex index 79c839d..f5e43ec 100644 --- a/paper/paper.tex +++ b/paper/paper.tex @@ -33,7 +33,6 @@ For any ordered data structure we can implement \textit{lastCommit} using a repr This is a standard technique used throughout FoundationDB. The problem with applying this to an off-the-shelf ordered data structure is that checking a read range is linear in the number of intersecting physical keys. -In order to support higher concurrent write load, we must store write sets from more transactions. Scanning through every recent point write intersecting a large range read would make conflict checking unacceptably slow for high-write-throughput workloads. This suggests we consider augmenting \cite{cormen2022introduction} an ordered data structure to make checking the max version of a range sublinear. @@ -59,18 +58,36 @@ The Height Optimized Trie (HOT) \cite{binna2018hot} outperforms ART, but has a f \section{Augmented radix tree} -Each node in the tree is annotated with either one field \emph{max}, or three fields: \emph{max}, \emph{point}, and \emph{range}. +We now propose our design for an augmented radix tree implementation of \emph{lastCommit}. +The design is the same as the Adaptive Radix Tree \cite{DBLP:conf/icde/LeisK013}, but each node in the tree is annotated with either one field \emph{max}, or three fields: \emph{max}, \emph{point}, and \emph{range}. \emph{max} represents the maximum version among all keys starting with the prefix associated with the node's place in the tree (i.e. the search path from the root to this node). -\emph{point} represents the version of the exact key starting with this node's prefix. -\emph{range} represents the version of all keys $k$ such that this is the first node greater than or equal to $k$ with all three fields set. - -See figure \ref{fig:tree} for an example of an augmented radix tree, after inserting +\emph{point} represents the version of the exact key matching this node's prefix. +\emph{range} represents the version of all keys $k$ such that this is the first node greater than $k$ with all three fields set. +See figure \ref{fig:tree} for an example tree after inserting $[AND, ANT) \rightarrow 1$, $\{ANY\} \rightarrow 2$, $\{ARE\} \rightarrow 3$, and $\{ART\} \rightarrow 4$. Each node shows its partial prefix annotated with $(max,point,range)$. +\subsection{Checking point reads} + +The algorithm for checking point reads follows directly from the definitions of the \emph{point} and \emph{range}. +Our input is a key $k$ and a read version $r$, and we must report whether or not the write version $v_{k}$ of $k$ is less than or equal to $r$. +In order to find $v_{k}$, we search for the node whose prefix matches $k$. +If such a node exists and has \emph{point} set, then $v_{k}$ is its \emph{point} field. +Otherwise, we scan forward to find the first node greater than $k$ with \emph{range} set. +If such a node exists, then $v_{k}$ is its \emph{range} field. +Otherwise $k$ logically has no write version, and so the read does not conflict. + +As an optimization, during the search phase for a point read we can inspect the \emph{max} at each node that's a prefix of $k$. +If the max version among all keys starting with a prefix of $k$ is less than or equal to $r$, then $v_{k} \leq r$. + +\subsection{Checking range reads} +\subsection{Adding point writes} +\subsection{Adding range writes} +\subsection{Reclaiming old entries} + \begin{figure} \caption{} \label{fig:tree}