in state machine replication. Natto extends it to establish a global
ordering of transactions without the need for a logically centralized
sequencer or coordination messages between servers. Even though
a transaction is not processed immediately on nearby servers, its
completion time does not increase since the second round of the
transaction cannot start until the client receives all of the results
from the rst round, including the result from the furthest server.
Using this approach, Natto does not acquire resources prematurely,
and its transactions cannot deadlock as the global ordering prevents
cyclic dependencies.
Although the Natto servers agree on the ordering of transactions,
each server only receives transactions that read and/or write to
its partition. Therefore, they cannot unilaterally schedule a high-
priority transaction ahead of a low-priority transaction without
potentially introducing a distributed deadlock. However, for a given
transaction, all servers other than the furthest one from the client
will receive the transaction before its execution time. This creates
an abort window at these servers during which time the transaction
has been received but may still be aborted if it conicts with a
new high priority transaction. This abort window comes out of our
use of arrival time-based execution timestamps, and gives Natto
an opportunity to perform a priority abort of a low priority trans-
actions that can interfere with high priority transactions without
introducing any delays when there are no conicts.
Additionally, each Natto transaction embeds its estimated trans-
action arrival time to all of the participating servers. Without this
information, if a high priority transaction arrives at a Natto server
that conicts with an already prepared low priority transaction,
the high priority transaction must wait until the low priority trans-
action completes even if the low priority transaction is eventually
aborted. However, by having the arrival time information to all
participating servers for its received transactions, a Natto server
can in some cases know that a prepared low-priority transaction
will likely be aborted. With this knowledge, it can send a condi-
tional prepare message to the 2PC coordinator, which prepares the
high-priority transaction before the server receives an abort ac-
knowledgement for the conicting transaction. This conditional
prepare will be successful if the conicting low-priority transac-
tion is aborted. Otherwise, Natto will safely discard the conditional
prepare results and prepare the high-priority transaction after the
conicting transaction completes successfully.
Finally, in the Carousel protocol, results from a committed trans-
action are not visible to other transactions until they have been
replicated to a majority of the replicas. This is necessary since, in
the event of a replication group failure, committed transactions
that have not been replicated must be replayed, and a Carousel
server cannot determine the ordering of multiple transactions in
this state. With the availability of transaction timestamps, Natto
can determine the order of transactions in the committed but not
yet replicated state. This allows Natto to introduce Early Committed
State Forwarding (ECSF) that allows a transaction to read committed
results that have not been replicated. ECSF signicantly reduces
lock contention by reducing the amount of time that a transaction
needs to hold a lock by one wide-area network roundtrip. This
signicantly reduces the latency of both high and low-priority
transactions for high-contention workloads.
This paper makes three main contributions:
•
We describe the use of network measurements to establish a
global ordering of transactions based on transaction arrival
time. We use this ordering to identify and selectively abort
low-priority transactions that would delay the processing of
a high-priority transaction.
•
We introduce conditional prepare and early committed result
forwarding, which allow Natto to further overlaps operations
that are performed sequentially in previous systems.
•
We evaluate Natto using the Smallbank [
13
,
20
], Retwis [
34
,
54
] and YCSB+T [
19
] on both an Microsoft Azure deploy-
ment and a local cluster. Our results show that Natto has
signicantly lower tail latency for high-priority transactions
compared to Carousel [53] and TAPIR [54].
2 BACKGROUND
We design Natto on top of Carousel [53], a transaction processing
system for globally distributed data. Unlike Carousel that processes
transactions in their arrival order, Natto introduces a timestamp-
based ordering to support transaction prioritization. Natto assigns a
timestamp to each transaction, where the timestamp indicates when
the transaction should have arrived at all participants. To estimate
a transaction’s arrival time at participants, Natto uses techniques
introduced in Domino [
52
]. This section will rst briey review
Carousel, and then describe the techniques that Natto borrows from
Domino for estimating a transaction’s arrival time at participants.
2.1 Carousel
Similar to many other geo-distributed database systems, such as
Google Spanner [
17
] and CockroachDB [
15
], Carousel shards data
into partitions to achieve scalability, and replicates each partition
in dierent datacenters to tolerate datacenter-wide failures. Un-
like other systems, Carousel targets a specic type of read-write
transactions, 2-round Fixed-set Interactive (2FI) transactions [53].
A 2FI transaction consists of one round of reads followed by a
round of writes. Both read and write keys are pre-dened at the
start of a 2FI transaction. However, a client can decide the write
values based on the read results and does not need to modify all
of the keys in the write set. This interactive read-write pattern
between clients and servers is preferred by many applications [
42
],
especially in rapid development [
10
]. The 2FI model can directly
implement common read-modify-write patterns in transactions,
such as reading, incrementing, and updating one or more counter
values. This allows many transactions to t in the 2FI model, in-
cluding transferring balance between user accounts and updating
user proles in web applications.
In order to have low transaction completion time, Carousel lever-
ages the pre-dened read and write keys in 2FI transactions to
overlap transaction processing (i.e., reads and writes) with 2PC
and replication. Figure 1 shows an example of Carousel’s basic
protocol (known as Carousel Basic). In this example, a transaction
accesses two data partitions in dierent datacenters. We only show
the leader of each partition’s replica group for clarity. The client
starts executing the transaction by sending (
1
○
) read-and-prepare
requests to the two partition leaders. A read-and-prepare request
includes both the read and write keys that the transaction accesses
Session 10: Distributed and Parallel Databases
SIGMOD ’22, June 12–17, 2022, Philadelphia, PA, USA
评论