forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc55040c

Amit Kapila
WAL Log invalidations at command end with wal_level=logical.
When wal_level=logical, write invalidations at command end into WAL sothat decoding can use this information.This patch is required to allow the streaming of in-progress transactionsin logical decoding. The actual work to allow streaming will be committedas a separate patch.We still add the invalidations to the cache and write them to WAL atcommit time in RecordTransactionCommit(). This uses the existingXLOG_INVALIDATIONS xlog record type, from the RM_STANDBY_ID resourcemanager (see LogStandbyInvalidations for details).So existing code relying on those invalidations (e.g. redo) does not needto be changed.The invalidations written at command end uses a new xlog record typeXLOG_XACT_INVALIDATIONS, from RM_XACT_ID resource manager. SeeLogLogicalInvalidations for details.These new xlog records are ignored by existing redo procedures, whichstill rely on the invalidations written to commit records.The invalidations are decoded and accumulated in top-transaction, and thenexecuted during replay. This obviates the need to decode theinvalidations as part of a commit record.Bump XLOG_PAGE_MAGIC, since this introduces XLOG_XACT_INVALIDATIONS.Author: Dilip Kumar, Tomas Vondra, Amit KapilaReviewed-by: Amit KapilaTested-by: Neha Sharma and Mahendra Singh ThalorDiscussion:https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com1 parent38f60f1 commitc55040c
File tree
9 files changed
+166
-34
lines changed- src
- backend
- access
- rmgrdesc
- transam
- replication/logical
- utils/cache
- include
- access
- replication
- utils
9 files changed
+166
-34
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
396 | 396 |
| |
397 | 397 |
| |
398 | 398 |
| |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
399 | 406 |
| |
400 | 407 |
| |
401 | 408 |
| |
| |||
423 | 430 |
| |
424 | 431 |
| |
425 | 432 |
| |
| 433 | + | |
| 434 | + | |
| 435 | + | |
426 | 436 |
| |
427 | 437 |
| |
428 | 438 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1224 | 1224 |
| |
1225 | 1225 |
| |
1226 | 1226 |
| |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1227 | 1237 |
| |
1228 | 1238 |
| |
1229 | 1239 |
| |
| |||
6022 | 6032 |
| |
6023 | 6033 |
| |
6024 | 6034 |
| |
| 6035 | + | |
| 6036 | + | |
| 6037 | + | |
| 6038 | + | |
| 6039 | + | |
| 6040 | + | |
| 6041 | + | |
6025 | 6042 |
| |
6026 | 6043 |
| |
6027 | 6044 |
| |
|
Lines changed: 35 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
278 | 278 |
| |
279 | 279 |
| |
280 | 280 |
| |
281 |
| - | |
282 |
| - | |
| 281 | + | |
| 282 | + | |
283 | 283 |
| |
284 | 284 |
| |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
285 | 314 |
| |
286 | 315 |
| |
287 | 316 |
| |
| |||
334 | 363 |
| |
335 | 364 |
| |
336 | 365 |
| |
337 |
| - | |
338 |
| - | |
339 |
| - | |
340 | 366 |
| |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
346 | 371 |
| |
347 | 372 |
| |
348 | 373 |
| |
| |||
573 | 598 |
| |
574 | 599 |
| |
575 | 600 |
| |
576 |
| - | |
577 |
| - | |
578 |
| - | |
579 |
| - | |
580 |
| - | |
581 |
| - | |
582 |
| - | |
583 |
| - | |
584 |
| - | |
585 |
| - | |
586 |
| - | |
587 |
| - | |
588 |
| - | |
589 | 601 |
| |
590 | 602 |
| |
591 | 603 |
| |
|
Lines changed: 43 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
856 | 856 |
| |
857 | 857 |
| |
858 | 858 |
| |
| 859 | + | |
| 860 | + | |
| 861 | + | |
859 | 862 |
| |
860 | 863 |
| |
861 | 864 |
| |
| |||
2201 | 2204 |
| |
2202 | 2205 |
| |
2203 | 2206 |
| |
2204 |
| - | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
2205 | 2212 |
| |
2206 | 2213 |
| |
2207 | 2214 |
| |
| |||
2212 | 2219 |
| |
2213 | 2220 |
| |
2214 | 2221 |
| |
2215 |
| - | |
2216 |
| - | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
2217 | 2228 |
| |
2218 | 2229 |
| |
2219 | 2230 |
| |
2220 |
| - | |
2221 |
| - | |
2222 |
| - | |
2223 |
| - | |
2224 |
| - | |
2225 |
| - | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
2226 | 2251 |
| |
2227 | 2252 |
| |
2228 | 2253 |
| |
| |||
2250 | 2275 |
| |
2251 | 2276 |
| |
2252 | 2277 |
| |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
2253 | 2287 |
| |
2254 | 2288 |
| |
2255 | 2289 |
| |
|
Lines changed: 54 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 |
| |
89 | 92 |
| |
90 | 93 |
| |
| |||
1094 | 1097 |
| |
1095 | 1098 |
| |
1096 | 1099 |
| |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1097 | 1105 |
| |
1098 | 1106 |
| |
1099 | 1107 |
| |
| |||
1501 | 1509 |
| |
1502 | 1510 |
| |
1503 | 1511 |
| |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
146 | 146 |
| |
147 | 147 |
| |
148 | 148 |
| |
149 |
| - | |
| 149 | + | |
150 | 150 |
| |
151 | 151 |
| |
152 | 152 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
| 223 | + | |
| 224 | + | |
| 225 | + | |
223 | 226 |
| |
224 | 227 |
| |
225 | 228 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
| 65 | + | |
64 | 66 |
|
0 commit comments
Comments
(0)