Hi All,

 

            In HBase 0.90 I have seen that it has a fault tolerant behavior
of triggering lease recovery and closing the file when the writer dies in
the middle. Yet does hbase have any workaround/recovery when Namenode is
restarted in the middle of the file write(possibly the HLog file , after
some syncs)???

            I faced a problem in the above scenario. When the NN is
restarted(but not DN), the following code goes into infinite loop as lease
recovery is not at all happening. But once the DN is restarted, the file can
be recovered successfully(I think the DN is not sending those partial blocks
in blocksBeingWritten to NN when only NN is restarted).         

 

               // Recover the files lease if necessary
boolean recovered = false;
while (!recovered) {
  try {
    FSDataOutputStream out = fs.append(logfiles[i].getPath());
    out.close();
    recovered = true;
  } catch (IOException e) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Triggering lease recovery.");
    }
    try {
      Thread.sleep(leaseRecoveryPeriod);
    } catch (InterruptedException ex) {
      // ignore it and try again
    }
  }

 

 

 Thanks,

  Gokul

 

  

 

 

Reply via email to