storage: add closed timestamp subsystem#27922
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Jul 26, 2018
Merged
Conversation
Member
9d1ac86 to
c010d5d
Compare
This commit introduces the basic closed timestamp subsystem. It does
not hook it up into the CockroachDB node yet.
Great care has been taken to make each individual component self-
contained and cleanly interfaced to the outside world. The package
layout relative to `closedts` is the following:
.: slim root package containing only the most basic CT interfaces
./ctpb: protobuf definitions and service
./config: fat package pulling in everything needed to actually run
./storage: storage for per-node closed timestamp state
./minprop: minimum proposal timestamp tracker
./provider: the Provider, centralizing all closed timestamp information.
Most of these packages depend on `closedts` (more precisely, on the
interfaces they need to use), but in turn don't depend on each other.
The following diagram together with the `ctconfig` and `ct` packages
should be instructive in getting a bird's eye view of how the subsystem
fits into CockroachDB: All of the components are grouped in a Container
(intended as a pass-around per-instance Singleton) and is passed down to
the Stores via the StoreConfig. Replicas proposing commands talk to the
Tracker; replicas trying to serve follower reads talk to the Provider,
which receives closed timestamp updates for the local node and its
peers.
```
Node 1 | Node 2
|
+---------+ Close +-----------+ | +-----------+
| Tracker |<--------| | | | |
+-----+---+ | +-------+ | | | +-------+ | CanServe
^ | |Storage| | | | |Storage| |<---------+
| | --------+ | | | +-------+ | |
|Track | | | | | +----+----+
| | Provider | | | Provider | | Follower|
| +-----------+ | +-----------+ | Replica |
| ^ ^ +----+----+
| |Subscribe |Notify |
| | | |
+---------+ | Request | |
|Proposing| Refresh +---+----+ <----- +----+-----+ Request |
| Replica |<--------| Server | | Clients |<----------+
+---------+ +--------+ -----> +----------+ EnsureClient
CT
```
Release note: None
Member
Author
|
bors r=nvanbenschoten |
craig bot
pushed a commit
that referenced
this pull request
Jul 26, 2018
27922: storage: add closed timestamp subsystem r=nvanbenschoten a=tschottdorf NB: This is a reopen of #27595 which needs a fix to the CI stress tester to merge before it can pass CI (and I don't want to wait for that). No need to review. ---- This commit introduces the basic closed timestamp subsystem. It does not hook it up into the CockroachDB node yet. Great care has been taken to make each individual component self- contained and cleanly interfaced to the outside world. The package layout relative to `closedts` is the following: .: slim root package containing only the most basic CT interfaces ./ctpb: protobuf definitions and service ./config: fat package pulling in everything needed to actually run ./storage: storage for per-node closed timestamp state ./minprop: minimum proposal timestamp tracker ./provider: the Provider, centralizing all closed timestamp information. Most of these packages depend on `closedts` (more precisely, on the interfaces they need to use), but in turn don't depend on each other. The following diagram together with the `ctconfig` and `ct` packages should be instructive in getting a bird's eye view of how the subsystem fits into CockroachDB: All of the components are grouped in a Container (intended as a pass-around per-instance Singleton) and is passed down to the Stores via the StoreConfig. Replicas proposing commands talk to the Tracker; replicas trying to serve follower reads talk to the Provider, which receives closed timestamp updates for the local node and its peers. ``` Node 1 | Node 2 | +---------+ Close +-----------+ | +-----------+ | Tracker |<--------| | | | | +-----+---+ | +-------+ | | | +-------+ | CanServe ^ | |Storage| | | | |Storage| |<---------+ | | --------+ | | | +-------+ | | |Track | | | | | +----+----+ | | Provider | | | Provider | | Follower| | +-----------+ | +-----------+ | Replica | | ^ ^ +----+----+ | |Subscribe |Notify | | | | | +---------+ | Request | | |Proposing| Refresh +---+----+ <----- +----+-----+ Request | | Replica |<--------| Server | | Clients |<----------+ +---------+ +--------+ -----> +----------+ EnsureClient CT ``` Release note: None Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
Contributor
Build succeeded |
Contributor
|
Awesome! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NB: This is a reopen of #27595 which needs a fix to the CI stress tester
to merge before it can pass CI (and I don't want to wait for that). No
need to review.
This commit introduces the basic closed timestamp subsystem. It does
not hook it up into the CockroachDB node yet.
Great care has been taken to make each individual component self-
contained and cleanly interfaced to the outside world. The package
layout relative to
closedtsis the following:.: slim root package containing only the most basic CT interfaces
./ctpb: protobuf definitions and service
./config: fat package pulling in everything needed to actually run
./storage: storage for per-node closed timestamp state
./minprop: minimum proposal timestamp tracker
./provider: the Provider, centralizing all closed timestamp information.
Most of these packages depend on
closedts(more precisely, on theinterfaces they need to use), but in turn don't depend on each other.
The following diagram together with the
ctconfigandctpackagesshould be instructive in getting a bird's eye view of how the subsystem
fits into CockroachDB: All of the components are grouped in a Container
(intended as a pass-around per-instance Singleton) and is passed down to
the Stores via the StoreConfig. Replicas proposing commands talk to the
Tracker; replicas trying to serve follower reads talk to the Provider,
which receives closed timestamp updates for the local node and its
peers.
Release note: None