-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Skip copy if needed #17804
Skip copy if needed #17804
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would like to send a skip status to master side so we can skip the counting in the job progress and handle it properly
I see. |
ec18e28
to
cefc19c
Compare
@jja725 Tests all completed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the updates, have a rough pass
@@ -545,14 +546,24 @@ public ListenableFuture<List<RouteFailure>> copy(List<Route> routes, UfsReadOpti | |||
AuthenticatedClientUser.set(readOptions.getUser()); | |||
} | |||
checkCopyPermission(route.getSrc(), route.getDst()); | |||
try { | |||
ValidateHandler.validate(route, writeOptions, srcFs, dstFs); | |||
} catch (Throwable t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I literally don't think any exception here would indicate a skip status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it to catch only the exception which indicates the skip status.
064ebc1
to
5d41eb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some high level comments after a quick pass @ssyssy
dora/core/server/worker/src/main/java/alluxio/worker/dora/PagedDoraWorker.java
Outdated
Show resolved
Hide resolved
* @param srcFs the source file system | ||
* @param dstFs the destination file system | ||
*/ | ||
public static void validate(Route route, WriteOptions writeOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using exception to indicate error, we should use return value to indicate failed validation. Exception handling has much more overhead than a simple return value and makes code hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ic
9b78288
to
2ed4307
Compare
dora/core/server/worker/src/main/java/alluxio/worker/task/ValidateHandler.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/main/java/alluxio/worker/task/ValidateHandler.java
Outdated
Show resolved
Hide resolved
2d4096b
to
1a97286
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are on the right path, leave some comments
dora/core/server/master/src/main/java/alluxio/master/job/AbstractJob.java
Show resolved
Hide resolved
dora/core/server/master/src/main/java/alluxio/master/job/CopyJob.java
Outdated
Show resolved
Hide resolved
dora/core/server/master/src/main/java/alluxio/master/job/CopyJob.java
Outdated
Show resolved
Hide resolved
dora/core/server/master/src/main/java/alluxio/master/job/CopyJob.java
Outdated
Show resolved
Hide resolved
@@ -289,6 +289,60 @@ public void testSingleFileMove() throws IOException, ExecutionException, Interru | |||
} | |||
} | |||
|
|||
@Test | |||
public void testSingleFileCopySkip() throws IOException, ExecutionException, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind adding some tests regarding copying a folder with different scenarios, thanks!
@@ -376,7 +429,6 @@ public void testFolderWithFileMove() | |||
Assert.assertTrue(b.isDirectory()); | |||
Assert.assertTrue(dstD.exists()); | |||
Assert.assertTrue(dstD.isDirectory()); | |||
assertFalse(a.exists()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused, if a still exists meaning we fail to delete a, then why we do not get any exceptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is a bug here. I don't know why there isn't any exceptions. It shows that it succeeds to delete, but the directory is still there.
1f12280
to
1d16d47
Compare
63dc5b0
to
3ab33ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there
dora/core/server/worker/src/test/java/alluxio/worker/dora/PagedDoraWorkerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/dora/PagedDoraWorkerTest.java
Outdated
Show resolved
Hide resolved
alluxio-bot, merge this please |
What changes are proposed in this pull request?
Skip copy process if validation fails.
Also adding more info to the progress report.
Why are the changes needed?
Feature request.
Does this PR introduce any user facing changes?
na