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

Avoid getting meta sync lock if no need #17172

Merged
merged 2 commits into from
Mar 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,12 @@ public InodeSyncStream(LockingScheme rootScheme, DefaultFileSystemMaster fsMaste
* @return SyncStatus object
*/
public SyncStatus sync() throws AccessControlException, InvalidPathException {
LOG.debug("Running InodeSyncStream on path {}, with status {}, and force sync {}",
mRootScheme.getPath(), mRootScheme.shouldSync(), mForceSync);
if (!mRootScheme.shouldSync().isShouldSync() && !mForceSync) {
DefaultFileSystemMaster.Metrics.INODE_SYNC_STREAM_SKIPPED.inc();
return SyncStatus.NOT_NEEDED;
}
if (!mDedupConcurrentSync) {
return syncInternal();
}
Expand All @@ -430,12 +436,6 @@ private SyncStatus syncInternal() throws
int failedSyncPathCount = 0;
int skippedSyncPathCount = 0;
int stopNum = -1; // stop syncing when we've processed this many paths. -1 for infinite
LOG.debug("Running InodeSyncStream on path {}, with status {}, and force sync {}",
mRootScheme.getPath(), mRootScheme.shouldSync(), mForceSync);
if (!mRootScheme.shouldSync().isShouldSync() && !mForceSync) {
DefaultFileSystemMaster.Metrics.INODE_SYNC_STREAM_SKIPPED.inc();
return SyncStatus.NOT_NEEDED;
}
if (mDedupConcurrentSync && mRootScheme.shouldSync() != SyncCheck.SHOULD_SYNC) {
/*
* If a concurrent sync on the same path is successful after this sync had already
Expand Down