Github user sbroeder commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/730#discussion_r81178992 --- Diff: core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java --- @@ -1034,34 +1034,23 @@ public void run() { } try { TxRecoverList = txnManager.recoveryRequest(hostnamePort, regionBytes, tmID); - }catch (NotServingRegionException e) { - TxRecoverList = null; - LOG.error("TRAF RCOV THREAD:NotServingRegionException calling recoveryRequest. regionBytes: " + new String(regionBytes) + - " TM: " + tmID + " hostnamePort: " + hostnamePort, e); - - // First delete the zookeeper entry - LOG.error("TRAF RCOV THREAD:recoveryRequest. Deleting region entry Entry: " + regionEntry); - zookeeper.deleteRegionEntry(regionEntry); - // Create a local HTable object using the regionInfo - HTable table = new HTable(config, HRegionInfo.parseFrom(regionBytes).getTable().getNameAsString()); - // Repost a zookeeper entry for all current regions in the table - zookeeper.postAllRegionEntries(table); - }// NotServingRegionException - catch (TableNotFoundException tnfe) { - // In this case there is nothing to recover. We just need to delete the region entry. - // First delete the zookeeper entry - LOG.warn("TRAF RCOV THREAD:TableNotFoundException calling txnManager.recoveryRequest. " + "TM: " + - tmID + " regionBytes: [" + regionBytes + "]. Deleting zookeeper region entry. \n exception: " + tnfe); - zookeeper.deleteRegionEntry(regionEntry); - - }// TableNotFoundException - catch (DeserializationException de) { - // We are unable to parse the region info from ZooKeeper We just need to delete the region entry. - // First delete the zookeeper entry - LOG.warn("TRAF RCOV THREAD:DeserializationException calling txnManager.recoveryRequest. " + "TM: " + - tmID + " regionBytes: [" + regionBytes + "]. Deleting zookeeper region entry. \n exception: " + de); - zookeeper.deleteRegionEntry(regionEntry); - }// DeserializationException + } + catch (IOException e) { + // For all cases of Exception, we rely on the region to redrive the request. + // Likely there is nothing to recover, due to a stale region entry, but it is always safe to redrive. + // We log a warning event and delete the ZKNode entry. + LOG.warn("TRAF RCOV THREAD:Exception calling txnManager.recoveryRequest. " + "TM: " + + tmID + " regionBytes: [" + regionBytes + "]. Deleting zookeeper region entry. \n exception: ", e); + zookeeper.deleteRegionEntry(regionEntry); + + // In the case of NotServingRegionException we will repost the ZKNode after refreshing the table. + if (e instanceof NotServingRegionException){ --- End diff -- Yes, this is a good suggestion Selva
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---