[#10741] fix(hive): Fix keytab symlink TOCTOU race in FetchFileUtils (#10742)
What changes were proposed in this pull request?
Fix the
file:scheme handler inFetchFileUtilsto synchronize symlink creation and avoid concurrent races. Replace the non-atomicexists() + delete()inKerberosClientwithFiles.deleteIfExists(). Remove the unused duplicateFetchFileUtilsincatalog-hiveand add comprehensive tests inhive-metastore-common.Why are the changes needed?
Files.createSymbolicLink()throwsFileAlreadyExistsExceptionwhen multiple threads concurrently fetch the same keytab path, such as when the search event listener triggers cascade sync after catalog creation.Fix: #10741
Does this PR introduce any user-facing change?
No.
How was this patch tested?
- added unit coverage in
TestFetchFileUtilsincluding concurrent, idempotent, and target-replacement scenarios
Apache Gravitino™
Introduction
Apache Gravitino is a high-performance, geo-distributed, and federated metadata lake. It manages metadata directly in different sources, types, and regions, providing users with unified metadata access for data and AI assets.
🚀 Key Features
🌐 Common Use Cases
📚 Documentation
The latest Gravitino documentation is available at gravitino.apache.org/docs/latest.
This README provides a basic overview; visit the site for full installation, configuration, and development documentation.
🧪 Quick Start
Use Gravitino Playground (Recommended)
Gravitino provides a Docker Compose–based playground for a full-stack experience.
Clone or download the Gravitino Playground repository and follow its README.
Run Gravitino Locally
conf/gravitino.confto configure settings.Press
CTRL+Cto stop.conf/gravitino-env.sh(or set the environment variable before starting) and setGRAVITINO_USE_WEB_V2totrue:GRAVITINO_USE_WEB_V2=...line fromconf/gravitino-env.sh(the template defaults tofalse); removing that line will revert the service to the legacy UI behavior.🧊 Iceberg REST Catalog
Gravitino provides a native Iceberg REST catalog service.
See: Iceberg REST catalog service
🗄️ Lance REST Catalog
Gravitino provides a native Lance REST catalog service.
See: Lance REST catalog service
🔌 Trino Integration
Gravitino includes a Trino connector for federated metadata access.
See: Using Trino with Gravitino
🛠️ Building from Source
Gravitino uses Gradle. Windows is not currently supported.
Clean build without tests:
Build a distribution:
Or compressed package:
Artifacts are output to the
distribution/directory.More build options: How to build Gravitino
👨💻 Developer Resources
🤝 Contributing
We welcome all kinds of contributions—code, documentation, testing, connectors, and more!
To get started, please read our CONTRIBUTING.md guide.
🔗 ASF Resources
🪪 License
Apache Gravitino is licensed under the Apache License, Version 2.0.
See the LICENSE file for details.
Apache®, Apache Gravitino™, Apache Hadoop®, Apache Hive™, Apache Iceberg™, Apache Kafka®, Apache Spark™, Apache Submarine™, Apache Thrift™, and Apache Zeppelin™ are trademarks of the Apache Software Foundation in the United States and/or other countries.