[ 
https://issues.apache.org/jira/browse/HBASE-9177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13736905#comment-13736905
 ] 

rajeshbabu commented on HBASE-9177:
-----------------------------------

The reason for failure is in 0.94 we are persisting cluster id as string in UTF 
encoding but in trunk we are reading as bytes, so some extra bytes are getting 
appended to it.

0.94.x
======
{code}
        Path filePath = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
        FSDataOutputStream s = fs.create(filePath);
        s.writeUTF(clusterId);
        s.close();
{code}

trunk:
======
{code}
      FSDataInputStream in = fs.open(idPath);
      try {
        in.readFully(content);
      } catch (EOFException eof) {
        LOG.warn("Cluster ID file " + idPath.toString() + " was empty");
      } finally{
        in.close();
      }
{code}
                
> Cluster UUID is not properly parsable after rewriting to PB.
> ------------------------------------------------------------
>
>                 Key: HBASE-9177
>                 URL: https://issues.apache.org/jira/browse/HBASE-9177
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.98.0, 0.95.2
>            Reporter: rajeshbabu
>            Assignee: rajeshbabu
>
> I am facing this problem while testing HBASE-8348(migration).
> ->I have started two clusters with 0.94 version to replicate data from one 
> cluster to other. When we have started master,writing cluster id without PB. 
> -> killed both the clusters when Replication in progress
> -> running migration script to migrate hdfs and zk data to 0.96.0(No changes 
> in cluster id.)
> -> starting 0.96.0 processes. 
> Then not able to start region server.
> {code}
> java.io.IOException: Region server startup failed
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:2629)
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.handleReportForDutyResponse(HRegionServer.java:1202)
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:802)
>       at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.NumberFormatException: For input string: " $411f611e
>       at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>       at java.lang.Long.parseLong(Long.java:410)
>       at java.lang.Long.valueOf(Long.java:498)
>       at java.lang.Long.decode(Long.java:641)
>       at java.util.UUID.fromString(UUID.java:208)
>       at 
> org.apache.hadoop.hbase.zookeeper.ZKClusterId.getUUIDForCluster(ZKClusterId.java:90)
>       at 
> org.apache.hadoop.hbase.replication.regionserver.Replication.initialize(Replication.java:127)
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.newReplicationInstance(HRegionServer.java:2248)
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.createNewReplicationInstance(HRegionServer.java:2219)
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.setupWALAndReplication(HRegionServer.java:1423)
>       at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.handleReportForDutyResponse(HRegionServer.java:1190)
>       ... 2 more
> {code}
> {code}
>       try {
>         clusterId = ClusterId.parseFrom(content);
>       } catch (DeserializationException e) {
>         throw new IOException("content=" + Bytes.toString(content), e);
>       }
>       // If not pb'd, make it so.
>       if (!ProtobufUtil.isPBMagicPrefix(content)) rewriteAsPb(fs, rootdir, 
> idPath, clusterId);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to