Skip to content

scheduledlogging: various fixes to index stat collection#87773

Merged
craig[bot] merged 7 commits intocockroachdb:masterfrom
knz:20220910-schedstasts
Sep 12, 2022
Merged

scheduledlogging: various fixes to index stat collection#87773
craig[bot] merged 7 commits intocockroachdb:masterfrom
knz:20220910-schedstasts

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Sep 10, 2022

As I was reviewing #87525, I noticed that the actual test cases were missing.
Then, as I tried to fix that, I discovered a couple of other shortcomings. This PR fixes them.

Fixes #87771.
Informs #87772.

knz added 5 commits September 10, 2022 09:45
The change in 4f632e1 was missing its
regression tests (there were no indexes created). This patch fixes it
and also simplifies the test code.

Release note: None
The setting classes for
`sql.telemetry.capture_index_usage_stats.interval`,
`sql.telemetry.capture_index_usage_stats.check_enabled_interval`,
`sql.telemetry.capture_index_usage_stats.logging_delay` were
incorrect.

Since the telemetry is running in every tenant, the tenants need to be
able to query the value of the setting.

(We are not allowing the tenants to write to them as we don't want
them to influence the volume of telemetry.)

Release note: None
This test was failing under stress because it wasn't able to tolerate
a 1-second rounding difference between actual and expected intervals.

This commit fixes it.

Release note: None
@knz knz requested review from THardy98 and xinhaoz September 10, 2022 08:47
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Sep 10, 2022

Please also indicate if this needs to be backported to 22.1

knz added 2 commits September 11, 2022 09:33
This test takes between 1 and 2 minutes to run. (cockroachdb#87772)

Release note: None
The idiomatic go way to handle timers is to `Close` them in a
`defer`. This patch does this.

Additionally, the index stat collection could enter into a tight loop
when certain cluster settings are set to zero. This patch removes that
edge case.

Release note: None
@knz knz force-pushed the 20220910-schedstasts branch from 7fab9b9 to a41310d Compare September 11, 2022 07:36
Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

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

Additional test cases :lgtm:

Reviewed 1 of 2 files at r6, 1 of 1 files at r7.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @THardy98)

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Sep 12, 2022

So what do you think about backports?

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Sep 12, 2022

bors r=xinhaoz

@craig craig bot merged commit 3b95d11 into cockroachdb:master Sep 12, 2022
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 12, 2022

Build succeeded:

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Sep 12, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 0ec06d7 to blathers/backport-release-22.2-87773: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@THardy98
Copy link
Copy Markdown

THardy98 commented Oct 3, 2022

So what do you think about backports?

With #88999 backported to 22.1, we can probably backport this to 22.1 as well (also, super sorry for not seeing this earlier).

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.

schedulinglogging: some cluster setting values cause CPU usage to increase to 100%

4 participants