Skip to content

release-21.2: backup: include tenant usage data in backup#70829

Merged
RaduBerinde merged 3 commits intocockroachdb:release-21.2from
RaduBerinde:backport21.2-70595
Sep 30, 2021
Merged

release-21.2: backup: include tenant usage data in backup#70829
RaduBerinde merged 3 commits intocockroachdb:release-21.2from
RaduBerinde:backport21.2-70595

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

Backport 3/3 commits from #70595.

/cc @cockroachdb/release


backup: minor refactoring of tenant backup planning

This commit extracts the code that generates the tenant metadata into
a separate file.

Release note: None

Release justification: Part of a larger change that is necessary to
fully support backup and restore of non-system tenants. The change
only concerns multi-tenant deployments and should not affect single
tenant deployments.

backup: include tenant usage data in backup

We now back up and restore relevant data from tenant_usage: the last
token bucket state, and (more importantly) total all-time tenant
consumption.

The backup manifest proto had to change, but we still support
restoring tenant data from older manifests.

Release note: None

Release justification: This change is necessary to fully support
backup and restore of non-system tenants. The change only concerns
multi-tenant deployments and should not affect single tenant
deployments.

Informs #68479.

tenantcostserver: check tenant when initializing state

The tenant_usage data is initialized as needed unless it is configured
explicitly. This commit adds validation of the tenant in this case,
preventing the state from appearing for a deleted tenant.

Release note: None

Release justification: Part of a larger change that is necessary to
fully support backup and restore of non-system tenants. The change
only concerns multi-tenant deployments and should not affect single
tenant deployments.

This commit extracts the code that generates the tenant metadata into
a separate file.

Release note: None

Release justification: Part of a larger change that is necessary to
fully support backup and restore of non-system tenants. The change
only concerns multi-tenant deployments and should not affect single
tenant deployments.
We now back up and restore relevant data from tenant_usage: the last
token bucket state, and (more importantly) total all-time tenant
consumption.

The backup manifest proto had to change, but we still support
restoring tenant data from older manifests.

Release note: None

Release justification: This change is necessary to fully support
backup and restore of non-system tenants. The change only concerns
multi-tenant deployments and should not affect single tenant
deployments.
The tenant_usage data is initialized as needed unless it is configured
explicitly. This commit adds validation of the tenant in this case,
preventing the state from appearing for a deleted tenant.

Release note: None

Release justification: Part of a larger change that is necessary to
fully support backup and restore of non-system tenants. The change
only concerns multi-tenant deployments and should not affect single
tenant deployments.
@RaduBerinde RaduBerinde requested review from a team and dt September 28, 2021 15:57
@RaduBerinde RaduBerinde requested a review from a team as a code owner September 28, 2021 15:57
@RaduBerinde RaduBerinde requested a review from a team September 28, 2021 15:57
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Sep 28, 2021

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @dt)

@RaduBerinde RaduBerinde merged commit 88d8c1c into cockroachdb:release-21.2 Sep 30, 2021
@RaduBerinde RaduBerinde deleted the backport21.2-70595 branch September 30, 2021 02:05
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