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

fix: do not create metrics contention from background task permit #7730

Merged
merged 1 commit into from
May 13, 2024

Conversation

koivunej
Copy link
Contributor

@koivunej koivunej commented May 13, 2024

The background task loop permit metrics do two of with_label_values very often. Change the codepath to cache the counters on first access into a Lazy with enum_map::EnumMap. The expectation is that this should not fix for metric collection failures under load, but it doesn't hurt.

Cc: #7161

@koivunej koivunej requested a review from problame May 13, 2024 12:05
@koivunej koivunej requested a review from a team as a code owner May 13, 2024 12:05
Copy link

3060 tests run: 2927 passed, 0 failed, 133 skipped (full report)


Flaky tests (3)

Postgres 16

  • test_pageserver_init_node_id: debug
  • test_synthetic_size_while_deleting: release

Postgres 14

Code coverage* (full report)

  • functions: 31.4% (6332 of 20163 functions)
  • lines: 47.3% (47758 of 100973 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
539a8ef at 2024-05-13T12:51:52.865Z :recycle:

@koivunej koivunej merged commit 4d8a10a into main May 13, 2024
54 checks passed
@koivunej koivunej deleted the joonas/less_metric_contention branch May 13, 2024 14:49
a-masterov pushed a commit that referenced this pull request May 20, 2024
)

The background task loop permit metrics do two of `with_label_values`
very often. Change the codepath to cache the counters on first access
into a `Lazy` with `enum_map::EnumMap`. The expectation is that this
should not fix for metric collection failures under load, but it doesn't
hurt.

Cc: #7161
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

2 participants