@@ -1166,10 +1166,15 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
1166
1166
}).Should (BeNumerically ("==" , expectedPodCnt ))
1167
1167
1168
1168
serverPerPod = initialLogServerPerPod * 2
1169
- log .Printf ("new log servers per Pod: %d" , initialLogServerPerPod )
1169
+ log .Printf ("new log servers per Pod: %d" , serverPerPod )
1170
1170
})
1171
1171
1172
1172
AfterEach (func () {
1173
+ log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1174
+ Expect (
1175
+ fdbCluster .SetLogServersPerPod (initialLogServerPerPod , true ),
1176
+ ).ShouldNot (HaveOccurred ())
1177
+
1173
1178
log .Printf (
1174
1179
"expectedPodCnt: %d, expectedProcessesCnt: %d" ,
1175
1180
expectedPodCnt ,
@@ -1181,13 +1186,6 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
1181
1186
})
1182
1187
1183
1188
When ("when using log servers" , func () {
1184
- AfterEach (func () {
1185
- log .Printf ("set log servers per Pod to %d" , initialLogServerPerPod )
1186
- Expect (
1187
- fdbCluster .SetLogServersPerPod (initialLogServerPerPod , true ),
1188
- ).ShouldNot (HaveOccurred ())
1189
- })
1190
-
1191
1189
BeforeEach (func () {
1192
1190
Expect (fdbCluster .SetLogServersPerPod (serverPerPod , true )).ShouldNot (HaveOccurred ())
1193
1191
})
@@ -1208,25 +1206,37 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() {
1208
1206
})
1209
1207
1210
1208
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 ())
1209
+ BeforeEach (func () {
1210
+ // Change the servers per pod and change the transaction process counts and set the log process counts
1211
+ // to -1.
1212
+ cluster := fdbCluster .GetCluster ()
1213
+ spec := cluster .Spec .DeepCopy ()
1214
+ spec .LogServersPerPod = serverPerPod
1215
+
1216
+ processCounts , err := cluster .GetProcessCountsWithDefaults ()
1217
+ Expect (err ).NotTo (HaveOccurred ())
1218
+ spec .ProcessCounts .Transaction = processCounts .Log
1219
+ spec .ProcessCounts .Log = - 1
1220
+
1221
+ // process counts with default?
1222
+ log .Println (spec .ProcessCounts )
1223
+ fdbCluster .UpdateClusterSpecWithSpec (spec )
1224
+ Expect (fdbCluster .WaitForReconciliation ()).NotTo (HaveOccurred ())
1220
1225
})
1221
1226
1222
- BeforeEach (func () {
1223
- Expect (
1224
- fdbCluster .SetTransactionServerPerPod (
1225
- serverPerPod ,
1226
- expectedLogProcessesCnt ,
1227
- true ,
1228
- ),
1229
- ).ShouldNot (HaveOccurred ())
1227
+ AfterEach (func () {
1228
+ // Reset the transaction process class changes and make sure we create log pods again.
1229
+ cluster := fdbCluster .GetCluster ()
1230
+ spec := cluster .Spec .DeepCopy ()
1231
+ spec .LogServersPerPod = initialLogServerPerPod
1232
+
1233
+ processCounts , err := cluster .GetProcessCountsWithDefaults ()
1234
+ Expect (err ).NotTo (HaveOccurred ())
1235
+ spec .ProcessCounts .Log = processCounts .Transaction
1236
+ spec .ProcessCounts .Transaction = - 1
1237
+ log .Println (spec .ProcessCounts )
1238
+ fdbCluster .UpdateClusterSpecWithSpec (spec )
1239
+ Expect (fdbCluster .WaitForReconciliation ()).NotTo (HaveOccurred ())
1230
1240
})
1231
1241
1232
1242
It (
0 commit comments