postgresql/doc/src/sgml/images
Daniel Gustafsson f19c0eccae Online enabling and disabling of data checksums
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
2026-04-03 22:58:51 +02:00
..
datachecksums.gv Online enabling and disabling of data checksums 2026-04-03 22:58:51 +02:00
datachecksums.svg Online enabling and disabling of data checksums 2026-04-03 22:58:51 +02:00
fixup-svg.xsl Add XSL stylesheet to fix up SVG files 2019-06-19 21:26:42 +02:00
genetic-algorithm.gv Fix commit 641a5b7a14 for "nbsp" output in SVG files 2024-11-26 13:08:13 -05:00
genetic-algorithm.svg Fix commit 641a5b7a14 for "nbsp" output in SVG files 2024-11-26 13:08:13 -05:00
gin.gv Change Graphviz file extension 2019-05-26 08:08:05 +02:00
gin.svg Add XSL stylesheet to fix up SVG files 2019-06-19 21:26:42 +02:00
Makefile Online enabling and disabling of data checksums 2026-04-03 22:58:51 +02:00
meson.build Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
pagelayout.svg Add XSL stylesheet to fix up SVG files 2019-06-19 21:26:42 +02:00
pagelayout.txt
README doc: Update docs images README with required ditaa version 2026-02-13 11:50:17 +01:00
temporal-delete.svg Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
temporal-delete.txt Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
temporal-entities.svg doc: Add section for temporal tables 2025-11-05 16:38:04 +01:00
temporal-entities.txt doc: Add section for temporal tables 2025-11-05 16:38:04 +01:00
temporal-references.svg doc: Add section for temporal tables 2025-11-05 16:38:04 +01:00
temporal-references.txt doc: Add section for temporal tables 2025-11-05 16:38:04 +01:00
temporal-update.svg Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00
temporal-update.txt Add UPDATE/DELETE FOR PORTION OF 2026-04-01 19:06:03 +02:00

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.)