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

test: no missed wakeups, cancellation and timeout flow to downloads #7863

Merged
merged 11 commits into from
Jun 4, 2024

Conversation

koivunej
Copy link
Member

@koivunej koivunej commented May 23, 2024

I suspected a wakeup could be lost with remote_storage::support::DownloadStream if the cancellation and inner stream wakeups happen simultaneously. The next poll would only return the cancellation error without setting the wakeup. There is no lost wakeup because the single future for getting the cancellation error is consumed when the value is ready, and a new future is created for the next value. The new future is always polled. Similarly, if only the Stream::poll_next is being used after a Some(_) value has been yielded, it makes no sense to have an expectation of a wakeup for the (N+1)th stream value already set because when a value is wanted, Stream::poll_next will be called.

A test is added to show that the above is true.

Additionally, there was a question of these cancellations and timeouts flowing to attached or secondary tenant downloads. A test is added to show that this, in fact, happens.

Lastly, a warning message is logged when a download stream is polled after a timeout or cancellation error (currently unexpected) so we can rule it out while troubleshooting.

@koivunej koivunej changed the title test: show that there is no missed wakeup test(remote_storage): show that there is no missed wakeup May 23, 2024
Copy link

github-actions bot commented May 23, 2024

3186 tests run: 3047 passed, 0 failed, 139 skipped (full report)


Flaky tests (1)

Postgres 16

  • test_pageserver_restarts_under_worload: release

Code coverage* (full report)

  • functions: 31.5% (6573 of 20866 functions)
  • lines: 48.4% (50863 of 104992 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
700c12d at 2024-06-04T09:39:53.155Z :recycle:

@koivunej koivunej marked this pull request as ready for review May 23, 2024 17:03
@koivunej koivunej requested a review from a team as a code owner May 23, 2024 17:03
@koivunej koivunej requested review from problame and jcsp and removed request for problame May 23, 2024 17:03
@koivunej koivunej changed the title test(remote_storage): show that there is no missed wakeup test(remote_storage): no missed wakeups, cancellation and timeout flow to downloads May 24, 2024
@koivunej koivunej changed the title test(remote_storage): no missed wakeups, cancellation and timeout flow to downloads test: no missed wakeups, cancellation and timeout flow to downloads May 24, 2024
@koivunej koivunej enabled auto-merge (squash) May 24, 2024 10:49
@koivunej koivunej disabled auto-merge May 31, 2024 20:03
pageserver/src/tenant/secondary/downloader.rs Show resolved Hide resolved
test_runner/regress/test_ondemand_download.py Outdated Show resolved Hide resolved
test_runner/regress/test_ondemand_download.py Show resolved Hide resolved
test_runner/regress/test_ondemand_download.py Show resolved Hide resolved
test_runner/regress/test_ondemand_download.py Outdated Show resolved Hide resolved
@koivunej koivunej merged commit 0acb604 into main Jun 4, 2024
63 of 64 checks passed
@koivunej koivunej deleted the joonas/missed_wakeup branch June 4, 2024 11:19
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