Issue Details (XML | Word | Printable)

Key: HADOOP-3448
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Steve Loughran
Reporter: Steve Loughran
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Add some more hints of the problem when datanode and namenode don't match

Created: 27/May/08 04:24 PM   Updated: 08/Jul/09 04:43 PM
Return to search
Component/s: None
Affects Version/s: 0.18.0
Fix Version/s: 0.18.0

Time Tracking:
Original Estimate: 0.08h
Original Estimate - 0.08h
Remaining Estimate: 0.08h
Remaining Estimate - 0.08h
Time Spent: Not Specified
Remaining Estimate - 0.08h

File Attachments:
  Size
Text File Licensed for inclusion in ASF works hadoop-3448.patch 2008-05-27 04:25 PM Steve Loughran 0.6 kB

Hadoop Flags: Reviewed
Resolution Date: 04/Jun/08 05:30 PM


 Description  « Hide
When there is a mismatch between name and data mode, and you are running with -ea set, then Datanode.handshake() bails out with an assertion "Data-node and name-node layout versions must be the same.";

However, this message doesnt actually say which version numbers are at fault. A better error message would include the version information, so pointing the finger of blame would be easier.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Steve Loughran added a comment - 27/May/08 04:25 PM
patch to make the assertion more detailed
"Data-node and name-node layout versions must be the same."
+ "Expected: "+ FSConstants.LAYOUT_VERSION + " actual "+ nsInfo.getLayoutVersion();

Steve Loughran added a comment - 27/May/08 04:28 PM
The patch I've submitted adds the version information, so the the stack trace can be more useful than :

java.lang.AssertionError: Data-node and name-node layout versions must be the same.,

However, one thing to consider is whether this should be checked every time the datanode starts up, rather than skipping it if -ea is disabled. Otherwise there is a risk that the problem will not be picked up in production.


Steve Loughran added a comment - 28/May/08 02:18 PM
patch available.

Konstantin Shvachko added a comment - 28/May/08 06:32 PM
This should actually never happen. Something is wrong with your build. Here is why.
DataNode.handshake() receives version information from the name-node and verifies it against its own versions.
And the first thing that is verified is the build version. BV is reset every time you re-build hadoop, while LAYOUT_VERSION
changes only if its is actually changed in the code.
So, if the LAYOUT_VERSIONs are different then the build versions must be different too.
The assert you mentioned is really an assert and should not be used for diagnostic purposes.
May be the problem is somewhere else. Could you please post here the (different) layout versions and (presumably equal) build versions.

Steve Loughran added a comment - 28/May/08 11:01 PM
The problem has 'gone away'; I think forcing clean builds through fixed it. Given I was running the same version everywhere, I was somewhat surprised too.

two possible causes
-classloader/dual version on path (ivy is in charge of CP setup; it should have caught this)
-cached versions of constants not being picked up
Although Java is fairly smart with dependencies, constant primitive types get copied around at compile time, so can be out of date if something changes.

anyway, the build is fixed. Should the patch be needed? Well, maybe the text could be clearer or just point to a wiki page discussing this issue.


Konstantin Shvachko added a comment - 28/May/08 11:49 PM
I also noticed that if you don't do a clean build the new constants will not be picked up everywhere.
This probably has something to do with dependencies in our build.xml.

Steve Loughran added a comment - 29/May/08 08:34 AM
Its probably because the .class files dont even track where constants came from. Change a constant: do a clean build.

Perhaps we should change the assert to say this.


Robert Chansler added a comment - 04/Jun/08 05:12 PM
Assigning to whomever submitted a patch so as to better manage committing things that are ready for prime time.

Owen O'Malley added a comment - 04/Jun/08 05:30 PM
I just committed this. Thanks, Steve!