TaskTracker goes down with error "Comparison method violates its general contract"

Document created by Hao Zhu Employee on Feb 7, 2016
Version 1Show Document
  • View in full screen mode

Author: Hao Zhu

 

Original Publication Date: June 25, 2015

 

Environment :

Hadoop version < 1.3

Symptom

TaskTracker goes down with below stacktrace in tasktracker and jobtracker logs:

 

ERROR org.apache.hadoop.ipc.FailoverRPC: FailoverProxy: Failing this Call: heartbeat for error(RemoteException):

org.apache.hadoop.ipc.RemoteException(java.io.IOException):

java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(TimSort.java:868)

at java.util.TimSort.mergeAt(TimSort.java:485)

at java.util.TimSort.mergeForceCollapse(TimSort.java:426)

at java.util.TimSort.sort(TimSort.java:223)

at java.util.TimSort.sort(TimSort.java:173)

at java.util.Arrays.sort(Arrays.java:659)

at java.util.Collections.sort(Collections.java:217)

at org.apache.hadoop.mapred.PoolSchedulable.assignTask(PoolSchedulable.java:160)

at org.apache.hadoop.mapred.FairScheduler.assignTasks(FairScheduler.java:702)

at org.apache.hadoop.mapred.JobTracker.heartbeat(JobTracker.java:3899)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.apache.hadoop.ipc.WritableRpcEngine$Server$WritableRpcInvoker.call(WritableRpcEngine.java:481)

at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928)

at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2000)

at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1996)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:415)

at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1566)

at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1994)

Root Cause

This is caused by issue MAPREDUCE-5966, If a custom weight adjuster is used, that may be called multiple times during a sort causing different values to return.

 

That causes a failure in sorting because the weight may change during the sort.

 

This issue is fixed in Hadoop 1.3.0.

Solution

Remove below 3 configurations from mapred-site.xml from all client nodes, if they are in use.

The client nodes mean the nodes where MapReduce jobs are submitted.

  •     mapred.fairscheduler.weightadjuster
  •     mapred.newjobweightbooster.factor
  •     mapred.newjobweightbooster.duration

 

If other Hadoop ecosystem products are used to submit MapReduce jobs, make sure above 3 configurations are not set in client side.

 

Take Hive for example, make sure they are not set in hive-site.xml or Hive job level settings.

 

Attachments

    Outcomes