0. Essence
(1) Spannerserver’s stack(2.1Spannerserver Software Stack): consists of file system(Colossus),storing data structure(tablet),replica(paxos state machine),concurrency control(lock table),distributed transactions(transaction manager).

(2) Data Model(2.3 Data Model): introduce INTERLEAVE IN ,ON DELETE CASCADE to achive the interleaving of tables to form directories is significant because it allows clients to describe the locality relationships that exist between multiple tables.

(3)TrueTime(3 TrueTime): The underlying time references used by TrueTime are GPS and atomic clocks.TrueTime explicitly represents time as a TTinterval, which is an interval with bounded time uncertainty.
(4) Leader Leases(4.1.1 Paxos Leader Leases): prove the leader leases and disjoint from other leaders:

(5) RW transactions’ monotonicy invarient,external-consistency invariant,two phase-blocking
(4.1.2 Assigning Timestamps to RWTransactions,Read-Write Transactions).

(6) t(safe),t(Paxos,safe),t(TM,safe)(4.1.3 Serving Reads at a Timestamp):
Every replica tracks a value called safe time t safe which is the maximum timestamp at which a replica is up-to-date.
(7) s(read)'s single group(LastTS()) or multiple group(TT.now.latest)
(4.1.4 Assigning Timestamps to RO Transactions,4.2.2 Read-Only Transactions)
1. Introduction
Highest level of abstraction
It is a database that shards data across many sets of Paxos state machines in datacenters spread all over the world.
Spanner’s main focus
Managing cross-datacenter replicated data.Spanner automatically reshards data across machines as the amount of data or the number of servers changes, and it automatically migrates data across machines (even across datacenters) to balance load and in response to failures.
Spanner’s focus of distributed-systems infrastructure
Spanner has evolved from a Bigtable-like versioned key-value store into a temporal multi-version database;
Data is stored in schematized semi-relational tables;
Data is versioned, and each version is automatically timestamped with its commit time; old versions of data are subject to configurable garbage-collection policies; and applications can read data at old timestamps;
Spanner supports general-purpose transactions, and provides a SQL-based query language.
Spanner’s focus of globally-distributed database’s features
(1) First, the replication configurations for data can be dynamically controlled at a fine grain by applications. Applications can specify constraints to control which datacenters contain which data, how far data is from its users (to control read latency), how far replicas are from each other (to control write latency), and how many replicas are maintained (to control durability, availability, and read performance). Data can also be dynamically and transparently moved between datacenters by the system to balance resource usage across datacenters.
(2) Second, Spanner has two features that are difficult to implement in a distributed database: it provides externally consistent reads and writes, and globally-consistent reads across the database at a timestamp.These features enable Spanner to support consistent backups, consistent MapReduce executions , and atomic schema updates, all at global scale, and even
in the presence of ongoing transactions.
(2)’ External Consistency. ——[16] Information Storage in a DecentralizedComputer System
External consistency guarantees that a transaction will always receive current information. Using the concepts we have just introduced, we can provide a formal definition of external consistency. The actual time order in which transactions complete defines a unique serial schedule. This serial schedule is called the external schedule. A system is said to provide external consistency if it guarantees that the schedule it will use to process a set of transactions is equivalent to its external schedule.
(3) Spanner’s Globally-meaningful commit timestamps
Two features are enabled by the fact that Spanner assigns globally-meaningful commit timestamps to transactions, even though transactions may be distributed;
The timestamps reflect serialization order;
In addition, the serialization order satisfies external consistency (or equivalently, linearizability) : if a transaction T1 commits before another transaction T2 starts, then T1’s commit timestamp is smaller than T2’s. Spanner is the first system to provide such guarantees at global scale.
(3)’ Spanner’s new TrueTime API
The API directly exposes clock uncertainty, and the guarantees on Spanner’s timestamps depend on the bounds that the implementation provides;
If the uncertainty is large, Spanner slows down to wait out that uncertainty.This implementation keeps uncertainty small (generally less than 10ms) by using multiple modern clock references (GPS and atomic clocks).
Directory
(1) Section 2: describes the structure of Spanner’s implementation,its feature set, and the engineering decisions that went into their design.
(2) Section 3: describes our new TrueTime API and sketches its implementation.
(3) Section 4: describes how Spanner uses TrueTime to implement externally-consistent distributed transactions, lock-free read-only transactions, and atomic schema updates.
(4) Section 5: provides some benchmarks on Spanner’s performance and TrueTime behavior, and discusses the experiences of F1.
(5) Sections 6, 7, and 8 :describe related and future work, and summarize our conclusions.
2.1 Implemention
This section describes the structure of and rationale underlying Spanner’s implementation;
It then describes the directory abstraction, which is used to manage replication and locality, and is the unit of data movement;
Finally, it describes our data model, why Spanner looks like a relational database instead of a key-value store, and how applications can control data locality.
Universe
A Spanner deployment is called a universe.
We currently run a test/playground universe, a development/production universe, and a production-only universe.
Zone
(1) Spanner is organized as a set of zones;
(2) Zones are the unit of administrative deployment;
(3) The set of zones is also the set of locations acrosswhich data can be replicated.——???
(4) Zones can be added to or removed from a running system as new datacenters are brought into service and old ones are turned off, respectively;
(5) Zones are also the unit of physical isolation: there may be one or more zones in a datacenter, for example, if different applications’ data must be partitioned across different sets of servers in the same datacenter.
Servers in a Spanner universe

(1) A zone has one zonemaster and between one hundred and several thousand spanservers.
(2) The zonemaster assigns data to spanservers;
(3) The spanserver serve data to clients.
(4) The per-zone location proxies are used by clients to locate the spanservers assigned to serve their data.
(5) The universe master is primarily a console that displays status information about all the zones for interactive debugging.
(6) The placement driver handles automated movement of data across zones on the timescale of minutes. The placement driver periodically communicates with the spanservers to find data that needs to be moved, either to meet updated replication constraints or to balance load.
2.2Spanserver Software Stack
This section focuses on the spanserver implementation to illustrate how replication and distributed transactions have been layered.

Tablet
At the bottom, each spanserver is responsible for between 100 and 1000 instances of a data structure called a tablet.
It implements a bag of the following mappings:
(key:string, timestamp:int64) ——> string
Unlike Bigtable, Spanner assigns timestamps to data, which is an important way in which Spanner is more like a multi-version database than a key-value store.
Colossus
A tablet’s state is stored in set of B-tree-like files and a write-ahead log(WAL), all on a distributed file system called Colossus (the successor to the Google File System ).
Paxos state machine
The set of replicas is collectively a Paxos group.
Requirement:To support replication, each spanserver implements a single Paxos state machine on top of each tablet.
Implemention:Each state machine stores its metadata and log in its corresponding tablet.
Features:
(1) Our Paxos implementation supports long-lived leaders with time-based leader leases, whose length defaults to 10 seconds.
(2) The current Spanner implementation logs every Paxos write twice: once in the tablet’s log, and once in the Paxos log.
(3) Our implementation of Paxos is pipelined, so as to improve Spanner’s throughput in the presence of WAN latencies; but writes are applied by Paxos in order.————???
(4) The Paxos state machines are used to implement a consistently replicated bag of mappings.(state machine keep the mapping bag consistenly)
(5) Writes must initiate the Paxos protocol at the leader; reads access state directly from the underlying tablet at any replica that is sufficiently up-to-date.
Lock table
At every replica that is a leader, each spanserver implements a lock table to implement concurrency control.
Inplemention:
The lock table contains the state for two-phase locking: it maps ranges of keys to lock states.————???
(Note that having a long-lived Paxos leader is critical to efficiently managing the lock table.)
Features:
(1) We designed for long-lived transactions (for example, for report generation, which might take on the order of minutes), which perform poorly under optimistic concurrency control in the presence of conflicts.
(2) Operations that require synchronization, such as transactional reads, acquire locks in the lock table; other operations bypass the lock table.
Transaction manager
At every replica that is a leader, each spanserver also implements a transaction manager to support distributed transactions.
Inplemention:
The transaction manager is used to implement a participant leader; the other replicas in the group will be referred to as participant slaves.
case1——If a transaction involves only one Paxos group (as is the case for most transactions):
It can bypass the transaction manager, since the lock table and Paxos together provide transactionality.
case2——If a transaction involves more than one Paxos group.
Those groups’ leaders coordinate to perform two-phase commit;
One of the participant groups is chosen as the coordinator: the participant leader of that group will be referred to as the coordinator leader, and the slaves of that group as coordinator slaves.
#Directories and Placement
Directory
A bucketing abstraction called a directory, which is a set of contiguous keys that share a common prefix.
Features:
(1) Supporting directories allows applications to control the locality of their data by choosing keys carefully.
(2) A directory is the unit of data placement. All data in a directory has the same replication configuration. When data is moved between Paxos groups, it is moved directory by directory, as shown in Figure 3.Spanner might move a directory to shed load from a Paxos group; to put directories that are frequently accessed together into the same group; or to move a directory into a group that is closer to its accessors.

(From Figure 3,a Paxos group consists of a set of zones;different Paxos group may contain same zones.)
(3) Bigtable tablet:a single lexicographically contiguous partition of the row space.
Spanner:a container that may encapsulate multiple partitions of the row space.————???
->We made this decision so that it would be possible to colocate multiple directories that are frequently accessed together.
->The fact that a Paxos group may contain multiple directories.
(4) A directory is also the smallest unit whose geographic replication properties can be specified by an application.
Premise:
The design of our placement-specification language separates responsibilities for managing replication configurations.
Inplemention:
Administrators control two dimensions: the number and types of replicas, and the geographic placement of those replicas,and they create a menu of named options in these two dimensions;
An application controls how data is replicated, by tagging each database and/or individual directories with a combination of those options;
For example:
An application might store each end-user’s data in its own directory, which would enable user A’s data(individual directory) to have three replicas (replica number) in Europe(replica geographic placement) , and user B’s data(individual directory) to have five replicas(replica number) in North America(replica geographic placement).
Moviedir
Features:
(1) * is the background task used to move directories between Paxos groups.
(2) * is also used to add or remove replicas to Paxos groups (because Spanner does not yet support in-Paxos configuration changes)
(3) * is not implemented as a single transaction, so as to avoid blocking ongoing reads and writes on a bulky data move.
Inplemention:
(1) Movedir registers the fact that it is starting to move data and moves the data in the background.
(2) When it has moved all but a nominal amount————??? of the data.
(3) It uses a transaction to atomically move that nominal amount and update the metadata for the two Paxos groups.
Fragment
Spanner will shard a directory into multiple fragments if it grows too large.
Movedir actually moves fragments, and not whole directories, between groups.
2.3 Data Model
Spanner exposes the following set of data features to applications:
(1) A data model based on schematized semi-relational tables.
(2) A query language.
(3) The general-purpose transactions
Factors:
(1) The need to support schematized semi-relational tables and synchronous replication is supported by the popularity of Megastore(despite its relatively low performance),because its data model is simpler to manage than Bigtable’s, and because of its support for synchronous replication across datacenters.
(2) The need to support a SQL-like query language in Spanner was also clear, given the popularity of Dremel as an interactive data-analysis tool.
(3) The lack of cross-row transactions in Bigtable;
We believe it is better to have application programmers deal with performance problems due to overuse of transactions as bottlenecks arise;
Running two-phase commit over Paxos mitigates the availability problems.
The application data model
Location:is layered on top of the directory-bucketed key-value mappings supported by the implementation.
Construction:
(1) An application creates one or more databases in a universe;
(2) Each database can contain an unlimited number of schematized tables.
(3) Tables look like relational-database tables, with rows, columns, and versioned values.
(4) We will not go into detail about the query language for Spanner. It looks like SQL with some extensions to support protocol-buffer-valued fields.
For example:Spanner schema for storing photo metadata on a per-user, per-album basis.

Rows with name
Every table is required to have an ordered set of one or more primary-key columns.->(Albums(2,1),means the rows that user_id=2,album_id=1 in Albums)
Imposing this structure is useful because it lets applications control data locality through their choices of keys.
INTERLEAVE IN
Client applications declare the hierarchies in database schemas via the INTERLEAVE IN declarations.
->(INTERLEAVE IN PARENT Users,then Albums interleaves in Users)
Directory/Descendant table
The table at the top of a hierarchy is a directory table.->(Users),desendant table->(Albums).
Each row in a directory table with key K, together with all of the rows in descendant tables that start with K in lexicographic order, forms a directory.
ON DELETE CASCADE
Deleting a row in the directory table deletes any associated child rows.
Target
This interleaving of tables to form directories(Schema) is significant because it allows clients to describe the locality relationships that exist between multiple tables, which is necessary for good performance in a sharded, distributed database.
3 TrueTime
Table 1 lists the methods of the API.

TTinterval
is an interval with bounded time uncertainty (unlike standard time interfaces that give clients no notion of uncertainty). The endpoints of a TTinterval are of type TTstamp.
TT.now()
The TT.now() method returns a TTinterval that is guaranteed to contain the absolute time during which TT.now() was invoked;
The time epoch is analogous to UNIX time with leap-second smearing.————???
Define the instantaneous error bound as ε , which is half of the interval’s width, and the average error bound as ε’.
TT.after()/TT.before()
The TT.after() and TT.before() methods are convenience wrappers around TT.now().
Absolute time of an event
Denote the absolute time of an event e by the function tabs(e). In more formal terms, TrueTime guarantees
that for an invocation tt = TT.now(), tt.earliest ≤ tabs(e now) ≤ tt.latest, where e now is the invocation event.
Time references
The underlying time references used by TrueTime are GPS and atomic clocks.
TrueTime uses two forms of time reference because they have different failure modes.
GPS reference-source vulnerabilities include antenna and receiver failures, local radio interference, and GPS system outages;
Atomic clocks can fail in ways uncorrelated to GPS and each other, and over long periods of time can drift significantly due to frequency error.
Two Eviction Strategys
Inplemention:TrueTime is implemented by a set of time master machines per datacenter and a timeslave daemon per machine.Some are GPS masters chosen from nearby datacenters; the rest are GPS masters from farther datacenters, as well as some Armageddon masters.(the course of timemaster->timeslave)
(1) All masters’ time references are regularly compared against each other. Each master also cross-checks the rate at which its reference advances time against its own local clock, and evicts itself if there is substantial divergence.
(2) Every daemon polls a variety of masters to reduce vulnerability to errors from any one master.
Daemons apply a variant of Marzullo’s algorithm————??? to detect and reject liars, and synchronize the local machine clocks to the nonliars;
To protect against broken local clocks, machines that exhibit frequency excursions larger than the worst-case bound derived from component specifications and operating environment are evicted.
**Time uncertainty **
Cause:
Between synchronizations, a daemon advertises a slowly increasing time uncertainty.
Time uncertainty ε is derived from conservatively applied worst-case 1. local clock drift, also depends on 2. time-master uncertainty and 3. communication delay to the time masters.
Armageddon masters advertise a slowly increasing time uncertainty that is derived from conservatively applied
worst-case clock drift;
GPS masters advertise uncertainty that is typically close to zero.
Inplemention:
(1) In our production environment, ε is typically a sawtooth function of time, varying from about 1 to 7 ms over each poll interval.ε’ is therefore 4 ms most of the time.
(2) The daemon’s poll interval is currently 30 seconds, and the current applied drift rate is set at 200 microseconds/second(30*200microseconds=6ms), which together account for the sawtooth bounds from 0 to 6 ms.
(3) The remaining 1 ms comes from the communication delay to the time masters.
Excursions from this sawtooth are possible in the presence of failures:occasional time-master unavailability;overloaded machines and network links.
4 Concurrency Control
(1) This section describes how TrueTime is used to guarantee the correctness properties around concurrency control;
(2) And how those properties are used to implement features such as 1. externally consistent transactions, 2. lock-free read-only transactions, and 3. non-blocking reads in the past;
(3) It will be important to distinguish writes as seen by Paxos (which we will refer to as Paxos writes unless the context is clear) from Spanner client writes.
4.1 Timestamp Management
Leader lease(disjointness invariant)->
RW transactions’ timestamp(monotonicity,external consistency invariant)->
Reads at timestamp(t safe:paxos write,prepared but not committed transactions)->
RO transactions’ timestamp(s read,oldest timestamp preserve the external consistency invariant,and not blocking)
Table 2 lists the types of operations that Spanner supports.

The Spanner implementation supports:
(1) read-write transactions(include Standalone writes)
(2) read-only transactions (include non-snapshot standalone reads)
(3) snapshot reads
Read-only transaction
A read-only transaction is a kind of transaction that has the performance benefits of snapshot isolation———???
A read-only transaction must be predeclared as not having any writes:
(1) It is not simply a read-write transaction without any writes.
(2) Reads in a read-only transaction execute at a system-chosen timestamp without locking, so that incoming writes are not blocked.
Snapshot reads
A snapshot read is a read in the past that executes without locking.
A client can either specify a timestamp for a snapshot read, or provide an upper bound on the desired timestamp’s staleness and let Spanner choose a timestamp.
Read benefits
For both read-only transactions and snapshot reads, commit is inevitable once a timestamp has been chosen, unless the data at that timestamp has been garbage-collected————???.
As a result, clients can avoid buffering results inside a retry loop(client).
When a server fails, clients can internally continue the query on a different server by repeating the timestamp and the current read position.
4.1.1 Paxos Leader Leases
Spanner’s Paxos implementation uses timed leases to make leadership long-lived (10 seconds by default).
Inplemention:
(1) A potential leader sends requests for timed lease votes;
(2) Upon receiving a quorum of lease votes the leader knows it has a lease.
(3) Define a leader’s lease interval as starting when it discovers it has a quorum of lease votes, and as ending when it no longer has a quorum of lease votes (because some have expired).
(4) Spanner depends on the following disjointness invariant: for each Paxos group, each Paxos leader’s lease interval is disjoint from every other leader’s.
The folloing figure(deduction form Appendix A) discribes how this invariant is enforced:

To prove disjointness, we make use of the fact that the i th and (i + 1)th leaders must have one replica in common in their quorums. Call that replica r0. Proof:

(5) A replica extends its lease vote implicitly on a successful write, and the leader requests lease-vote extensions if they are near expiration.
4.1.2 Assigning Timestamps to RW Transactions
Transactional reads and writes use two-phase locking. As a result, they can be assigned timestamps at any time when all locks have been acquired, but before any locks have been released.
monotonicity invariant
Spanner assigns timestamps to Paxos writes in monotonically increasing order, even across leaders.
(1) Single leader replica can trivially assign timestamps in monotonically increasing order.
(2) This invariant is enforced across leaders by making use of the disjointness invariant: a leader must only assign
timestamps within the interval of its leader lease. Note that whenever a timestamp s is assigned, s max is advanced to s to preserve disjointness.(s max :max timestamp user by leader)
external consistency invariant

4.1.3 Serving Reads at a Timestamp
The monotonicity invariant described in Section 4.1.2 allows Spanner to correctly determine whether a replica’s state is sufficiently up-to-date to satisfy a read.
Every replica tracks a value called safe time t safe which is the maximum timestamp at which a replica is up-to-date. A replica can satisfy a read at a timestamp t if t <= t safe.
The definition of t safe will be shown below:

4.1.4 Assigning Timestamps to RO Transactions
Read-only transaction executes in two phases: assign a timestamp s read , and then execute the transaction’s reads as snapshot reads at s read. The snapshot reads can execute at any replicas that are sufficiently up-to-date.
S read
The simple assignment of s read = TT.now().latest, at any time after a transaction starts, preserves external consistency by an argument analogous to that presented for writes in Section 4.1.2.
Blocking
However, such a timestamp may require the execution of the data reads at s read to block if t safe has not advanced sufficiently.(in that other write events would be executed after t safe,read may cause blocking);
To reduce the chances of blocking, Spanner should assign the oldest timestamp that preserves external consisten0cy.
4.2 Details
(1) Practical details of read-write transactions
(2) Practical details of read-only transactions
(3) Inplemention of atomic schema changes to transactions
(4) Refinement of the basic schemes.
4.2.1 Read-Write Transactions
Bigtables’s design
Writes that occur in a transaction are buffered at the client until commit. As a result, reads in a transaction do not see the effects of the transaction’s writes.
Spanner’s inplemention
A read returns the timestamps of any data read, and uncommitted writes have not yet been assigned timestamps.
Procedure of two-phase commit
-
Premise:
(1) Reads within read-write transactions use wound-wait————??? to avoid deadlocks;
(2) The client issues reads to the leader replica of the appropriate group, which acquires read locks and then reads the most recent data;
(3) While a client transaction remains open, it sends keep-alive messages to prevent participant leaders from timing out its transaction(extend leader lease). -
Chooses a coordinator:
(1) When a client has completed all reads and buffered all writes, it begins two-phase commit.
(2) The client chooses a coordinator group and sends a commit message to each participant’s leader with the identity of the coordinator and any buffered writes together.(avoid sending data twice across wide-area links)
- Prepare for non-coordinator leader/assign commit timestamp for coordinator leader:
(1) A non-coordinator-participant leader first acquires write locks ->
chooses a prepare timestamp ≥ any timestamps it has assigned to previous transactions->
logs a prepare record through Paxos->
notifies the coordinator of its prepare timestamp.
(2) The coordinator leader also first acquires write locks,but skips the prepare phase.->
After hearing from all other participant leaders’ prepare timestamp.->
Chooses a timestamp s for the entire transaction: s ≥ any prepare timestmp,s > TT.now(coordinator receive commit message).latest , s > any timestampm the leader has assigned to previous transactions.->
(3) The coordinator leader then logs a commit record through Paxos (or an abort if it timed out while waiting on the other participants).
- Commit wait
Before allowing any coordinator replica to apply the commit record,the coordinator leader waits until
TT.after(s),so as to obey the commit-wait;
Because the coordinator leader chose s based on TT.now().latest, and now waits until that timestamp
is guaranteed to be in the past, the expected wait is at least 2 * ε(avg).
(ε is half of the interval that [TT.now,TT.after])
- Apply the commit record
(1) After commit wait, the coordinator sends the commit timestamp to the client and all other participant leaders.
(2) Each participant leader logs the transaction’s outcome through Paxos.
4.2.2 Read-Write Transactions
Negotiation phase for timestamp:
Assigning a timestamp requires a negotiation phase between all of the Paxos groups that are involved in the reads;
Spanner requires a scope expression for every read-only transaction, which is an expression that summarizes the keys that will be read by the entire transaction. Spanner automatically infers the scope for standalone queries.
Scope’s values are served by a single Paxos group:
(1) Client issues the read-only transaction to that group’s leader…
(2) For a single-site read, Spanner generally does better than TT.now().latest. Define LastTS() to be the timestamp of the last committed write at a Paxos group.
If there are no prepared transactions
(s read is earlier t safe,t safe=min(t paxos,t TM),t TM would be infinite if no prepared transactions), the assignment s read = LastTS() trivially satisfies external consistency.
Scope’s values are served by multiple Paxos group:
option1:The most complicated option is to do a round of communication with all of the groups’s leaders to negotiate s read based on LastTS().
option2:The client avoids a negotiation round, and just has its reads execute at s read = TT.now().latest (which may wait for safe time to advance). All reads in the transaction can be sent to replicas that are sufficiently up-to-date.
4.2.3 Schema-Change Transactions
Essence: TrueTime enables Spanner to support atomic schema changes;
Problem: It would be infeasible to use a standard transaction, because the number of participants (the number of groups in a database) could be in the millions;
Bigtable supports atomic schema changes in one datacenter, but its schema changes block all operations.
Solution of Spanner for blocking operations:
(1) It is explicitly assigned a timestamp in the future, which is registered in the prepare phase. As a result, schema changes across thousands of servers can complete with minimal disruption to other concurrent activity.
(2) Reads and writes, which implicitly depend on the schema, synchronize with any registered schema-change timestamp at time t: they may proceed if their timestamps precede t, but they must block behind the schemachange transaction if their timestamps are after t.
4.2.4 Refinements
(1) t(TM,safe)'s fine grain
Problem: if a single prepared transaction prevents t safe from advancing,no reads can occur at later timestamps, even if the reads do not conflict with the transaction.
Refinement: Such false conflicts can be removed by augmenting t(TM,safe) with a fine-grained mapping from key ranges to prepared transaction timestamps. This information can be stored in the lock table;
When a read arrives, it only needs to be checked against the fine-grained safe time for key ranges with which the read conflicts.
(2) LastTS()'s fine grain
Problem: if a transaction has just committed(write transaction), a non-conflicting readonly transaction must still be assigned s read so as to follow that transaction. As a result, the execution of the read could be delayed.
Refinement: This weakness can be remedied similarly by augmenting LastTS() with a fine-grained mapping from key ranges to commit timestamps in the lock table;
When a read-only transaction arrives, its timestamp can be assigned by taking the maximum value of LastTS() for the key ranges with which the transaction conflicts, unless there is a conflicting prepared transaction (which can be determined from fine-grained safe time.
(3) t(Paxos,safe)'s fine grain
Problem: it has a weakness in that it cannot advance in the absence of Paxos writes.That is, a snapshot read at t cannot execute at Paxos groups whose last write happened before t.
Refinement: Spanner addresses this problem by taking advantage of the disjointness of leader-lease intervals;
Each Paxos leader advances t(Paxos,safe)'s fine grain by keeping a threshold above which future writes’ timestamps will occur:
A mapping MinNextTS(n) from Paxos sequence number n to the minimum timestamp that may be assigned to Paxos sequence number n + 1. (A replica can advance t(Paxos,safe) to MinNextTS(n) − 1 when it has applied through n.);
If a leader wishes to advance MinNextTS() beyond the end of its leader lease, it must first extend its lease. Note that s max is always advanced to the highest value in MinNextTS() to preserve disjointness.A leader by default advances MinNextTS() values every 8 seconds.
1819




被折叠的 条评论
为什么被折叠?



