Skip to content

Fix to remove mkdir opration to ufs when load metadata and mount table#17572

Open
codings-dan wants to merge 1 commit intoAlluxio:master-2.xfrom
codings-dan:alluxio-community-fix-mkdir-to-ufs
Open

Fix to remove mkdir opration to ufs when load metadata and mount table#17572
codings-dan wants to merge 1 commit intoAlluxio:master-2.xfrom
codings-dan:alluxio-community-fix-mkdir-to-ufs

Conversation

@codings-dan
Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Remove mkdir opration to ufs when load metadata

Why are the changes needed?

When loadMetadata or create a mount point to alluxio master, if the dir don't exist in the ufs, it will create one dir to ufs, which I think is un-necessary.

Does this PR introduce any user facing changes?

No

@codings-dan
Copy link
Copy Markdown
Contributor Author

@maobaolong @jiacheliu3 Could you help take a look at the pull request? Thanks in advance!

@dbw9580 dbw9580 requested a review from jiacheliu3 June 9, 2023 04:06
Copy link
Copy Markdown
Contributor

@maobaolong maobaolong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this offline. LGTM

MkdirsOptions.defaults(Configuration.global()).setCreateParent(false)
.setOwner(dir.getOwner()).setGroup(dir.getGroup()).setMode(new Mode(dir.getMode()));
if (!ufs.mkdirs(ufsUri, mkdirsOptions)) {
if (isMetadataLoad || !ufs.mkdirs(ufsUri, mkdirsOptions)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's quite weird why a mount or loadMetadata will call syncPersistDirectory(). I'm not sure how that happened. What is the call stack when this happens?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping review the pull request! The stack trace shows below.

java.lang.Throwable	at alluxio.master.file.meta.InodeTree.syncPersistDirectory(InodeTree.java:1423)	at alluxio.master.file.meta.InodeTree.syncPersistExistingDirectory(InodeTree.java:1343)	at alluxio.master.file.meta.InodeTree.createPath(InodeTree.java:966)	at alluxio.master.file.DefaultFileSystemMaster.createDirectoryInternal(DefaultFileSystemMaster.java:2762)	at alluxio.master.file.InodeSyncStream.loadDirectoryMetadataInternal(InodeSyncStream.java:1384)	at alluxio.master.file.InodeSyncStream.loadDirectoryMetadata(InodeSyncStream.java:1304)	at alluxio.master.file.InodeSyncStream.loadMetadata(InodeSyncStream.java:1051)	at alluxio.master.file.InodeSyncStream.loadMetadataForPath(InodeSyncStream.java:1019)	at alluxio.master.file.InodeSyncStream.syncInodeMetadata(InodeSyncStream.java:751)	at alluxio.master.file.InodeSyncStream.syncInternal(InodeSyncStream.java:495)	at alluxio.master.file.InodeSyncStream.sync(InodeSyncStream.java:413)	at alluxio.master.file.DefaultFileSystemMaster.syncMetadata(DefaultFileSystemMaster.java:4100)	at alluxio.master.file.TxFileSystemMaster.syncMetadata(TxFileSystemMaster.java:347)	at alluxio.master.file.DefaultFileSystemMaster.listStatus(DefaultFileSystemMaster.java:1114)	at alluxio.master.file.TxFileSystemMaster.listStatus(TxFileSystemMaster.java:915)	at alluxio.master.file.FileSystemMasterClientServiceHandler.lambda$listStatus$10(FileSystemMasterClientServiceHandler.java:311)	at alluxio.RpcUtils.callAndReturn(RpcUtils.java:129)	at alluxio.master.file.FileSystemMasterClientServiceHandler.listStatus(FileSystemMasterClientServiceHandler.java:309)	at alluxio.grpc.FileSystemMasterClientServiceGrpc$MethodHandlers.invoke(FileSystemMasterClientServiceGrpc.java:3867) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants