Commit 428a260
committed
Skip foreign tablespaces when running pg_checksums/pg_verify_checksums
Attempting to use pg_checksums (pg_verify_checksums in 11) on a data
folder which includes tablespace paths used across multiple major
versions would cause pg_checksums to scan all directories present in
pg_tblspc, and not only marked with TABLESPACE_VERSION_DIRECTORY. This
could lead to failures when for example running sanity checks on an
upgraded instance with --check. Even worse, it was possible to rewrite
on-disk pages with --enable for a cluster potentially online.
This commit makes pg_checksums skip any directories not named
TABLESPACE_VERSION_DIRECTORY, similarly to what is done for base
backups.
Reported-by: Michael Banck
Author: Michael Banck, Bernd Helmle
Discussion: https://postgr.es/m/62031974fd8e941dd8351fbc8c7eff60d59c5338.camel@credativ.de
backpatch-through: 111 parent 05d8449 commit 428a260Copy full SHA for 428a260
File tree
Expand file treeCollapse file tree
2 files changed
+54
-2
lines changedOpen diff view settings
Filter options
- src/bin/pg_checksums
- t
Expand file treeCollapse file tree
2 files changed
+54
-2
lines changedOpen diff view settings
Collapse file
src/bin/pg_checksums/pg_checksums.c
Copy file name to clipboardExpand all lines: src/bin/pg_checksums/pg_checksums.c+46-1Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
385 | 385 | |
386 | 386 | |
387 | 387 | |
388 | | - |
| 388 | + |
| 389 | + |
| 390 | + |
| 391 | + |
| 392 | + |
| 393 | + |
| 394 | + |
| 395 | + |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
| 407 | + |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
| 412 | + |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
| 417 | + |
| 418 | + |
| 419 | + |
| 420 | + |
| 421 | + |
| 422 | + |
| 423 | + |
| 424 | + |
| 425 | + |
| 426 | + |
| 427 | + |
| 428 | + |
| 429 | + |
| 430 | + |
| 431 | + |
| 432 | + |
| 433 | + |
389 | 434 | |
390 | 435 | |
391 | 436 | |
|
Collapse file
src/bin/pg_checksums/t/002_actions.pl
Copy file name to clipboardExpand all lines: src/bin/pg_checksums/t/002_actions.pl+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
8 | | - |
| 8 | + |
9 | 9 | |
10 | 10 | |
11 | 11 | |
| ||
217 | 217 | |
218 | 218 | |
219 | 219 | |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
220 | 227 | |
221 | 228 | |
222 | 229 | |
|
0 commit comments