Skip to content

Commit

Permalink
fix(pageserver): schedule compaction immediately if pending (#10684)
Browse files Browse the repository at this point in the history
## Problem

The code is intended to reschedule compaction immediately if there are
pending tasks. We set the duration to 0 before if there are pending
tasks, but this will go through the `if period == Duration::ZERO {`
branch and sleep for another 10 seconds.

## Summary of changes

Set duration to 1 so that it doesn't sleep for too long.

Signed-off-by: Alex Chi Z <[email protected]>
  • Loading branch information
skyzh authored Feb 5, 2025
1 parent 733a572 commit 0ceeec9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pageserver/src/tenant/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async fn compaction_loop(tenant: Arc<Tenant>, cancel: CancellationToken) {
error_run_count = 0;
// schedule the next compaction immediately in case there is a pending compaction task
sleep_duration = if let CompactionOutcome::Pending = outcome {
Duration::ZERO
Duration::from_secs(1)
} else {
period
};
Expand Down

1 comment on commit 0ceeec9

@github-actions
Copy link

Choose a reason for hiding this comment

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

7576 tests run: 7212 passed, 2 failed, 362 skipped (full report)


Failures on Postgres 16

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_ingest_logical_message[release-pg16-github-actions-selfhosted-fsync-1024] or test_layer_map[release-pg16-github-actions-selfhosted]"
Flaky tests (1)

Postgres 17

Code coverage* (full report)

  • functions: 33.2% (8577 of 25805 functions)
  • lines: 49.0% (72127 of 147058 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
0ceeec9 at 2025-02-06T00:45:11.708Z :recycle:

Please sign in to comment.