-
Notifications
You must be signed in to change notification settings - Fork 456
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
Correctly truncate VM #9342
Correctly truncate VM #9342
Conversation
5417 tests run: 5194 passed, 3 failed, 220 skipped (full report)Failures on Postgres 17
Flaky tests (9)Postgres 17
Postgres 15
Postgres 14
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
7303d05 at 2024-11-13T08:53:39.675Z :recycle: |
|
I copied some more comments from the corresponding postgres function here. |
c663b6b
to
db86bb9
Compare
If it's difficult to write tests using just SQL commands, one approach is to write a bespoken little C test extension that explicitly calls smgrtruncate() to truncate the VM etc. In this case, I don't think it's too hard to hit all the codepaths from SQL either though. Or you can do both; more tests is generally better. |
It is not a problem to create zero page at PS (caused by VM truncation). |
I see only one way how this error con be reproduced - please look at
It first update VM page in |
I don't follow. If the page is thrown away between modifying the VM page and WAL-logging, then the pageserver would still contain the old non.-zero version of the VM page, and there would be no truncation in the pageserver. |
We wallog all dirty VM/FSM pages when they are evicted.
So in PS for this VM page we have sequence: SMGR_TRUNCATE,FPI after applying which we will get non-zero page.
In this case the sequence will be FPI,SDMGR_TRUNCATE which produce zero VM page. |
I tried also "brute force" truing to reproduce the problem not deterministically, but more or less reliably, by running many concurrent tasks performing relation truncation:
... but still without any success. |
…ve serialed representation of other members
I added test which just inspect content of VM page and checks that truncation is performed correctly. |
Problem
#9240
Summary of changes
Correctly truncate VM page instead just replacing it with zero page.
Checklist before requesting a review
Checklist before merging