Browse Source

HADOOP-2982. Fixes a problem in the way HOD looks for free nodes. Contributed by Hemanth Yamijala.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@641798 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 years ago
parent
commit
44b106a45b
2 changed files with 5 additions and 4 deletions
  1. 3 0
      CHANGES.txt
  2. 2 4
      src/contrib/hod/bin/checknodes

+ 3 - 0
CHANGES.txt

@@ -386,6 +386,9 @@ Trunk (unreleased changes)
     HADOOP-3087. Fixes a problem to do with refreshing of loadHistory.jsp.
     (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-2982. Fixes a problem in the way HOD looks for free nodes.
+    (Hemanth Yamijala via ddas)
+
 Release 0.16.2 - Unreleased
 
   BUG FIXES

+ 2 - 4
src/contrib/hod/bin/checknodes

@@ -27,7 +27,5 @@ then
   echo Usage: checknodes queue-name
   exit 2
 fi
-num=`$PBS_NODES_PATH :$1 2>&1 | grep "state = " | egrep -v "state = down" | grep -v "state = offline" | wc -l`
-totalused=`$PBS_NODES_PATH :$1  2>&1 | grep "jobs =" | wc -l`
-numleft=`expr $num - $totalused`
-echo $numleft
+# the number of nodes marked 'free', and which do not contain a jobs attribute from the server or from the moms.
+$PBS_NODES_PATH :$1 | awk 'BEGIN {c=0} /state = free/ {getline;getline;getline;getline; if ($0 !~ /jobs =/ && $0 !~ /jobs=[0-9].*/)  c++ ; } END {print c}'