Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9771DE50 for ; Fri, 27 Jul 2012 21:01:40 +0000 (UTC) Received: (qmail 12399 invoked by uid 500); 27 Jul 2012 21:01:33 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 12338 invoked by uid 500); 27 Jul 2012 21:01:33 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 11722 invoked by uid 99); 27 Jul 2012 21:01:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2012 21:01:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AC687198DD; Fri, 27 Jul 2012 21:01:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alena1108@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [38/50] [abbrv] git commit: Bug: HA takes a lot of time to migrate VMs (trigger HA) to another KVM host if there are multiple storage pools in a cluster. Message-Id: <20120727210132.AC687198DD@tyr.zones.apache.org> Date: Fri, 27 Jul 2012 21:01:32 +0000 (UTC) Bug: HA takes a lot of time to migrate VMs (trigger HA) to another KVM host if there are multiple storage pools in a cluster. The issue is as follows: 1. When CloudStack detects that a host is not responding to ping requests it'll send a fence command for this host to another host in the cluster. 2. The agent takes a long time to respond to this check if the storage is fenced. This is because the agent checks if the first host is writing to its heartbeat file on all pools in the cluster. It is doing this in a sequential manner on all storage pool. Making a fix to get rid of sleep, wait during HA. The behavior is now similar to Xenserver. RB: https://reviews.apache.org/r/6133/ Send-by:devdeep.singh@citrix.com Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/f497c7c0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/f497c7c0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/f497c7c0 Branch: refs/heads/vpc Commit: f497c7c031b580919ada45209e690f3983f509b0 Parents: 3fedd56 Author: Edison Su Authored: Wed Jul 25 10:16:13 2012 -0700 Committer: Edison Su Committed: Wed Jul 25 10:17:09 2012 -0700 ---------------------------------------------------------------------- .../agent/resource/computing/KVMHAChecker.java | 2 +- scripts/vm/hypervisor/kvm/kvmheartbeat.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f497c7c0/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java ---------------------------------------------------------------------- diff --git a/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java b/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java index b2df8c1..f5b8a32 100644 --- a/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java +++ b/agent/src/com/cloud/agent/resource/computing/KVMHAChecker.java @@ -53,7 +53,7 @@ public class KVMHAChecker extends KVMHABase implements Callable { cmd.add("-h", _hostIP); cmd.add("-r"); cmd.add("-t", - String.valueOf((_heartBeatUpdateFreq + _heartBeatUpdateTimeout) / 1000 * 2)); + String.valueOf(_heartBeatUpdateFreq/1000)); OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); String result = cmd.execute(parser); s_logger.debug("pool: " + pool._poolIp); http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f497c7c0/scripts/vm/hypervisor/kvm/kvmheartbeat.sh ---------------------------------------------------------------------- diff --git a/scripts/vm/hypervisor/kvm/kvmheartbeat.sh b/scripts/vm/hypervisor/kvm/kvmheartbeat.sh index c634655..7293b14 100755 --- a/scripts/vm/hypervisor/kvm/kvmheartbeat.sh +++ b/scripts/vm/hypervisor/kvm/kvmheartbeat.sh @@ -133,14 +133,14 @@ write_hbLog() { } check_hbLog() { - oldTimeStamp=$(cat $hbFile) - sleep $interval &> /dev/null - newTimeStamp=$(cat $hbFile) - if [ $newTimeStamp -gt $oldTimeStamp ] + now=$(date +%s) + hb=$(cat $hbFile) + diff=`expr $now - $hb` + if [ $diff -gt $interval ] then - return 0 + return 1 fi - return 1 + return 0 } if [ "$rflag" == "1" ]