Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only check for delegation token from NN when it is non S3 filesystem #50

Draft
wants to merge 1 commit into
base: hubspot-3.3.6
Choose a base branch
from

Conversation

johnnysohn
Copy link

@johnnysohn johnnysohn commented Apr 18, 2024

Description of PR

We have an issue where writing to S3 fails because we're checking delegation token before writing in FileOutputFormat. Normally call to TokenCache.obtainTokensForNamenodes shouldn't fail in this case of writing to S3 because it returns if security isn't enabled, but we have jobs that can do lots of things and within it also makes calls to HBase to authenticate and thus creates problem for FileOutputFormat writing to S3.

java.lang.RuntimeException: Failed to write HFiles
	at com.hubspot.spark.utils.bulk.loading.SparkBulkLoadRunner.writeBulkLoadHFilesInternal(SparkBulkLoadRunner.java:394)
	at com.hubspot.spark.utils.bulk.loading.SparkBulkLoadRunner.writeBulkLoadHFiles(SparkBulkLoadRunner.java:353)
	at com.hubspot.spark.utils.bulk.loading.SparkBulkLoadRunner.writeBulkLoadHFiles(SparkBulkLoadRunner.java:308)
	at com.hubspot.spark.utils.bulk.loading.SparkBulkLoadRunner.runBulkLoadAsync(SparkBulkLoadRunner.java:242)
	at com.hubspot.unified.events.spark.client.harddelete.HBaseAsyncBulkLoadHardDeleteManager.lambda$getRetryableBulkLoadFuture$8(HBaseAsyncBulkLoadHardDeleteManager.java:306)
	at com.hubspot.futures.retryer.AsyncRetryer$AsyncTask.callOnce(AsyncRetryer.java:191)
	at com.hubspot.futures.retryer.AsyncRetryer$AsyncTask.initiateSingleRun(AsyncRetryer.java:110)
	at com.hubspot.futures.retryer.AsyncRetryer$AsyncTask.lambda$scheduleAnotherRun$1(AsyncRetryer.java:159)
	at com.hubspot.hwt.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:686)
	at com.hubspot.hwt.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:755)
	at com.hubspot.hwt.HashedWheelTimer$Worker.run(HashedWheelTimer.java:498)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Can't get Master Kerberos principal for use as renewer
	at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:134)
	at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesInternal(TokenCache.java:102)
	at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodes(TokenCache.java:81)
	at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:160)
	at org.apache.spark.internal.io.HadoopMapReduceWriteConfigUtil.assertConf(SparkHadoopWriter.scala:403)
	at org.apache.spark.internal.io.SparkHadoopWriter$.write(SparkHadoopWriter.scala:71)
	at org.apache.spark.rdd.PairRDDFunctions.$anonfun$saveAsNewAPIHadoopDataset$1(PairRDDFunctions.scala:1078)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
	at org.apache.spark.rdd.RDD.withScope(RDD.scala:406)
	at org.apache.spark.rdd.PairRDDFunctions.saveAsNewAPIHadoopDataset(PairRDDFunctions.scala:1076)
	at org.apache.spark.rdd.PairRDDFunctions.$anonfun$saveAsNewAPIHadoopFile$2(PairRDDFunctions.scala:995)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
	at org.apache.spark.rdd.RDD.withScope(RDD.scala:406)
	at org.apache.spark.rdd.PairRDDFunctions.saveAsNewAPIHadoopFile(PairRDDFunctions.scala:986)
	at org.apache.spark.api.java.JavaPairRDD.saveAsNewAPIHadoopFile(JavaPairRDD.scala:825)
	at com.hubspot.spark.utils.bulk.loading.SparkBulkLoadRunner.writeBulkLoadHFilesInternal(SparkBulkLoadRunner.java:386)

How was this patch tested?

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant