HiveDR fails with permissions denied
Author: Sowmya Ramesh
Reviewers: Peeyush
Closes from sowmyaramesh/FALCON-2281
@@ -56,6 +56,7 @@ public class SharedLibraryHostingService implements ConfigurationChangeListener
private static class FalconLibPath implements FalconPathFilter {
private String[] shareLibs;
+
FalconLibPath(String[] libList) {
this.shareLibs = Arrays.copyOf(libList, libList.length);
}
@@ -79,7 +80,8 @@ public class SharedLibraryHostingService implements ConfigurationChangeListener
}
throw new IllegalArgumentException(path + " is not accepted!");
}
- };
+ }
+
private void pushExtensionArtifactsToCluster(final Cluster cluster,
final FileSystem clusterFs) throws FalconException {
@@ -95,6 +97,7 @@ public class SharedLibraryHostingService implements ConfigurationChangeListener
return;
}
+ final String filterPath = "/apps/falcon/extensions/mirroring/";
Path extensionStorePath = store.getExtensionStorePath();
LOG.info("extensionStorePath :{}", extensionStorePath);
FileSystem falconFileSystem =
@@ -119,6 +122,12 @@ public class SharedLibraryHostingService implements ConfigurationChangeListener
LocatedFileStatus srcfileStatus = fileStatusListIterator.next();
Path filePath = Path.getPathWithoutSchemeAndAuthority(srcfileStatus.getPath());
+ if (filePath != null && filePath.toString().startsWith(filterPath)) {
+ /* HiveDR uses filter path as store path in DRStatusStore, so skip it. Copy only the extension
+ artifacts */
+ continue;
+ }
+
if (srcfileStatus.isDirectory()) {
if (!clusterFs.exists(filePath)) {
HadoopClientFactory.mkdirs(clusterFs, filePath, srcfileStatus.getPermission());
