diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 3168a814bec..3f6adcedd61 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -172,6 +172,9 @@ Release 2.7.0 - UNRELEASED HADOOP-11544. Remove unused configuration keys for tracing. (Masatake Iwasaki via aajisaka) + HADOOP-11492. Bump up curator version to 2.7.1. (Arun Suresh and + Karthik Kambatla via kasha) + OPTIMIZATIONS HADOOP-11323. WritableComparator#compare keeps reference to byte array. diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java index d6bc99535a9..ec522dcff89 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java @@ -45,6 +45,7 @@ import org.apache.curator.framework.recipes.cache.PathChildrenCache.StartMode; import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent; import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener; import org.apache.curator.framework.recipes.shared.SharedCount; +import org.apache.curator.framework.recipes.shared.VersionedValue; import org.apache.curator.retry.RetryNTimes; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience.Private; @@ -58,7 +59,6 @@ import org.apache.zookeeper.ZooDefs.Perms; import org.apache.zookeeper.client.ZooKeeperSaslClient; import org.apache.zookeeper.data.ACL; import org.apache.zookeeper.data.Id; -import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -109,10 +109,10 @@ public abstract class ZKDelegationTokenSecretManager versionedValue = sharedCount.getVersionedValue(); + if (sharedCount.trySetCount(versionedValue, versionedValue.getValue() + 1)) { + break; + } + } + } + @Override protected int incrementDelegationTokenSeqNum() { try { - while (!delTokSeqCounter.trySetCount(delTokSeqCounter.getCount() + 1)) { - } + incrSharedCount(delTokSeqCounter); } catch (InterruptedException e) { // The ExpirationThread is just finishing.. so dont do anything.. LOG.debug("Thread interrupted while performing token counter increment", e); @@ -537,8 +546,7 @@ public abstract class ZKDelegationTokenSecretManager${env.HADOOP_PROTOC_PATH} 3.4.6 + 2.7.1 3.0.0 6.0.41 @@ -920,22 +921,22 @@ org.apache.curator curator-recipes - 2.6.0 + ${curator.version} org.apache.curator curator-client - 2.6.0 + ${curator.version} org.apache.curator curator-framework - 2.6.0 + ${curator.version} org.apache.curator curator-test - 2.6.0 + ${curator.version} org.bouncycastle