mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
This allows data checksums to be enabled, or disabled, in a running cluster without restricting access to the cluster during processing. Data checksums could prior to this only be enabled during initdb or when the cluster is offline using the pg_checksums app. This commit introduce functionality to enable, or disable, data checksums while the cluster is running regardless of how it was initialized. A background worker launcher process is responsible for launching a dynamic per-database background worker which will mark all buffers dirty for all relation with storage in order for them to have data checksums calculated on write. Once all relations in all databases have been processed, the data_checksums state will be set to on and the cluster will at that point be identical to one which had data checksums enabled during initialization or via offline processing. When data checksums are being enabled, concurrent I/O operations from backends other than the data checksums worker will write the checksums but not verify them on reading. Only when all backends have absorbed the procsignalbarrier for setting data_checksums to on will they also start verifying checksums on reading. The same process is repeated during disabling; all backends write checksums but do not verify them until the barrier for setting the state to off has been absorbed by all. This in-progress state is used to ensure there are no false negatives (or positives) due to reading a checksum which is not in sync with the page. A new testmodule, test_checksums, is introduced with an extensive set of tests covering both online and offline data checksum mode changes. The tests which run concurrent pgbdench during online processing are gated behind the PG_TEST_EXTRA flag due to being very expensive to run. Two levels of PG_TEST_EXTRA flags exist to turn on a subset of the expensive tests, or the full suite of multiple runs. This work is based on an earlier version of this patch which was reviewed by among others Heikki Linnakangas, Robert Haas, Andres Freund, Tomas Vondra, Michael Banck and Andrey Borodin. During the work on this new version, Tomas Vondra has given invaluable assistance with not only coding and reviewing but very in-depth testing. Author: Daniel Gustafsson <daniel@yesql.se> Author: Magnus Hagander <magnus@hagander.net> Co-authored-by: Tomas Vondra <tomas@vondra.me> Reviewed-by: Tomas Vondra <tomas@vondra.me> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/CABUevExz9hUUOLnJVr2kpw9Cx=o4MCr1SVKwbupzuxP7ckNutA@mail.gmail.com Discussion: https://postgr.es/m/20181030051643.elbxjww5jjgnjaxg@alap3.anarazel.de Discussion: https://postgr.es/m/CABUevEwE3urLtwxxqdgd5O2oQz9J717ZzMbh+ziCSa5YLLU_BA@mail.gmail.com |
||
|---|---|---|
| .. | ||
| datachecksums.gv | ||
| datachecksums.svg | ||
| fixup-svg.xsl | ||
| genetic-algorithm.gv | ||
| genetic-algorithm.svg | ||
| gin.gv | ||
| gin.svg | ||
| Makefile | ||
| meson.build | ||
| pagelayout.svg | ||
| pagelayout.txt | ||
| README | ||
| temporal-delete.svg | ||
| temporal-delete.txt | ||
| temporal-entities.svg | ||
| temporal-entities.txt | ||
| temporal-references.svg | ||
| temporal-references.txt | ||
| temporal-update.svg | ||
| temporal-update.txt | ||
Images
======
This directory contains images for use in the documentation.
Creating an image
-----------------
A variety of tools can be used to create an image. The appropriate
choice depends on the nature of the image. We prefer workflows that
involve diffable source files.
These tools are acceptable:
- Graphviz (https://graphviz.org/)
- Ditaa v0.11.0 or later (https://github.com/stathissideris/ditaa)
We use SVG as the format for integrating the image into the ultimate
output formats of the documentation, that is, HTML, PDF, and others.
Therefore, any tool used needs to be able to produce SVG.
This directory contains makefile and meson rules to build SVG from common
input formats, using some common styling.
fixup-svg.xsl applies some postprocessing to the SVG files produced by
those external tools to address assorted issues. See comments in
there, and adjust and expand as necessary.
Both the source and the SVG output file are committed in this
directory. That way, we don't need all developers to have all the
tools installed. While we accept that there could be some gratuitous
diffs in the SVG output depending the specific tool, let's keep an eye
on that and keep it to a minimum.
Using an image in DocBook
-------------------------
Here is an example for using an image in DocBook:
<figure id="gin-internals-figure">
<title>GIN Internals</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/gin.svg" format="SVG" width="100%"/>
</imageobject>
</mediaobject>
</figure>
Notes:
- The real action is in the <mediaobject> element, but typically a
<figure> should be wrapped around it and an <xref> to the figure
should be put into the text somewhere. Don't just put an image into
the documentation without a link to it and an explanation of it.
- Things are set up so that we only need one <imagedata> element, even
with different output formats.
- The attribute format="SVG" is required. If you omit it, it will
still appear to work, but the stylesheets do a better job if the
image is declared as SVG explicitly.
- The width should be set to something. This ensures that the image
is scaled to fit the page in PDF output. (Other widths than 100%
might be appropriate.)