Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-20.2: server: add diagnostics support for tenants #58517

Merged

Conversation

andy-kimball
Copy link
Contributor

Backport 2/2 commits from #58399.

/cc @cockroachdb/release


Previously, SQL-only tenants did not report feature usage to the registration
server. This commit adds that support via the creation of a new diagnostics
package that encapsulates the usage report code in updates.go.

However, since this commit needs to be backported to 20.2, the new code is
only used with tenants, and is side-by-side with the existing code, which
will continue to operate as before. A follow-on commit (that will not be
backported) will fully replace the old implementation with the new.

Release note (sql change): Multi-tenant clusters will now send anonymous usage
information to the central CRDB registration server.

@andy-kimball andy-kimball requested review from tbg and a team January 6, 2021 22:57
@andy-kimball andy-kimball requested a review from a team as a code owner January 6, 2021 22:57
@andy-kimball andy-kimball requested review from adityamaru and removed request for a team January 6, 2021 22:57
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg
Copy link
Member

tbg commented Jan 7, 2021

Clean backport, right?

An extra commit (roachtest) seems to have snuck in; if you wanted to backport that implicitly a) probably better in a separate PR (though I'm ok with it now that it's already here) and b) just mention in the commit msg that it's intentional.

It looks like you caught an import cycle somewhere, so some manual fixup seems to be necessary.

This commit contains preparatory changes for supporting tenants in our
diagnostics reporting code. Tenants run one or more SQL-only instances
rather than full CRDB nodes.

This commit is intended to be backported to a 20.2 patch release, so it
isolates changes that might affect other production code that's unrelated
to tenants. That includes adding an optional field to the DiagnosticsReport
proto and updating BuildReportingURL to use it. It also renames sqlServer
to SQLServer, so that it can be returned from the exported StartTenant
method.

Release note: None
@andy-kimball
Copy link
Contributor Author

Yes, I had to do a bunch of small changes due to various re-factorings that have happened in the 21.1 codebase.

I didn't intend to add that 3rd commit - it seems that was backport that did it, I think b/c there was a race condition with a separate PR being only partially merged right at the moment I ran the backport tool. I got rid of that.

Copy link
Contributor Author

@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.

Also, there was one substantive change I made in PeriodicallyReportDiagnostics. For this backport, I always run ReportDiagnostics rather than testing the diagnostics.reporting.interval cluster setting first. You can see the comment in that function explaining why.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @tbg)

Previously, SQL-only tenants did not report feature usage to the registration
server. This commit adds that support via the creation of a new diagnostics
package that encapsulates the usage report code in updates.go.

However, since this commit needs to be backported to 20.2, the new code is
*only* used with tenants, and is side-by-side with the existing code, which
will continue to operate as before. A follow-on commit (that will not be
backported) will fully replace the old implementation with the new.

Release note (sql change): Multi-tenant clusters will now send anonymous usage
information to the central CRDB registration server.
Copy link
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 9 of 9 files at r1, 19 of 19 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru)

@andy-kimball andy-kimball merged commit 350edd7 into cockroachdb:release-20.2 Jan 11, 2021
@andy-kimball andy-kimball deleted the backport20.2-58399 branch January 11, 2021 14:48
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.

None yet

3 participants