Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-51072][CORE] CallerContext to set Hadoop cloud audit context
### What changes were proposed in this pull request? When enabled, cloud store client audit context is set to the same context string as the Hadoop IPC context. ### Why are the changes needed? CallerContext adds information about the spark task to hadoop IPC context and then to HDFS, YARN and HBase server logs. It is also possible to update the cloud storage "audit context". Storage clients can attach the audit information to requests to be stored in the service's own logs, where it can be retrieved, parsed and used for analysis. It is currently supported by the S3A connector, which adds the information to a synthetic referrer header, which is then stored in the S3 Server logs. (Not cloudtrail, sadly). See [S3A Auditing](https://hadoop.apache.org/docs/current/hadoop-aws/tools/hadoop-aws/auditing.html) ### Does this PR introduce _any_ user-facing change? If enabled, it adds extra entries in cloud storage server logs through cloud storage clients which support it. ### How was this patch tested? Expanded existing test `"Set Spark CallerContext"` to verify full setting of passed down parameters to caller and audit contexts. This required extracting the functional code of `CallerContext.setCurrentContext` into a `VisibleForTesting private[util]` method `setCurrentContext(Boolean)` Without this, the test suite only ran if the process had been launched with the configuration option `"hadoop.caller.context.enabled` being set to true -this is not the default, so the existing test suite code was probably never executed. ### Was this patch authored or co-authored using generative AI tooling? No Closes #49779 from steveloughran/SPARK-51072-caller-context-auditing. Authored-by: Steve Loughran <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information