Skip to content

liveness: introduce GetLivenessesFromKV#56243

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
irfansharif:201103.get-livenesses
Nov 3, 2020
Merged

liveness: introduce GetLivenessesFromKV#56243
craig[bot] merged 2 commits intocockroachdb:masterfrom
irfansharif:201103.get-livenesses

Conversation

@irfansharif
Copy link
Copy Markdown
Contributor

Now that we always create a liveness record on start up (#53805), we can simply
fetch all records from KV when wanting an up-to-date view of all nodes that
have ever been a part of the cluster. We add a helper to do as much, which
we'll rely on when introducing long running migrations (#56107).

It's a bit unfortunate that we're further adding on to the liveness API without
changing the underlying look-aside cache structure, but the up-to-date records
from KV directly is the world we're hoping to start moving towards over time.
The TODO added in 1 outlines what the future holds.

We'll also expose the GetLivenessesFromKV API we introduced earlier to pkg/sql.
We'll rely on it when needing to plumb in the liveness instance into the
migration manager process (prototyped in #56107)

It should be noted that this will be a relatively meatier form of a dependency
on node liveness from pkg/sql than we have currently. Today the only uses are
in DistSQL planning and in jobs2. As it relates to our multi-tenancy work,
the real use of this API will happen only on the system tenant. System tenants
alone have the privilege to set cluster settings (or at least the version
setting specifically), which is what the migration manager will be wired into.

Release note: None


First commit is from #56221, and can be ignored here.

@irfansharif irfansharif requested a review from a team November 3, 2020 15:58
@irfansharif irfansharif requested a review from a team as a code owner November 3, 2020 15:58
@irfansharif irfansharif requested a review from tbg November 3, 2020 15:58
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 79 of 79 files at r1, 2 of 2 files at r2, 2 of 2 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

Now that we always create a liveness record on start up (cockroachdb#53805), we can
simply fetch all records from KV when wanting an up-to-date view of all
nodes that have ever been a part of the cluster. We add a helper to do
as much, which we'll rely on when introducing long running migrations
(cockroachdb#56107).

It's a bit unfortunate that we're further adding on to the liveness API
without changing the underlying look-aside cache structure, but the
up-to-date records from KV directly is the world we're hoping to start
moving towards over time. The TODO added in [1] outlines what the future
holds.

[1]: cockroachdb@d631239

Release note: None
Expose the GetLivenessesFromKV API we introduced earlier to pkg/sql.
We'll eventually use this to power long running migrations (cockroachdb#56107),
plumbing the liveness instance into the migration manager process.

It should be noted that this will be a relatively meatier form of a
dependency on node liveness from pkg/sql than we have currently. Today
the only uses are in DistSQL planning and in jobs[1]. As it relates to
our multi-tenancy work, the real use of this API will happen only on the
system tenant. System tenants alone have the privilege to set cluster
settings (or at least the version setting specifically), which is what
the migration manager will be wired into.

[1]: cockroachdb#48795

Release note: None
@irfansharif irfansharif force-pushed the 201103.get-livenesses branch from e3401be to b2790ab Compare November 3, 2020 18:38
@irfansharif
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 3, 2020

Build succeeded:

@craig craig bot merged commit 0653b92 into cockroachdb:master Nov 3, 2020
@irfansharif irfansharif deleted the 201103.get-livenesses branch November 3, 2020 19:51
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