@@ -1149,7 +1149,7 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
1149
1149
})
1150
1150
1151
1151
When ("setting 2 logs per disk" , func () {
1152
- var initialLogServerPerPod , expectedPodCnt , expectedLogProcessesCnt int
1152
+ var initialLogServerPerPod , expectedPodCnt , expectedLogProcessesCnt , serverPerPod int
1153
1153
1154
1154
BeforeEach (func () {
1155
1155
initialLogServerPerPod = fdbCluster .GetLogServersPerPod ()
@@ -1164,67 +1164,12 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
1164
1164
Eventually (func () int {
1165
1165
return len (fdbCluster .GetLogPods ().Items )
1166
1166
}).Should (BeNumerically ("==" , expectedPodCnt ))
1167
- })
1168
-
1169
- AfterEach (func () {
1170
- log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1171
- Expect (
1172
- fdbCluster .SetLogServersPerPod (initialLogServerPerPod , true ),
1173
- ).ShouldNot (HaveOccurred ())
1174
- log .Printf (
1175
- "expectedPodCnt: %d, expectedProcessesCnt: %d" ,
1176
- expectedPodCnt ,
1177
- expectedPodCnt * initialLogServerPerPod ,
1178
- )
1179
- Eventually (func () int {
1180
- return len (fdbCluster .GetLogPods ().Items )
1181
- }).Should (BeNumerically ("==" , expectedPodCnt ))
1182
- })
1183
-
1184
- It ("should update the log servers to the expected amount" , func () {
1185
- serverPerPod := initialLogServerPerPod * 2
1186
- log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1187
- Expect (fdbCluster .SetLogServersPerPod (serverPerPod , true )).ShouldNot (HaveOccurred ())
1188
- log .Printf (
1189
- "expectedPodCnt: %d, expectedStorageProcessesCnt: %d" ,
1190
- expectedPodCnt ,
1191
- expectedPodCnt * serverPerPod ,
1192
- )
1193
- fdbCluster .ValidateProcessesCount (
1194
- fdbv1beta2 .ProcessClassLog ,
1195
- expectedPodCnt ,
1196
- expectedPodCnt * serverPerPod ,
1197
- )
1198
- })
1199
- })
1200
-
1201
- When ("setting 2 logs per disk to use transaction process" , func () {
1202
- var initialLogServerPerPod , expectedPodCnt , expectedLogProcessesCnt int
1203
1167
1204
- BeforeEach (func () {
1205
- initialLogServerPerPod = fdbCluster .GetLogServersPerPod ()
1206
- initialPods := fdbCluster .GetLogPods ()
1207
- expectedPodCnt = len (initialPods .Items )
1208
- expectedLogProcessesCnt = expectedPodCnt * initialLogServerPerPod
1209
- log .Printf (
1210
- "expectedPodCnt: %d, expectedProcessesCnt: %d" ,
1211
- expectedPodCnt ,
1212
- expectedLogProcessesCnt ,
1213
- )
1214
- Eventually (func () int {
1215
- return len (fdbCluster .GetLogPods ().Items )
1216
- }).Should (BeNumerically ("==" , expectedPodCnt ))
1168
+ serverPerPod = initialLogServerPerPod * 2
1169
+ log .Printf ("new log servers per Pod: %d" , initialLogServerPerPod )
1217
1170
})
1218
1171
1219
1172
AfterEach (func () {
1220
- log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1221
- Expect (
1222
- fdbCluster .SetTransactionServerPerPod (
1223
- initialLogServerPerPod ,
1224
- expectedLogProcessesCnt ,
1225
- true ,
1226
- ),
1227
- ).ShouldNot (HaveOccurred ())
1228
1173
log .Printf (
1229
1174
"expectedPodCnt: %d, expectedProcessesCnt: %d" ,
1230
1175
expectedPodCnt ,
@@ -1235,29 +1180,71 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
1235
1180
}).Should (BeNumerically ("==" , expectedPodCnt ))
1236
1181
})
1237
1182
1238
- It (
1239
- "should update the log servers to the expected amount and should create transaction Pods" ,
1240
- func () {
1241
- serverPerPod := initialLogServerPerPod * 2
1183
+ When ("when using log servers" , func () {
1184
+ AfterEach (func () {
1185
+ log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1242
1186
Expect (
1243
- fdbCluster .SetTransactionServerPerPod (
1244
- serverPerPod ,
1245
- expectedLogProcessesCnt ,
1246
- true ,
1247
- ),
1187
+ fdbCluster .SetLogServersPerPod (initialLogServerPerPod , true ),
1248
1188
).ShouldNot (HaveOccurred ())
1189
+ })
1190
+
1191
+ BeforeEach (func () {
1192
+ Expect (fdbCluster .SetLogServersPerPod (serverPerPod , true )).ShouldNot (HaveOccurred ())
1193
+ })
1194
+
1195
+ It ("should update the log servers to the expected amount" , func () {
1196
+ Expect (fdbCluster .SetLogServersPerPod (serverPerPod , true )).ShouldNot (HaveOccurred ())
1249
1197
log .Printf (
1250
1198
"expectedPodCnt: %d, expectedProcessesCnt: %d" ,
1251
1199
expectedPodCnt ,
1252
1200
expectedPodCnt * serverPerPod ,
1253
1201
)
1254
1202
fdbCluster .ValidateProcessesCount (
1255
- fdbv1beta2 .ProcessClassTransaction ,
1203
+ fdbv1beta2 .ProcessClassLog ,
1256
1204
expectedPodCnt ,
1257
1205
expectedPodCnt * serverPerPod ,
1258
1206
)
1259
- },
1260
- )
1207
+ })
1208
+ })
1209
+
1210
+ When ("migrating from log processes to transaction processes" , func () {
1211
+ AfterEach (func () {
1212
+ log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1213
+ Expect (
1214
+ fdbCluster .SetTransactionServerPerPod (
1215
+ initialLogServerPerPod ,
1216
+ expectedLogProcessesCnt ,
1217
+ true ,
1218
+ ),
1219
+ ).ShouldNot (HaveOccurred ())
1220
+ })
1221
+
1222
+ BeforeEach (func () {
1223
+ Expect (
1224
+ fdbCluster .SetTransactionServerPerPod (
1225
+ serverPerPod ,
1226
+ expectedLogProcessesCnt ,
1227
+ true ,
1228
+ ),
1229
+ ).ShouldNot (HaveOccurred ())
1230
+ })
1231
+
1232
+ It (
1233
+ "should update the log servers to the expected amount and should create transaction Pods" ,
1234
+ func () {
1235
+ log .Printf (
1236
+ "expectedPodCnt: %d, expectedProcessesCnt: %d" ,
1237
+ expectedPodCnt ,
1238
+ expectedPodCnt * serverPerPod ,
1239
+ )
1240
+ fdbCluster .ValidateProcessesCount (
1241
+ fdbv1beta2 .ProcessClassTransaction ,
1242
+ expectedPodCnt ,
1243
+ expectedPodCnt * serverPerPod ,
1244
+ )
1245
+ },
1246
+ )
1247
+ })
1261
1248
})
1262
1249
1263
1250
When ("Replacing a Pod with PVC stuck in Terminating state" , func () {
0 commit comments