- Notifications
You must be signed in to change notification settings - Fork5
Commitec5896a
committed
Fix several weaknesses in slot and logical replication on-disk serialization.
Heikki noticed in 544E23C0.8090605@vmware.com that slot.c andsnapbuild.c were missing the FIN_CRC32 call when computing/checkingchecksums of on disk files. That doesn't lower the the error detectioncapabilities of the checksum, but is inconsistent with other usages.In a followup mail Heikki also noticed that, contrary to a comment,the 'version' and 'length' struct fields of replication slot's on diskdata where not covered by the checksum. That's not likely to lead toactually missed corruption as those fields are cross checked with theexpected version and the actual file length. But it's wrongnonetheless.As fixing these issues makes existing on disk files unreadable, bumpthe expected versions of on disk files for both slots and logicaldecoding historic catalog snapshots. This means that loading oldfiles will fail withERROR: "replication slot file ... has unsupported version 1"andERROR: "snapbuild state file ... has unsupported version 1 instead of2" respectively. Given the low likelihood of anybody already usingthese new features in a production setup that seems acceptable.Fixing these issues made me notice that there's no regression testcovering the loading of historic snapshot from disk - so add one.Backpatch to 9.4 where these features were introduced.1 parentbd4ae0f commitec5896a
File tree
5 files changed
+116
-13
lines changed- contrib/test_decoding
- expected
- specs
- src/backend/replication
- logical
5 files changed
+116
-13
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
|
Lines changed: 43 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + |
Lines changed: 43 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + |
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1406 | 1406 |
| |
1407 | 1407 |
| |
1408 | 1408 |
| |
1409 |
| - | |
| 1409 | + | |
1410 | 1410 |
| |
1411 | 1411 |
| |
1412 | 1412 |
| |
| |||
1552 | 1552 |
| |
1553 | 1553 |
| |
1554 | 1554 |
| |
| 1555 | + | |
| 1556 | + | |
1555 | 1557 |
| |
1556 | 1558 |
| |
1557 | 1559 |
| |
| |||
1724 | 1726 |
| |
1725 | 1727 |
| |
1726 | 1728 |
| |
| 1729 | + | |
| 1730 | + | |
1727 | 1731 |
| |
1728 | 1732 |
| |
1729 | 1733 |
| |
|
Lines changed: 24 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 |
| |
65 | 70 |
| |
66 | 71 |
| |
67 |
| - | |
| 72 | + | |
68 | 73 |
| |
69 | 74 |
| |
70 |
| - | |
71 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 |
| |
73 | 84 |
| |
74 | 85 |
| |
75 |
| - | |
| 86 | + | |
76 | 87 |
| |
77 | 88 |
| |
78 | 89 |
| |
| |||
992 | 1003 |
| |
993 | 1004 |
| |
994 | 1005 |
| |
995 |
| - | |
996 |
| - | |
| 1006 | + | |
| 1007 | + | |
997 | 1008 |
| |
998 | 1009 |
| |
999 | 1010 |
| |
| |||
1002 | 1013 |
| |
1003 | 1014 |
| |
1004 | 1015 |
| |
1005 |
| - | |
1006 |
| - | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1007 | 1019 |
| |
1008 | 1020 |
| |
1009 | 1021 |
| |
| |||
1155 | 1167 |
| |
1156 | 1168 |
| |
1157 | 1169 |
| |
1158 |
| - | |
| 1170 | + | |
1159 | 1171 |
| |
1160 | 1172 |
| |
1161 | 1173 |
| |
| |||
1182 | 1194 |
| |
1183 | 1195 |
| |
1184 | 1196 |
| |
1185 |
| - | |
1186 |
| - | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1187 | 1200 |
| |
1188 | 1201 |
| |
1189 | 1202 |
| |
|
0 commit comments
Comments
(0)