[Pacemaker] How to properly define DRBD resources

Nikita Staroverov nsforth at gmail.com
Tue Dec 17 08:57:24 EST 2013


17.12.2013 17:29, Michał Margula пишет:
> W dniu 17.12.2013 12:22, Nikita Staroverov pisze:
>> I forgot some important thing. You must use last version of drbd, due to
>> ocf agent bug that can lead to drbd promote fail with error code 17.
>> AFAIK, you nead drbd 8.4.4 at least.
>
> Not good, because I have 8.3.11, this is version which is in Debian 
> Wheezy. I would have to switch to Testing to have latest version.
>
> Where can I read about that bug to see what to expect?
>
> Currently I see no issues (altought it is running only with few 
> resources).
>
8.3.x has got fix for this bug. You need "# avoid too tight pacemaker 
driven "recovery" loop," patch.
You can check this by looking into ocf agent's promote function:
Good :) function looks like this:

drbd_promote() {
643 local rc
644 local status
645 local first_try=true
646
647 rc=$OCF_ERR_GENERIC
648
649 # Keep trying to promote the resource;
650 # wait for the CRM to time us out if this fails
651 while :; do
652 drbd_status
653 status=$?
654 case "$status" in
655 $OCF_SUCCESS)
656 do_drbdadm primary $DRBD_RESOURCE
657 if [[ $? = 17 ]]; then
658 # All available disks are inconsistent,
659 # or I am consistent, but failed to fence the peer.
660 # Cannot become primary.
661 # No need to retry indefinitely.
662 ocf_log crit "Refusing to be promoted to Primary without UpToDate data"
663 break
664 fi
665 ;;
666 $OCF_NOT_RUNNING)
667 ocf_log error "Trying to promote a resource that was not started"
668 break
669 ;;
670 $OCF_RUNNING_MASTER)
671 rc=$OCF_SUCCESS
672 break
673 esac
674 $first_try || sleep 1
675 first_try=false
676 done
677
678 # avoid too tight pacemaker driven "recovery" loop,
679 # if promotion keeps failing for some reason
680 if [[ $rc != 0 ]] && (( $SECONDS < 15 )) ; then
681 delay=$(( 15 - SECONDS ))
682 ocf_log warn "promotion failed; sleep $delay # to prevent tight 
recovery loop"
683 sleep $delay
684 fi
685 return $rc







More information about the Pacemaker mailing list