37
37
#define START_DELAY_THRESHOLD 5 * 60 * 1000
38
38
#define MAX_LRM_REG_FAILS 30
39
39
40
+ #define s_if_plural (i ) (((i) == 1)? "" : "s")
41
+
40
42
struct delete_event_s {
41
43
int rc ;
42
44
const char * rsc ;
@@ -372,8 +374,10 @@ do_lrm_control(long long action,
372
374
373
375
if (ret != pcmk_ok ) {
374
376
if (lrm_state -> num_lrm_register_fails < MAX_LRM_REG_FAILS ) {
375
- crm_warn ("Failed to sign on to the LRM %d"
376
- " (%d max) times" , lrm_state -> num_lrm_register_fails , MAX_LRM_REG_FAILS );
377
+ crm_warn ("Failed to connect to the LRM %d time%s (%d max)" ,
378
+ lrm_state -> num_lrm_register_fails ,
379
+ s_if_plural (lrm_state -> num_lrm_register_fails ),
380
+ MAX_LRM_REG_FAILS );
377
381
378
382
crm_timer_start (wait_timer );
379
383
crmd_fsa_stall (FALSE);
@@ -382,8 +386,9 @@ do_lrm_control(long long action,
382
386
}
383
387
384
388
if (ret != pcmk_ok ) {
385
- crm_err ("Failed to sign on to the LRM %d" " (max) times" ,
386
- lrm_state -> num_lrm_register_fails );
389
+ crm_err ("Failed to connect to the LRM the max allowed %d time%s" ,
390
+ lrm_state -> num_lrm_register_fails ,
391
+ s_if_plural (lrm_state -> num_lrm_register_fails ));
387
392
register_fsa_error (C_FSA_INTERNAL , I_ERROR , NULL );
388
393
return ;
389
394
}
@@ -425,8 +430,8 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
425
430
guint nremaining = g_hash_table_size (lrm_state -> pending_ops );
426
431
427
432
if (removed || nremaining ) {
428
- crm_notice ("Stopped %u recurring operations at %s (%u operations remaining)" ,
429
- removed , when , nremaining );
433
+ crm_notice ("Stopped %u recurring operation%s at %s (%u remaining)" ,
434
+ removed , s_if_plural ( removed ), when , nremaining );
430
435
}
431
436
}
432
437
@@ -441,7 +446,8 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
441
446
}
442
447
443
448
if (counter > 0 ) {
444
- do_crm_log (log_level , "%d pending LRM operations at %s" , counter , when );
449
+ do_crm_log (log_level , "%d pending LRM operation%s at %s" ,
450
+ counter , s_if_plural (counter ), when );
445
451
446
452
if (cur_state == S_TERMINATE || !is_set (fsa_input_register , R_SENT_RSC_STOP )) {
447
453
g_hash_table_iter_init (& gIter , lrm_state -> pending_ops );
@@ -459,7 +465,7 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
459
465
return rc ;
460
466
}
461
467
462
- if (cur_state == S_TERMINATE || is_set (fsa_input_register , R_SHUTDOWN )) {
468
+ if (is_set (fsa_input_register , R_SHUTDOWN )) {
463
469
/* At this point we're not waiting, we're just shutting down */
464
470
when = "shutdown" ;
465
471
}
@@ -472,7 +478,11 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
472
478
}
473
479
474
480
counter ++ ;
475
- crm_trace ("Found %s active" , entry -> id );
481
+ if (log_level == LOG_ERR ) {
482
+ crm_info ("Found %s active at %s" , entry -> id , when );
483
+ } else {
484
+ crm_trace ("Found %s active at %s" , entry -> id , when );
485
+ }
476
486
if (lrm_state -> pending_ops ) {
477
487
GHashTableIter hIter ;
478
488
@@ -488,7 +498,8 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
488
498
}
489
499
490
500
if (counter ) {
491
- crm_err ("%d resources were active at %s." , counter , when );
501
+ crm_err ("%d resource%s active at %s" ,
502
+ counter , (counter == 1 )? " was" : "s were" , when );
492
503
}
493
504
494
505
return rc ;
@@ -1489,8 +1500,8 @@ do_lrm_invoke(long long action,
1489
1500
lrm_state = lrm_state_find (target_node );
1490
1501
1491
1502
if (lrm_state == NULL && is_remote_node ) {
1492
- crm_err ("no lrmd connection for remote node %s found on cluster node %s. Can not process request. " ,
1493
- target_node , fsa_our_uname );
1503
+ crm_err ("Failing action because remote node %s has no connection to cluster node %s" ,
1504
+ target_node , fsa_our_uname );
1494
1505
1495
1506
/* The action must be recorded here and in the CIB as failed */
1496
1507
synthesize_lrmd_failure (NULL , input -> xml , PCMK_OCF_CONNECTION_DIED );
@@ -1785,7 +1796,7 @@ do_lrm_invoke(long long action,
1785
1796
lrmd_free_rsc_info (rsc );
1786
1797
1787
1798
} else {
1788
- crm_err ("Operation was neither a lrm_query, nor a rsc op. %s " , crm_str (crm_op ));
1799
+ crm_err ("Cannot perform operation %s of unknown type " , crm_str (crm_op ));
1789
1800
register_fsa_error (C_FSA_INTERNAL , I_ERROR , NULL );
1790
1801
}
1791
1802
}
@@ -2108,8 +2119,8 @@ do_lrm_rsc_op(lrm_state_t * lrm_state, lrmd_rsc_info_t * rsc, const char *operat
2108
2119
lrm_state -> pending_ops , stop_recurring_action_by_rsc , & data );
2109
2120
2110
2121
if (removed ) {
2111
- crm_debug ("Stopped %u recurring operations in preparation for %s_%s_%d" ,
2112
- removed , rsc -> id , operation , op -> interval );
2122
+ crm_debug ("Stopped %u recurring operation%s in preparation for %s_%s_%d" ,
2123
+ removed , s_if_plural ( removed ), rsc -> id , operation , op -> interval );
2113
2124
}
2114
2125
}
2115
2126
0 commit comments