-
Notifications
You must be signed in to change notification settings - Fork 773
feature: handle client error and repair #582
Conversation
7ab5140
to
938eeec
Compare
Codecov Report
@@ Coverage Diff @@
## master #582 +/- ##
==========================================
- Coverage 47.34% 47.33% -0.02%
==========================================
Files 97 97
Lines 5544 5544
==========================================
- Hits 2625 2624 -1
Misses 2702 2702
- Partials 217 218 +1
Continue to review full report at Codecov.
|
938eeec
to
d0eac20
Compare
124a020
to
a128d65
Compare
...rc/main/java/com/dragonflyoss/dragonfly/supernode/service/repair/BaseClientErrorHandler.java
Show resolved
Hide resolved
...rc/main/java/com/dragonflyoss/dragonfly/supernode/service/repair/BaseClientErrorHandler.java
Show resolved
Hide resolved
@Slf4j | ||
public abstract class BaseClientErrorHandler implements ClientErrorHandler { | ||
private static final ExecutorService executor = ExecutorsUtil | ||
.newThreadPool("client-error", 20, 200); |
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 guess may not need so many threads.
String localMd5 = getMd5(info.getTaskId(), info.getRange()); | ||
if (StringUtils.isNotBlank(localMd5)) { | ||
if (!StringUtils.equals(md5FromMeta, localMd5) // data in supernode is not right | ||
&& !StringUtils.equals(localMd5, info.getExpectedMd5())) { |
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 think if data in supernode is not right then we will remove the task from the super.
is condition !StringUtils.equals(localMd5, info.getExpectedMd5()) necessary?
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.
Before supernode completing downloading file from remote server, the meta data is not written into local disk, so the md5FromMeta
may be null.
e87d9a0
to
b0e4354
Compare
Signed-off-by: lowzj <[email protected]>
b0e4354
to
ba6de46
Compare
LGTM. |
feature: handle client error and repair
feature: handle client error and repair
* feat: create preheat_test.go Signed-off-by: zzy987 <[email protected]> * feat: add post request Signed-off-by: zzy987 <[email protected]> * fix: try to fix header name Signed-off-by: zzy987 <[email protected]> * fix: try fix page not found Signed-off-by: zzy987 <[email protected]> * fix: try to install kubectl in cdn pod Signed-off-by: zzy987 <[email protected]> * fix: remove sudo Signed-off-by: zzy987 <[email protected]> * chore: put curl in manager Signed-off-by: zzy987 <[email protected]> * fix: correct json content Signed-off-by: zzy987 <[email protected]> * fix: correct request url Signed-off-by: zzy987 <[email protected]> * chore: check curl result Signed-off-by: zzy987 <[email protected]> * fix: correct request url Signed-off-by: zzy987 <[email protected]> * chore: check the cmd string in github environment Signed-off-by: zzy987 <[email protected]> * fix: use service Signed-off-by: zzy987 <[email protected]> * fix: delete cluster-name Signed-off-by: zzy987 <[email protected]> * chore: use " in header Signed-off-by: zzy987 <[email protected]> * fix: curl command format Signed-off-by: zzy987 <[email protected]> * feat: use idgen.taskid to get the filename Signed-off-by: zzy987 <[email protected]> * chore: add an error message Signed-off-by: zzy987 <[email protected]> * feat: add concurrency test Signed-off-by: zzy987 <[email protected]> * fix: ab use proxy Signed-off-by: zzy987 <[email protected]> * feat: add curl pod Signed-off-by: zzy987 <[email protected]> * feat: add function CurlCommand Signed-off-by: zzy987 <[email protected]> * fix: variable usage Signed-off-by: zzy987 <[email protected]> * chore: remove curl in cdn pod Signed-off-by: zzy987 <[email protected]> * chore: modify code format Signed-off-by: zzy987 <[email protected]> * feat: use curl in file-server Signed-off-by: zzy987 <[email protected]> * fix: correct command in file-server Signed-off-by: zzy987 <[email protected]> * chore: add a e2e-test, check if it is the reason of no preheat Signed-off-by: zzy987 <[email protected]> * chore: can test preheat now Signed-off-by: zzy987 <[email protected]> * fix: check result after concurrency test Signed-off-by: zzy987 <[email protected]> * chore: add comments, add function check preheat result Signed-off-by: zzy987 <[email protected]> * chore: delete e2e_test in e2e/manager Signed-off-by: zzy987 <[email protected]> * chore: refactor curlCommand, add func getCDNs getFS Signed-off-by: zzy987 <[email protected]> * feat: add image preheat Signed-off-by: zzy987 <[email protected]> * chore: rename functions Signed-off-by: zzy987 <[email protected]> * fix: delete functions, use stable task id in test Signed-off-by: zzy987 <[email protected]>
Signed-off-by: lowzj [email protected]
Ⅰ. Describe what this PR did
dfget reports downloading errors to supernode, supernode checks and repairs local data automatically, currently repair these client errors:
FILE_NOT_EXIST
FILE_MD5_NOT_MATCH
add a new api into supernode to delete the task's data manually if any error occurred
client-side pr: #583
Ⅱ. Does this pull request fix one issue?
fixes #545
fixes #311
fixes #68
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews