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

Fix on-demand SLRU download on standby starting at WAL segment boundary #8031

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

hlinnaka
Copy link
Contributor

If a standby is started right after switching to a new WAL segment, the request in the SLRU download request would point to the beginning of the segment (e.g. 0/5000000), while the not-modified-since LSN would point to just after the page header (e.g. 0/5000028). It's effectively the same position, as there cannot be any WAL records in between, but the pageserver rightly errors out on any request where the request LSN < not-modified since LSN.

To fix, round down the not-modified since LSN to the beginning of the page like the request LSN.

Fixes issue #8030

@hlinnaka hlinnaka requested review from a team as code owners June 12, 2024 13:25
@hlinnaka hlinnaka requested review from save-buffer, arssher and knizhnik and removed request for save-buffer June 12, 2024 13:25
hlinnaka added a commit that referenced this pull request Jun 12, 2024
If a standby is started right after switching to a new WAL segment,
the request in the SLRU download request would point to the beginning
of the segment (e.g. 0/5000000), while the not-modified-since LSN
would point to just after the page header (e.g. 0/5000028). It's
effectively the same position, as there cannot be any WAL records in
between, but the pageserver rightly errors out on any request where
the request LSN < not-modified since LSN.

To fix, round down the not-modified since LSN to the beginning of the
page like the request LSN.

Fixes issue #8030
@hlinnaka hlinnaka force-pushed the fix-ondemand-slru-download-at-segment-boundary branch from b529fdd to 946e241 Compare June 12, 2024 13:28
If a standby is started right after switching to a new WAL segment,
the request in the SLRU download request would point to the beginning
of the segment (e.g. 0/5000000), while the not-modified-since LSN
would point to just after the page header (e.g. 0/5000028). It's
effectively the same position, as there cannot be any WAL records in
between, but the pageserver rightly errors out on any request where
the request LSN < not-modified since LSN.

To fix, round down the not-modified since LSN to the beginning of the
page like the request LSN.

Fixes issue #8030
@hlinnaka hlinnaka force-pushed the fix-ondemand-slru-download-at-segment-boundary branch from 946e241 to 2099e9d Compare June 12, 2024 13:29
Copy link

3216 tests run: 3074 passed, 0 failed, 142 skipped (full report)


Flaky tests (2)

Postgres 16

Postgres 15

  • test_vm_bit_clear_on_heap_lock_blackbox: debug

Code coverage* (full report)

  • functions: 31.6% (6631 of 20989 functions)
  • lines: 48.6% (51493 of 106042 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
2099e9d at 2024-06-12T14:17:18.762Z :recycle:

@hlinnaka hlinnaka merged commit dc2ab44 into main Jun 12, 2024
64 checks passed
@hlinnaka hlinnaka deleted the fix-ondemand-slru-download-at-segment-boundary branch June 12, 2024 21:31
save-buffer pushed a commit that referenced this pull request Jun 17, 2024
…ry (#8031)

If a standby is started right after switching to a new WAL segment, the
request in the SLRU download request would point to the beginning of the
segment (e.g. 0/5000000), while the not-modified-since LSN would point
to just after the page header (e.g. 0/5000028). It's effectively the
same position, as there cannot be any WAL records in between, but the
pageserver rightly errors out on any request where the request LSN <
not-modified since LSN.

To fix, round down the not-modified since LSN to the beginning of the
page like the request LSN.

Fixes issue #8030
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