Browse Source

HADOOP-12239. StorageException complaining " no lease ID" when updating FolderLastModifiedTime in WASB. Contributed by Duo Xu.

cnauroth 10 years ago
parent
commit
efa97243ec

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -995,6 +995,9 @@ Release 2.8.0 - UNRELEASED
     HADOOP-12017. Hadoop archives command should use configurable replication
     HADOOP-12017. Hadoop archives command should use configurable replication
     factor when closing (Bibin A Chundatt via vinayakumarb)
     factor when closing (Bibin A Chundatt via vinayakumarb)
 
 
+    HADOOP-12239. StorageException complaining " no lease ID" when updating
+    FolderLastModifiedTime in WASB. (Duo Xu via cnauroth)
+
 Release 2.7.2 - UNRELEASED
 Release 2.7.2 - UNRELEASED
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 6 - 2
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java

@@ -1360,8 +1360,12 @@ public class NativeAzureFileSystem extends FileSystem {
       String parentKey = pathToKey(parentFolder);
       String parentKey = pathToKey(parentFolder);
       FileMetadata parentMetadata = store.retrieveMetadata(parentKey);
       FileMetadata parentMetadata = store.retrieveMetadata(parentKey);
       if (parentMetadata != null && parentMetadata.isDir() &&
       if (parentMetadata != null && parentMetadata.isDir() &&
-          parentMetadata.getBlobMaterialization() == BlobMaterialization.Explicit) {
-        store.updateFolderLastModifiedTime(parentKey, parentFolderLease);
+        parentMetadata.getBlobMaterialization() == BlobMaterialization.Explicit) {
+        if (parentFolderLease != null) {
+          store.updateFolderLastModifiedTime(parentKey, parentFolderLease);
+        } else {
+          updateParentFolderLastModifiedTime(key);
+        }
       } else {
       } else {
         // Make sure that the parent folder exists.
         // Make sure that the parent folder exists.
         // Create it using inherited permissions from the first existing directory going up the path
         // Create it using inherited permissions from the first existing directory going up the path