YARN-6420. RM startup failure due to wrong order in nodelabel editlog (Bibin A Chundatt via Varun Saxena)

(cherry picked from commit 19b89c4c7b)
This commit is contained in:
Varun Saxena 2017-04-05 09:16:35 +05:30
parent 88e1799034
commit 05c008256a
1 changed files with 12 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import java.util.concurrent.ConcurrentMap;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.yarn.api.records.NodeId; import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.NodeLabel;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.nodelabels.CommonNodeLabelsManager; import org.apache.hadoop.yarn.nodelabels.CommonNodeLabelsManager;
import org.apache.hadoop.yarn.nodelabels.RMNodeLabel; import org.apache.hadoop.yarn.nodelabels.RMNodeLabel;
@ -133,6 +134,17 @@ public class RMNodeLabelsManager extends CommonNodeLabelsManager {
} }
} }
@Override
public void addToCluserNodeLabels(Collection<NodeLabel> labels)
throws IOException {
try {
writeLock.lock();
super.addToCluserNodeLabels(labels);
} finally {
writeLock.unlock();
}
}
@Override @Override
public void public void
removeLabelsFromNode(Map<NodeId, Set<String>> removeLabelsFromNode) removeLabelsFromNode(Map<NodeId, Set<String>> removeLabelsFromNode)