hudi icon indicating copy to clipboard operation
hudi copied to clipboard

[HUDI-8109] Fix the error related to locking during clustering/compaction when calling the file system which is not atomic.

Open majian1998 opened this issue 1 year ago • 1 comments
trafficstars

When a table is on OSS and MDT is enabled, the current code adds some lock parameters. It sets the FileSystemBasedLockProvider as the default lock. However, in its constructor, it checks if the current file system supports atomicity. If it does not, an error is thrown. Currently, it seems there is no configuration to bypass this error, which prevents tables on file system such as OSS from using capabilities like calling clustering procedures.

The fix is to skip adding this configuration when the file system does not support atomicity. This way, at least the basic functionality won't be blocked by this lock and can operate normally.

The error message is as follows:

Exception in thread "main" org.apache.hudi.exception.HoodieException: Unable to instantiate class org.apache.hudi.client.transaction.lock.FileSystemBasedLockProvider
    at org.apache.hudi.common.util.ReflectionUtils.loadClass(ReflectionUtils.java:75)
    at org.apache.hudi.client.transaction.lock.LockManager.getLockProvider(LockManager.java:125)
    at org.apache.hudi.client.transaction.lock.LockManager.unlock(LockManager.java:112)
    at org.apache.hudi.client.transaction.TransactionManager.endTransaction(TransactionManager.java:70)
    at org.apache.hudi.client.BaseHoodieTableServiceClient.scheduleTableService(BaseHoodieTableServiceClient.java:609)
    at org.apache.hudi.client.BaseHoodieWriteClient.scheduleTableService(BaseHoodieWriteClient.java:1216)
    at org.apache.hudi.client.BaseHoodieWriteClient.scheduleClusteringAtInstant(BaseHoodieWriteClient.java:1165)

Change Logs

None

Impact

None

Risk level (write none, low medium or high below)

low

Documentation Update

None

Contributor's checklist

  • [ ] Read through contributor's guide
  • [ ] Change Logs and Impact were stated clearly
  • [ ] Adequate tests were added if applicable
  • [ ] CI passed

majian1998 avatar Aug 21 '24 11:08 majian1998

CI report:

  • c8c3f69ef8acb0d7dfb5fecaec755a35ad938536 Azure: SUCCESS
Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

hudi-bot avatar Aug 22 '24 12:08 hudi-bot