@@ -89,7 +89,7 @@ function replicationFuzz (options) {
89
89
if ( state ) {
90
90
message = 'failed to start slave instance!' ;
91
91
}
92
-
92
+ slave [ 'isSlaveInstance' ] = true ;
93
93
return {
94
94
instanceInfo : slave ,
95
95
message : message ,
@@ -100,13 +100,22 @@ function replicationFuzz (options) {
100
100
} ;
101
101
} ,
102
102
103
+ healthCheck : function ( options ,
104
+ serverOptions ,
105
+ instanceInfo ,
106
+ customInstanceInfos ,
107
+ startStopHandlers ) {
108
+ return pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ;
109
+ } ,
110
+
103
111
preStop : function ( options ,
104
112
serverOptions ,
105
113
instanceInfo ,
106
114
customInstanceInfos ,
107
115
startStopHandlers ) {
108
- pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
109
-
116
+ if ( pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ) {
117
+ pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
118
+ }
110
119
return { } ;
111
120
} ,
112
121
@@ -150,6 +159,7 @@ function replicationRandom (options) {
150
159
message = 'failed to start slave instance!' ;
151
160
}
152
161
162
+ slave [ 'isSlaveInstance' ] = true ;
153
163
return {
154
164
instanceInfo : slave ,
155
165
message : message ,
@@ -160,13 +170,22 @@ function replicationRandom (options) {
160
170
} ;
161
171
} ,
162
172
173
+ healthCheck : function ( options ,
174
+ serverOptions ,
175
+ instanceInfo ,
176
+ customInstanceInfos ,
177
+ startStopHandlers ) {
178
+ return pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ;
179
+ } ,
180
+
163
181
preStop : function ( options ,
164
182
serverOptions ,
165
183
instanceInfo ,
166
184
customInstanceInfos ,
167
185
startStopHandlers ) {
168
- pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
169
-
186
+ if ( pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ) {
187
+ pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
188
+ }
170
189
return { } ;
171
190
} ,
172
191
@@ -210,6 +229,7 @@ function replicationAql (options) {
210
229
message = 'failed to start slave instance!' ;
211
230
}
212
231
232
+ slave [ 'isSlaveInstance' ] = true ;
213
233
return {
214
234
instanceInfo : slave ,
215
235
message : message ,
@@ -220,13 +240,22 @@ function replicationAql (options) {
220
240
} ;
221
241
} ,
222
242
243
+ healthCheck : function ( options ,
244
+ serverOptions ,
245
+ instanceInfo ,
246
+ customInstanceInfos ,
247
+ startStopHandlers ) {
248
+ return pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ;
249
+ } ,
250
+
223
251
preStop : function ( options ,
224
252
serverOptions ,
225
253
instanceInfo ,
226
254
customInstanceInfos ,
227
255
startStopHandlers ) {
228
- pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
229
-
256
+ if ( pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ) {
257
+ pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
258
+ }
230
259
return { } ;
231
260
} ,
232
261
@@ -273,6 +302,7 @@ function replicationOngoing (options) {
273
302
message = 'failed to start slave instance!' ;
274
303
}
275
304
305
+ slave [ 'isSlaveInstance' ] = true ;
276
306
return {
277
307
instanceInfo : slave ,
278
308
message : message ,
@@ -283,13 +313,22 @@ function replicationOngoing (options) {
283
313
} ;
284
314
} ,
285
315
316
+ healthCheck : function ( options ,
317
+ serverOptions ,
318
+ instanceInfo ,
319
+ customInstanceInfos ,
320
+ startStopHandlers ) {
321
+ return pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ;
322
+ } ,
323
+
286
324
preStop : function ( options ,
287
325
serverOptions ,
288
326
instanceInfo ,
289
327
customInstanceInfos ,
290
328
startStopHandlers ) {
291
- pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
292
-
329
+ if ( pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ) {
330
+ pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
331
+ }
293
332
return { } ;
294
333
} ,
295
334
@@ -350,10 +389,10 @@ function replicationStatic (options) {
350
389
message = 'failed to setup slave connection' + res . message ;
351
390
pu . shutdownInstance ( slave , options ) ;
352
391
}
392
+ slave [ 'isSlaveInstance' ] = true ;
353
393
} else {
354
394
message = 'failed to start slave instance!' ;
355
395
}
356
-
357
396
return {
358
397
instanceInfo : slave ,
359
398
message : message ,
@@ -364,12 +403,22 @@ function replicationStatic (options) {
364
403
} ;
365
404
} ,
366
405
406
+ healthCheck : function ( options ,
407
+ serverOptions ,
408
+ instanceInfo ,
409
+ customInstanceInfos ,
410
+ startStopHandlers ) {
411
+ return pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ;
412
+ } ,
413
+
367
414
preStop : function ( options ,
368
415
serverOptions ,
369
416
instanceInfo ,
370
417
customInstanceInfos ,
371
418
startStopHandlers ) {
372
- pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
419
+ if ( pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ) {
420
+ pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
421
+ }
373
422
return { } ;
374
423
} ,
375
424
@@ -435,6 +484,7 @@ function replicationSync (options) {
435
484
message = 'failed to setup slave connection' + res . message ;
436
485
pu . shutdownInstance ( slave , options ) ;
437
486
}
487
+ slave [ 'isSlaveInstance' ] = true ;
438
488
} else {
439
489
message = 'failed to start slave instance!' ;
440
490
}
@@ -449,13 +499,22 @@ function replicationSync (options) {
449
499
} ;
450
500
} ,
451
501
502
+ healthCheck : function ( options ,
503
+ serverOptions ,
504
+ instanceInfo ,
505
+ customInstanceInfos ,
506
+ startStopHandlers ) {
507
+ return pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ;
508
+ } ,
509
+
452
510
preStop : function ( options ,
453
511
serverOptions ,
454
512
instanceInfo ,
455
513
customInstanceInfos ,
456
514
startStopHandlers ) {
457
- pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
458
-
515
+ if ( pu . arangod . check . instanceAlive ( customInstanceInfos . postStart . instanceInfo , options ) ) {
516
+ pu . shutdownInstance ( customInstanceInfos . postStart . instanceInfo , options ) ;
517
+ }
459
518
return { } ;
460
519
} ,
461
520
0 commit comments