Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
0.14.0
-
None
-
None
Description
The easy way to reproduce this bug is to run fsck when only the name-node is up.
The problem is that NetworkTopology.pseudoSortByDistance() is trying to get nextInt() to the length of
the array of node locations, which is empty in this case, and nextInt() throws an exception when the argument is not positive.
java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:248)
at org.apache.hadoop.net.NetworkTopology.pseudoSortByDistance(NetworkTopology.java:642)
at org.apache.hadoop.dfs.FSNamesystem.getBlockLocations(FSNamesystem.java:556)
at org.apache.hadoop.dfs.NameNode.getBlockLocations(NameNode.java:280)
at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:154)
at org.apache.hadoop.dfs.NamenodeFsck.fsck(NamenodeFsck.java:123)
at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
at org.mortbay.http.HttpServer.service(HttpServer.java:954)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)