neondatabase / neon

Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-like database branching, and scale to zero.
https://neon.tech
Apache License 2.0
14.48k stars 420 forks source link

storcon: use separate scheduling context for each tenant in fill/drain #8116

Closed VladLazar closed 3 months ago

VladLazar commented 3 months ago

Problem

Service::drain_node and Service::fill_node both use a ScheduleContext in an attempt to spread out shards belonging to the same tenant. However, they're not resetting the schedule context after processing each tenant.

Summary of changes

Reset the scheduling context after each tenant. We are using the fact that the shards inServiceState::tenants are already ordered by tenant id.

Checklist before requesting a review

Checklist before merging

github-actions[bot] commented 3 months ago

3228 tests run: 3111 passed, 0 failed, 117 skipped (full report)


Flaky tests (1) #### Postgres 14 - `test_subscriber_restart`: [release](https://neon-github-public-dev.s3.amazonaws.com/reports/pr-8116/9594497952/index.html#suites/8be0c222d5601535470e7e5978bbfb03/1171c9bff3b14c4/retries)

Code coverage* (full report)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
83fdc07b20afb411eb00587331b88259a1ff6742 at 2024-06-20T09:41:57.782Z :recycle:
VladLazar commented 3 months ago

Replaced by https://github.com/neondatabase/neon/pull/8119