Skip to content

storage: add closed timestamp subsystem#27922

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:ct-updates-rehashed
Jul 26, 2018
Merged

storage: add closed timestamp subsystem#27922
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:ct-updates-rehashed

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented Jul 25, 2018

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

@tbg tbg requested a review from a team July 25, 2018 18:19
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@tbg tbg closed this Jul 25, 2018
@tbg tbg reopened this Jul 25, 2018
@tbg tbg force-pushed the ct-updates-rehashed branch 2 times, most recently from 9d1ac86 to c010d5d Compare July 25, 2018 19:20
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
@tbg tbg force-pushed the ct-updates-rehashed branch from c010d5d to 9187de5 Compare July 26, 2018 08:27
@tbg
Copy link
Copy Markdown
Member Author

tbg commented Jul 26, 2018

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>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 26, 2018

Build succeeded

@craig craig bot merged commit 9187de5 into cockroachdb:master Jul 26, 2018
@nvb
Copy link
Copy Markdown
Contributor

nvb commented Jul 26, 2018

Awesome!

@tbg tbg deleted the ct-updates-rehashed branch August 20, 2018 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants