- Notifications
You must be signed in to change notification settings - Fork5
Commit989be08
committed
Support multiple synchronous standby servers.
Previously synchronous replication offered only the ability to confirmthat all changes made by a transaction had been transferred to at mostone synchronous standby server.This commit extends synchronous replication so that it supports multiplesynchronous standby servers. It enables users to consider one or morestandby servers as synchronous, and increase the level of transactiondurability by ensuring that transaction commits wait for replies fromall of those synchronous standbys.Multiple synchronous standby servers are configured insynchronous_standby_names which is extended to support new syntax of'num_sync ( standby_name [ , ... ] )', where num_sync specifiesthe number of synchronous standbys that transaction commits need towait for replies from and standby_name is the name of a standbyserver.The syntax of 'standby_name [ , ... ]' which was used in 9.5 or beforeis also still supported. It's the same as new syntax with num_sync=1.This commit doesn't include "quorum commit" feature which was discussedin pgsql-hackers. Synchronous standbys are chosen based on their priorities.synchronous_standby_names determines the priority of each standby forbeing chosen as a synchronous standby. The standbys whose names appearearlier in the list are given higher priority and will be considered assynchronous. Other standby servers appearing later in this listrepresent potential synchronous standbys.The regression test for multiple synchronous standbys is not includedin this commit. It should come later.Authors: Sawada Masahiko, Beena Emerson, Michael Paquier, Fujii MasaoReviewed-By: Kyotaro Horiguchi, Amit Kapila, Robert Haas, Simon Riggs,Amit Langote, Thomas Munro, Sameer Thakur, Suraj Kharage, Abhijit Menon-Sen,Rajeev RastogiMany thanks to the various individuals who were involved indiscussing and developing this feature.1 parent2143f5e commit989be08
File tree
13 files changed
+806
-171
lines changed- doc/src/sgml
- src
- backend
- replication
- utils/misc
- include/replication
- tools/msvc
13 files changed
+806
-171
lines changedLines changed: 42 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2906 | 2906 |
| |
2907 | 2907 |
| |
2908 | 2908 |
| |
2909 |
| - | |
| 2909 | + | |
2910 | 2910 |
| |
2911 | 2911 |
| |
2912 |
| - | |
| 2912 | + | |
2913 | 2913 |
| |
2914 |
| - | |
2915 |
| - | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
2916 | 2917 |
| |
2917 | 2918 |
| |
2918 | 2919 |
| |
2919 | 2920 |
| |
2920 | 2921 |
| |
2921 |
| - | |
2922 |
| - | |
| 2922 | + | |
| 2923 | + | |
2923 | 2924 |
| |
2924 | 2925 |
| |
2925 | 2926 |
| |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
2926 | 2952 |
| |
2927 | 2953 |
| |
2928 | 2954 |
| |
2929 | 2955 |
| |
2930 | 2956 |
| |
2931 |
| - | |
| 2957 | + | |
2932 | 2958 |
| |
2933 | 2959 |
| |
2934 | 2960 |
| |
2935 | 2961 |
| |
2936 | 2962 |
| |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
2937 | 2972 |
| |
2938 | 2973 |
| |
2939 | 2974 |
| |
|
Lines changed: 58 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1027 | 1027 |
| |
1028 | 1028 |
| |
1029 | 1029 |
| |
1030 |
| - | |
1031 |
| - | |
| 1030 | + | |
| 1031 | + | |
1032 | 1032 |
| |
1033 |
| - | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
1034 | 1036 |
| |
1035 | 1037 |
| |
1036 | 1038 |
| |
| |||
1084 | 1086 |
| |
1085 | 1087 |
| |
1086 | 1088 |
| |
1087 |
| - | |
1088 |
| - | |
| 1089 | + | |
| 1090 | + | |
1089 | 1091 |
| |
1090 | 1092 |
| |
1091 | 1093 |
| |
| |||
1126 | 1128 |
| |
1127 | 1129 |
| |
1128 | 1130 |
| |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1129 | 1165 |
| |
1130 | 1166 |
| |
1131 | 1167 |
| |
| |||
1171 | 1207 |
| |
1172 | 1208 |
| |
1173 | 1209 |
| |
1174 |
| - | |
1175 |
| - | |
1176 |
| - | |
1177 |
| - | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
1178 | 1216 |
| |
1179 | 1217 |
| |
1180 | 1218 |
| |
1181 |
| - | |
1182 |
| - | |
| 1219 | + | |
| 1220 | + | |
1183 | 1221 |
| |
1184 |
| - | |
1185 |
| - | |
1186 |
| - | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1187 | 1225 |
| |
1188 | 1226 |
| |
1189 | 1227 |
| |
| |||
1208 | 1246 |
| |
1209 | 1247 |
| |
1210 | 1248 |
| |
1211 |
| - | |
| 1249 | + | |
1212 | 1250 |
| |
1213 | 1251 |
| |
1214 | 1252 |
| |
1215 |
| - | |
1216 |
| - | |
1217 |
| - | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1218 | 1258 |
| |
1219 | 1259 |
| |
1220 | 1260 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
203 | 203 |
| |
204 | 204 |
| |
205 | 205 |
| |
206 |
| - | |
| 206 | + | |
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
| |||
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
| 323 | + | |
| 324 | + | |
323 | 325 |
| |
324 | 326 |
| |
325 | 327 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
| 3 | + | |
| 4 | + |
Lines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
28 |
| - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + |
0 commit comments
Comments
(0)