forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit516814f
Add flush option to pg_logical_emit_message()
Since its introduction, LogLogicalMessage() (via the SQL interfacepg_logical_emit_message()) has never included a call to XLogFlush(),causing it to potentially lose messages on a crash when used innon-transactional mode. This has come up to me as a problem whileplaying with ideas to design a test suite for what has become039_end_of_wal.pl introduced inbae868c by Thomas Munro, becausethere are no direct ways to force a WAL flush via SQL.The default is false, to not flush messages and influence existinguse-cases where this function could be used. If set to true, themessage emitted is flushed before returning back to the caller, makingthe message durable on crash. This new option has no effect when usingpg_logical_emit_message() in transactional mode, as the record's flushis guaranteed by the WAL record generated by the transaction committed.Two queries of test_decoding are tweaked to cover the new code path forthe flush.Bump catalog version.Author: Michael PaquierReviewed-by: Andres Freund, Amit Kapila, Fujii Masao, Tung Nguyen, TomasVondraDiscussion:https://postgr.es/m/ZNsdThSe2qgsfs7R@paquier.xyz1 parentb77a9aa commit516814f
File tree
9 files changed
+51
-13
lines changed- contrib/test_decoding
- expected
- sql
- doc/src/sgml
- src
- backend
- catalog
- replication/logical
- include
- catalog
- replication
9 files changed
+51
-13
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
15 |
| - | |
| 16 | + | |
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 |
| - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27740 | 27740 |
| |
27741 | 27741 |
| |
27742 | 27742 |
| |
27743 |
| - | |
| 27743 | + | |
27744 | 27744 |
| |
27745 | 27745 |
| |
27746 | 27746 |
| |
27747 |
| - | |
| 27747 | + | |
27748 | 27748 |
| |
27749 | 27749 |
| |
27750 | 27750 |
| |
| |||
27758 | 27758 |
| |
27759 | 27759 |
| |
27760 | 27760 |
| |
| 27761 | + | |
| 27762 | + | |
| 27763 | + | |
| 27764 | + | |
| 27765 | + | |
27761 | 27766 |
| |
27762 | 27767 |
| |
27763 | 27768 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
446 | 446 |
| |
447 | 447 |
| |
448 | 448 |
| |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
449 | 469 |
| |
450 | 470 |
| |
451 | 471 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
362 | 362 |
| |
363 | 363 |
| |
364 | 364 |
| |
| 365 | + | |
365 | 366 |
| |
366 | 367 |
| |
367 | 368 |
| |
368 |
| - | |
| 369 | + | |
369 | 370 |
| |
370 | 371 |
| |
371 | 372 |
| |
|
Lines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 |
| - | |
| 47 | + | |
48 | 48 |
| |
49 | 49 |
| |
| 50 | + | |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
| |||
71 | 72 |
| |
72 | 73 |
| |
73 | 74 |
| |
74 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
75 | 84 |
| |
76 | 85 |
| |
77 | 86 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11167 | 11167 |
| |
11168 | 11168 |
| |
11169 | 11169 |
| |
11170 |
| - | |
| 11170 | + | |
11171 | 11171 |
| |
11172 | 11172 |
| |
11173 | 11173 |
| |
11174 |
| - | |
| 11174 | + | |
11175 | 11175 |
| |
11176 | 11176 |
| |
11177 | 11177 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
| 33 | + | |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
|
0 commit comments
Comments
(0)