- Notifications
You must be signed in to change notification settings - Fork5
Commit4f1b890
committed
Merge the various forms of transaction commit & abort records.
Since465883b two versions of commit records have existed. A compactversion that was used when no cache invalidations, smgr unlinks andsimilar were needed, and a full version that could deal with allthat. Additionally the full version was embedded into twophase commitrecords.That resulted in a measurable reduction in the size of the logged WAL insome workloads. But more recently additions like logical decoding, whiche.g. needs information about the database something was executed on,made it applicable in fewer situations. The static split generally madeit hard to expand the commit record, because concerns over the size madeit hard to add anything to the compact version.Additionally it's not particularly pretty to have twophase.c insertRM_XACT records.Rejigger things so that the commit and abort records only have one formeach, including the twophase equivalents. The presence of the variousoptional (in the sense of not being in every record) pieces is indicatedby a bits in the 'xinfo' flag. That flag previously was not included incompact commit records. To prevent an increase in size due to itspresence, it's only included if necessary; signalled by a bit in thexl_info bits available for xact.c, similar to heapam.c'sXLOG_HEAP_OPMASK/XLOG_HEAP_INIT_PAGE.Twophase commit/aborts are now the same as their normalcounterparts. The original transaction's xid is included in an optionaldata field.This means that commit records generally are smaller, except in the caseof a transaction with subtransactions, but no other special cases; theincrease there is four bytes, which seems acceptable given that the morecommon case of not having subtransactions shrank. The savings areespecially measurable for twophase commits, which previously always usedthe full version; but will in practice only infrequently have requiredthat.The motivation for this work are not the space savings and anddeduplication though; it's that it makes it easier to extend commitrecords with additional information. That's just a few lines of codenow; without impacting the common case where that information is notneeded.Discussion: 20150220152150.GD4149@awork2.anarazel.de, 235610.92468.qm%40web29004.mail.ird.yahoo.comReviewed-By: Heikki Linnakangas, Simon Riggs1 parenta0f5954 commit4f1b890
File tree
7 files changed
+748
-507
lines changed- src
- backend
- access
- rmgrdesc
- transam
- replication/logical
- include/access
7 files changed
+748
-507
lines changedLines changed: 175 additions & 70 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
22 | 157 |
| |
23 | 158 |
| |
24 |
| - | |
| 159 | + | |
25 | 160 |
| |
| 161 | + | |
26 | 162 |
| |
27 |
| - | |
28 | 163 |
| |
29 |
| - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
30 | 169 |
| |
31 | 170 |
| |
32 | 171 |
| |
33 |
| - | |
| 172 | + | |
34 | 173 |
| |
35 | 174 |
| |
36 |
| - | |
| 175 | + | |
37 | 176 |
| |
38 |
| - | |
| 177 | + | |
39 | 178 |
| |
40 | 179 |
| |
41 | 180 |
| |
42 | 181 |
| |
43 | 182 |
| |
44 |
| - | |
| 183 | + | |
45 | 184 |
| |
46 | 185 |
| |
47 |
| - | |
48 |
| - | |
| 186 | + | |
| 187 | + | |
49 | 188 |
| |
50 |
| - | |
| 189 | + | |
51 | 190 |
| |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
| 191 | + | |
57 | 192 |
| |
58 |
| - | |
| 193 | + | |
59 | 194 |
| |
60 | 195 |
| |
61 |
| - | |
| 196 | + | |
62 | 197 |
| |
63 |
| - | |
| 198 | + | |
64 | 199 |
| |
65 | 200 |
| |
66 | 201 |
| |
| |||
80 | 215 |
| |
81 | 216 |
| |
82 | 217 |
| |
| 218 | + | |
| 219 | + | |
| 220 | + | |
83 | 221 |
| |
84 | 222 |
| |
85 | 223 |
| |
86 |
| - | |
| 224 | + | |
87 | 225 |
| |
| 226 | + | |
88 | 227 |
| |
89 | 228 |
| |
90 |
| - | |
| 229 | + | |
91 | 230 |
| |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
104 | 234 |
| |
105 | 235 |
| |
106 |
| - | |
| 236 | + | |
107 | 237 |
| |
108 | 238 |
| |
109 |
| - | |
| 239 | + | |
110 | 240 |
| |
111 |
| - | |
| 241 | + | |
112 | 242 |
| |
113 | 243 |
| |
114 | 244 |
| |
115 | 245 |
| |
116 | 246 |
| |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 | 247 |
| |
| 248 | + | |
| 249 | + | |
122 | 250 |
| |
123 |
| - | |
124 |
| - | |
| 251 | + | |
| 252 | + | |
125 | 253 |
| |
126 | 254 |
| |
127 | 255 |
| |
| |||
140 | 268 |
| |
141 | 269 |
| |
142 | 270 |
| |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
| 271 | + | |
148 | 272 |
| |
149 |
| - | |
150 |
| - | |
151 |
| - | |
| 273 | + | |
152 | 274 |
| |
153 | 275 |
| |
154 | 276 |
| |
155 |
| - | |
| 277 | + | |
156 | 278 |
| |
157 |
| - | |
| 279 | + | |
158 | 280 |
| |
159 | 281 |
| |
160 | 282 |
| |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
| 283 | + | |
176 | 284 |
| |
177 | 285 |
| |
178 | 286 |
| |
| |||
193 | 301 |
| |
194 | 302 |
| |
195 | 303 |
| |
196 |
| - | |
| 304 | + | |
197 | 305 |
| |
198 | 306 |
| |
199 | 307 |
| |
| |||
213 | 321 |
| |
214 | 322 |
| |
215 | 323 |
| |
216 |
| - | |
217 |
| - | |
218 |
| - | |
219 | 324 |
| |
220 | 325 |
| |
221 | 326 |
| |
|
0 commit comments
Comments
(0)