What's the relationship between checksum and full page image?
Recently, I learned some about PostgreSQL data checksum and feel confused about the relationship between checksum and full page image.
As the following comment said at:
If we need to protect hint bit updates from torn writes, WAL-log a
full page image of the page. This full page image is only necessary
if the hint bit update is the first change to the page since the
last checkpoint.
We don't check full_page_writes here because that logic is included
when we call XLogInsert() since the value changes dynamically.
As I known, if we need to protect pages from torn writes including hint bit updates, we should enable full_page_writes. Why do I need to write full page images at the WAL if the checksum is able to detect torn pages even if full_page_writes is off?
postgresql postgresql-9.3 transaction-log
add a comment |
Recently, I learned some about PostgreSQL data checksum and feel confused about the relationship between checksum and full page image.
As the following comment said at:
If we need to protect hint bit updates from torn writes, WAL-log a
full page image of the page. This full page image is only necessary
if the hint bit update is the first change to the page since the
last checkpoint.
We don't check full_page_writes here because that logic is included
when we call XLogInsert() since the value changes dynamically.
As I known, if we need to protect pages from torn writes including hint bit updates, we should enable full_page_writes. Why do I need to write full page images at the WAL if the checksum is able to detect torn pages even if full_page_writes is off?
postgresql postgresql-9.3 transaction-log
add a comment |
Recently, I learned some about PostgreSQL data checksum and feel confused about the relationship between checksum and full page image.
As the following comment said at:
If we need to protect hint bit updates from torn writes, WAL-log a
full page image of the page. This full page image is only necessary
if the hint bit update is the first change to the page since the
last checkpoint.
We don't check full_page_writes here because that logic is included
when we call XLogInsert() since the value changes dynamically.
As I known, if we need to protect pages from torn writes including hint bit updates, we should enable full_page_writes. Why do I need to write full page images at the WAL if the checksum is able to detect torn pages even if full_page_writes is off?
postgresql postgresql-9.3 transaction-log
Recently, I learned some about PostgreSQL data checksum and feel confused about the relationship between checksum and full page image.
As the following comment said at:
If we need to protect hint bit updates from torn writes, WAL-log a
full page image of the page. This full page image is only necessary
if the hint bit update is the first change to the page since the
last checkpoint.
We don't check full_page_writes here because that logic is included
when we call XLogInsert() since the value changes dynamically.
As I known, if we need to protect pages from torn writes including hint bit updates, we should enable full_page_writes. Why do I need to write full page images at the WAL if the checksum is able to detect torn pages even if full_page_writes is off?
postgresql postgresql-9.3 transaction-log
postgresql postgresql-9.3 transaction-log
edited Nov 26 '18 at 4:14
Laurenz Albe
49.5k102849
49.5k102849
asked Nov 26 '18 at 2:21
infernoinferno
178113
178113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The checksum will produce an error if you have a torn page, but it won't correct the error. All it tells you is that it is time to restore from backup.
If you want to avoid the problem alogether, leave full_page_writes set to on.
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
I think you understood. Checksums andfull_page_writeare not coupled, are they?
– Laurenz Albe
Nov 26 '18 at 8:43
I just think checksum does a little bit of whatfull_page_writesshould do.
– inferno
Nov 26 '18 at 9:04
Checksums tell you that something went wrong,full_page_writesmakes sure it won't happen.
– Laurenz Albe
Nov 26 '18 at 16:08
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53473999%2fwhats-the-relationship-between-checksum-and-full-page-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The checksum will produce an error if you have a torn page, but it won't correct the error. All it tells you is that it is time to restore from backup.
If you want to avoid the problem alogether, leave full_page_writes set to on.
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
I think you understood. Checksums andfull_page_writeare not coupled, are they?
– Laurenz Albe
Nov 26 '18 at 8:43
I just think checksum does a little bit of whatfull_page_writesshould do.
– inferno
Nov 26 '18 at 9:04
Checksums tell you that something went wrong,full_page_writesmakes sure it won't happen.
– Laurenz Albe
Nov 26 '18 at 16:08
add a comment |
The checksum will produce an error if you have a torn page, but it won't correct the error. All it tells you is that it is time to restore from backup.
If you want to avoid the problem alogether, leave full_page_writes set to on.
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
I think you understood. Checksums andfull_page_writeare not coupled, are they?
– Laurenz Albe
Nov 26 '18 at 8:43
I just think checksum does a little bit of whatfull_page_writesshould do.
– inferno
Nov 26 '18 at 9:04
Checksums tell you that something went wrong,full_page_writesmakes sure it won't happen.
– Laurenz Albe
Nov 26 '18 at 16:08
add a comment |
The checksum will produce an error if you have a torn page, but it won't correct the error. All it tells you is that it is time to restore from backup.
If you want to avoid the problem alogether, leave full_page_writes set to on.
The checksum will produce an error if you have a torn page, but it won't correct the error. All it tells you is that it is time to restore from backup.
If you want to avoid the problem alogether, leave full_page_writes set to on.
answered Nov 26 '18 at 4:09
Laurenz AlbeLaurenz Albe
49.5k102849
49.5k102849
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
I think you understood. Checksums andfull_page_writeare not coupled, are they?
– Laurenz Albe
Nov 26 '18 at 8:43
I just think checksum does a little bit of whatfull_page_writesshould do.
– inferno
Nov 26 '18 at 9:04
Checksums tell you that something went wrong,full_page_writesmakes sure it won't happen.
– Laurenz Albe
Nov 26 '18 at 16:08
add a comment |
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
I think you understood. Checksums andfull_page_writeare not coupled, are they?
– Laurenz Albe
Nov 26 '18 at 8:43
I just think checksum does a little bit of whatfull_page_writesshould do.
– inferno
Nov 26 '18 at 9:04
Checksums tell you that something went wrong,full_page_writesmakes sure it won't happen.
– Laurenz Albe
Nov 26 '18 at 16:08
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
So I think the whole work of checksum is to produce an error if I have a torn page, no matter what it is caused. Use full_page_writes to correct the error. Is it not a good idea to decouple checksum and what the full_page_writes do?
– inferno
Nov 26 '18 at 8:26
I think you understood. Checksums and
full_page_write are not coupled, are they?– Laurenz Albe
Nov 26 '18 at 8:43
I think you understood. Checksums and
full_page_write are not coupled, are they?– Laurenz Albe
Nov 26 '18 at 8:43
I just think checksum does a little bit of what
full_page_writes should do.– inferno
Nov 26 '18 at 9:04
I just think checksum does a little bit of what
full_page_writes should do.– inferno
Nov 26 '18 at 9:04
Checksums tell you that something went wrong,
full_page_writes makes sure it won't happen.– Laurenz Albe
Nov 26 '18 at 16:08
Checksums tell you that something went wrong,
full_page_writes makes sure it won't happen.– Laurenz Albe
Nov 26 '18 at 16:08
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53473999%2fwhats-the-relationship-between-checksum-and-full-page-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown