Skip to content

[compute] fix: background worker that collects installed extension metrics now updates collection interval #12277

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

thesuhas
Copy link
Contributor

Problem

Previously, the background worker that collects the list of installed extensions across DBs had a timeout set to 1 hour. This cause a problem with computes that had a suspend_timeout > 1 hour as this collection was treated as activity, preventing compute shutdown.

Issue: https://github.com/neondatabase/cloud/issues/30147

Summary of changes

Passing the suspend_timeout as part of the ComputeSpec so that any updates to this are taken into account by the background worker and updates its collection interval.

@thesuhas thesuhas requested review from a team as code owners June 17, 2025 18:30
@thesuhas thesuhas marked this pull request as draft June 17, 2025 18:30
Copy link

github-actions bot commented Jun 17, 2025

8481 tests run: 7898 passed, 0 failed, 583 skipped (full report)


Flaky tests (2)

Postgres 17

Postgres 16

Code coverage* (full report)

  • functions: 32.1% (9026 of 28138 functions)
  • lines: 48.4% (80247 of 165951 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
0574ecc at 2025-06-18T00:11:58.558Z :recycle:

@thesuhas thesuhas marked this pull request as ready for review June 17, 2025 19:46
@tristan957
Copy link
Member

What is the justification for the atomicity?

@tristan957
Copy link
Member

Passing the suspend_timeout as part of the ComputeSpec so that any updates to this are taken into account by the background worker and updates its collection interval.

Where is the code for this?

@thesuhas
Copy link
Contributor Author

thesuhas commented Jun 17, 2025

Passing the suspend_timeout as part of the ComputeSpec so that any updates to this are taken into account by the background worker and updates its collection interval.

Where is the code for this?

There's a PR on control plane side: https://github.com/neondatabase/cloud/pull/30318

The updation logic is here (for the worker) and the actual value is updated in reconfigure

@thesuhas
Copy link
Contributor Author

What is the justification for the atomicity?

The interval is in an Atomicu64 and you need to take a lock to read/write to it. Docs

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.

2 participants