- Notifications
You must be signed in to change notification settings - Fork5
Commit3901fd7
committed
Support quorum-based synchronous replication.
This feature is also known as "quorum commit" especially in discussionon pgsql-hackers.This commit adds the following new syntaxes into synchronous_standby_namesGUC. By using FIRST and ANY keywords, users can specify the method tochoose synchronous standbys from the listed servers. FIRST num_sync (standby_name [, ...]) ANY num_sync (standby_name [, ...])The keyword FIRST specifies a priority-based synchronous replicationwhich was available also in 9.6 or before. This method makes transactioncommits wait until their WAL records are replicated to num_syncsynchronous standbys chosen based on their priorities.The keyword ANY specifies a quorum-based synchronous replicationand makes transaction commits wait until their WAL records arereplicated to *at least* num_sync listed standbys. In this method,the values of sync_state.pg_stat_replication for the listed standbysare reported as "quorum". The priority is still assigned to each standby,but not used in this method.The existing syntaxes having neither FIRST nor ANY keyword are stillsupported. They are the same as new syntax with FIRST keyword, i.e.,a priorirty-based synchronous replication.Author: Masahiko SawadaReviewed-By: Michael Paquier, Amit Kapila and meDiscussion: <CAD21AoAACi9NeC_ecm+Vahm+MMA6nYh=Kqs3KB3np+MBOS_gZg@mail.gmail.com>Many thanks to the various individuals who were involved indiscussing and developing this feature.1 parent10238fa commit3901fd7
File tree
11 files changed
+397
-87
lines changed- doc/src/sgml
- src
- backend
- replication
- utils/misc
- include/replication
- test/recovery/t
11 files changed
+397
-87
lines changedLines changed: 49 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3054 | 3054 |
| |
3055 | 3055 |
| |
3056 | 3056 |
| |
3057 |
| - | |
| 3057 | + | |
3058 | 3058 |
| |
3059 | 3059 |
| |
3060 | 3060 |
| |
3061 | 3061 |
| |
3062 |
| - | |
3063 |
| - | |
3064 |
| - | |
3065 |
| - | |
3066 |
| - | |
| 3062 | + | |
3067 | 3063 |
| |
3068 | 3064 |
| |
3069 | 3065 |
| |
3070 | 3066 |
| |
3071 | 3067 |
| |
3072 |
| - | |
| 3068 | + | |
| 3069 | + | |
3073 | 3070 |
| |
3074 | 3071 |
| |
3075 | 3072 |
| |
3076 | 3073 |
| |
3077 | 3074 |
| |
3078 | 3075 |
| |
3079 |
| - | |
3080 |
| - | |
3081 |
| - | |
3082 |
| - | |
3083 |
| - | |
3084 |
| - | |
3085 |
| - | |
3086 |
| - | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
3087 | 3116 |
| |
3088 |
| - | |
3089 |
| - | |
3090 |
| - | |
3091 |
| - | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
3092 | 3122 |
| |
3093 | 3123 |
| |
3094 | 3124 |
| |
|
Lines changed: 34 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1138 | 1138 |
| |
1139 | 1139 |
| |
1140 | 1140 |
| |
1141 |
| - | |
1142 |
| - | |
1143 |
| - | |
1144 |
| - | |
1145 |
| - | |
1146 |
| - | |
1147 |
| - | |
| 1141 | + | |
| 1142 | + | |
1148 | 1143 |
| |
1149 | 1144 |
| |
1150 |
| - | |
1151 |
| - | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1152 | 1158 |
| |
1153 |
| - | |
| 1159 | + | |
1154 | 1160 |
| |
1155 | 1161 |
| |
1156 | 1162 |
| |
| |||
1161 | 1167 |
| |
1162 | 1168 |
| |
1163 | 1169 |
| |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1164 | 1188 |
| |
1165 | 1189 |
| |
1166 | 1190 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1404 | 1404 |
| |
1405 | 1405 |
| |
1406 | 1406 |
| |
1407 |
| - | |
| 1407 | + | |
| 1408 | + | |
1408 | 1409 |
| |
1409 | 1410 |
| |
1410 | 1411 |
| |
| |||
1429 | 1430 |
| |
1430 | 1431 |
| |
1431 | 1432 |
| |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1432 | 1439 |
| |
1433 | 1440 |
| |
1434 | 1441 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
|
0 commit comments
Comments
(0)