-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-16896 clear ignoredNodes list when we clear deadnode list on ref… #5322
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
Changes from 4 commits
5a59467
dfe30d0
b3ff5f2
3368917
efb263c
69f6e0e
ac4c0ab
64239e2
c073c9f
40b77b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,6 +197,15 @@ private void clearLocalDeadNodes() { | |
| deadNodes.clear(); | ||
| } | ||
|
|
||
| /** | ||
| * clear list of ignored nodes used for hedged reads | ||
| */ | ||
| private void clearIgnoredNodes(Collection<DatanodeInfo> ignoredNodes) { | ||
mccormickt12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (ignoredNodes != null) { | ||
| ignoredNodes.clear(); | ||
| } | ||
| } | ||
|
|
||
| protected DFSClient getDFSClient() { | ||
| return dfsClient; | ||
| } | ||
|
|
@@ -940,7 +949,8 @@ private DNAddrPair chooseDataNode(LocatedBlock block, | |
| * @return Returns chosen DNAddrPair; Can be null if refetchIfRequired is | ||
| * false. | ||
| */ | ||
| private DNAddrPair chooseDataNode(LocatedBlock block, | ||
| @VisibleForTesting | ||
| DNAddrPair chooseDataNode(LocatedBlock block, | ||
| Collection<DatanodeInfo> ignoredNodes, boolean refetchIfRequired) | ||
| throws IOException { | ||
| while (true) { | ||
|
|
@@ -955,6 +965,10 @@ private DNAddrPair chooseDataNode(LocatedBlock block, | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * RefetchLocations should only be called when there are no active requests | ||
| * to datanodes. In the hedged read case this means futures should be empty | ||
| */ | ||
mccormickt12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private LocatedBlock refetchLocations(LocatedBlock block, | ||
| Collection<DatanodeInfo> ignoredNodes) throws IOException { | ||
| String errMsg = getBestNodeDNAddrPairErrorString(block.getLocations(), | ||
|
|
@@ -1000,6 +1014,7 @@ private LocatedBlock refetchLocations(LocatedBlock block, | |
| "Interrupted while choosing DataNode for read."); | ||
| } | ||
| clearLocalDeadNodes(); //2nd option is to remove only nodes[blockId] | ||
| clearIgnoredNodes(ignoredNodes); | ||
| openInfo(true); | ||
| block = refreshLocatedBlock(block); | ||
| failures++; | ||
|
|
@@ -1337,7 +1352,11 @@ private void hedgedFetchBlockByteRange(LocatedBlock block, long start, | |
| } catch (InterruptedException ie) { | ||
| // Ignore and retry | ||
| } | ||
| if (refetch) { | ||
| // if refetch is true then all nodes are in deadlist or ignorelist | ||
| // we should loop through all futures and remove them so we do not | ||
|
||
| // have concurrent requests to the same node. | ||
| // Once all futures are cleared we can clear the ignore list and retry | ||
| if (refetch && futures.isEmpty()) { | ||
| refetchLocations(block, ignored); | ||
| } | ||
| // We got here if exception. Ignore this node on next go around IFF | ||
|
|
||
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.
Nit. Param documentation.