- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5aa2350
committed
Introduce replication progress tracking infrastructure.
When implementing a replication solution ontop of logical decoding, tworelated problems exist:* How to safely keep track of replication progress* How to change replication behavior, based on the origin of a row; e.g. to avoid loops in bi-directional replication setupsThe solution to these problems, as implemented here, consist out ofthree parts:1) 'replication origins', which identify nodes in a replication setup.2) 'replication progress tracking', which remembers, for each replication origin, how far replay has progressed in a efficient and crash safe manner.3) The ability to filter out changes performed on the behest of a replication origin during logical decoding; this allows complex replication topologies. E.g. by filtering all replayed changes out.Most of this could also be implemented in "userspace", e.g. by insertingadditional rows contain origin information, but that ends up being muchless efficient and more complicated. We don't want to require variousreplication solutions to reimplement logic for this independently. Theinfrastructure is intended to be generic enough to be reusable.This infrastructure also replaces the 'nodeid' infrastructure of committimestamps. It is intended to provide all the former capabilities,except that there's only 2^16 different origins; but now they integratewith logical decoding. Additionally more functionality is accessible viaSQL. Since the commit timestamp infrastructure has also been introducedin 9.5 (commit73c986a) changing the API is not a problem.For now the number of origins for which the replication progress can betracked simultaneously is determined by the max_replication_slotsGUC. That GUC is not a perfect match to configure this, but theredoesn't seem to be sufficient reason to introduce a separate new one.Bumps both catversion and wal page magic.Author: Andres Freund, with contributions from Petr Jelinek and Craig RingerReviewed-By: Heikki Linnakangas, Petr Jelinek, Robert Haas, Steve SingerDiscussion: 20150216002155.GI15326@awork2.anarazel.de, 20140923182422.GA15776@alap3.anarazel.de, 20131114172632.GE7522@alap2.anarazel.de1 parentc6e96a2 commit5aa2350
File tree
52 files changed
+2766
-89
lines changed- contrib/test_decoding
- expected
- sql
- doc/src/sgml
- src
- backend
- access
- heap
- rmgrdesc
- transam
- catalog
- replication/logical
- storage/ipc
- utils/cache
- bin/pg_resetxlog
- include
- access
- catalog
- replication
- storage
- utils
- test/regress/expected
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+2766
-89
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
|
Lines changed: 141 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 | + | |
| 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 | + |
Lines changed: 64 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 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + |
Lines changed: 28 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| |||
43 | 44 |
| |
44 | 45 |
| |
45 | 46 |
| |
| 47 | + | |
46 | 48 |
| |
47 | 49 |
| |
48 | 50 |
| |
| |||
59 | 61 |
| |
60 | 62 |
| |
61 | 63 |
| |
| 64 | + | |
| 65 | + | |
62 | 66 |
| |
63 | 67 |
| |
64 | 68 |
| |
| |||
76 | 80 |
| |
77 | 81 |
| |
78 | 82 |
| |
| 83 | + | |
79 | 84 |
| |
80 | 85 |
| |
81 | 86 |
| |
| |||
97 | 102 |
| |
98 | 103 |
| |
99 | 104 |
| |
| 105 | + | |
100 | 106 |
| |
101 | 107 |
| |
102 | 108 |
| |
| |||
155 | 161 |
| |
156 | 162 |
| |
157 | 163 |
| |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
158 | 175 |
| |
159 | 176 |
| |
160 | 177 |
| |
| |||
223 | 240 |
| |
224 | 241 |
| |
225 | 242 |
| |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
226 | 254 |
| |
227 | 255 |
| |
228 | 256 |
| |
|
0 commit comments
Comments
(0)