Commit 05b71b0
committed
storage: refactoring of wait_lsn logic
Before this patch we compared vclocks only in `wait_lsn` function in
storage module. However in future patches (e.g. gh-214) we will need to
do this even in tests. Also in gh-214 we will use very similar logic of
waiting vclocks but with different sign (all vclock components of
current storage should be "greater or equal" than components of replicas'
vclocks instead of "less or equal")
To avoid duplication of code we unify the process of vclocks' comparison
and transform `vclock_lesseq` into more general `vclock_compare` function
which can allow us to make different comparisons of vclocks by
comparator. We move this function in `util` vshard module.
Also we transform `wait_lsn` into `storage_wait_vclock_replicated`. This
function does the similar thing like `wait_lsn`, but the main logic has
migrated into `storage_wait_vclock_template` which is responsible for
waiting for current vclock will satisfy the comparator condition.
Needed for #214
NO_TEST=refactoring
NO_DOC=refactoring1 parent 39aada8 commit 05b71b0
1 file changed
+21
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | 1145 | | |
1163 | 1146 | | |
1164 | 1147 | | |
| |||
1177 | 1160 | | |
1178 | 1161 | | |
1179 | 1162 | | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
| 1163 | + | |
| 1164 | + | |
1184 | 1165 | | |
1185 | 1166 | | |
1186 | 1167 | | |
1187 | 1168 | | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1188 | 1172 | | |
1189 | 1173 | | |
1190 | 1174 | | |
| |||
1201 | 1185 | | |
1202 | 1186 | | |
1203 | 1187 | | |
1204 | | - | |
1205 | | - | |
| 1188 | + | |
| 1189 | + | |
1206 | 1190 | | |
1207 | 1191 | | |
1208 | 1192 | | |
| |||
1216 | 1200 | | |
1217 | 1201 | | |
1218 | 1202 | | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1219 | 1214 | | |
1220 | 1215 | | |
1221 | 1216 | | |
1222 | 1217 | | |
1223 | | - | |
| 1218 | + | |
1224 | 1219 | | |
1225 | 1220 | | |
1226 | 1221 | | |
| |||
2099 | 2094 | | |
2100 | 2095 | | |
2101 | 2096 | | |
2102 | | - | |
2103 | | - | |
| 2097 | + | |
| 2098 | + | |
2104 | 2099 | | |
2105 | 2100 | | |
2106 | 2101 | | |
| |||
0 commit comments