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

libpagestore: timeout = max(0, difference), not min(0, difference) #10274

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

Conversation

MMeent
Copy link
Contributor

@MMeent MMeent commented Jan 3, 2025

Using min(0, ...) causes us to fail to wait in most situations, so a lack of data would be a hot wait loop, which is bad.

Problem

We noticed high CPU usage in some situations

cc @hlinnaka

Using `min(0, ...)`  causes us to fail to wait in most situations, so a lack of data would be a hot wait loop, which is bad.
@MMeent MMeent requested review from a team as code owners January 3, 2025 19:27
@MMeent MMeent requested review from knizhnik and problame January 3, 2025 19:27
Copy link
Member

@ololobus ololobus left a comment

Choose a reason for hiding this comment

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

Looks like a very straightforward change, so LGTM. Unless @hlinnaka wants to add something

Copy link

github-actions bot commented Jan 3, 2025

7253 tests run: 6901 passed, 0 failed, 352 skipped (full report)


Flaky tests (2)

Postgres 17

Postgres 15

Code coverage* (full report)

  • functions: 31.2% (8411 of 26962 functions)
  • lines: 48.0% (66784 of 139234 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
8819671 at 2025-01-06T22:36:36.147Z :recycle:

MMeent added 2 commits January 3, 2025 21:37
While microseconds would be preferred, WaitEventSetWait only accepts a timeout in milliseconds.
GH editor was doing bad stuff. Adjust last location with LOG_INTERVAL_US, hopefully.
pgxn/neon/libpagestore.c Show resolved Hide resolved
Use int64 constant instead of uint64 constant, allowing values <0 and allowing MAX(0, ...) to work.
@MMeent MMeent requested a review from knizhnik January 6, 2025 20:30
@MMeent MMeent dismissed knizhnik’s stale review January 7, 2025 00:44

Fix applied.

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.

4 participants