Github user poornachandra commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/29#discussion_r98803604
--- Diff:
tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/HBaseTransactionPruningPlugin.java
---
@@ -219,13 +219,20 @@ public void destroy() {
*/
protected void createPruneTable(TableName stateTable) throws IOException
{
try (Admin admin = this.connection.getAdmin()) {
+ if (admin.tableExists(stateTable)) {
+ LOG.debug("Not creating pruneStateTable {} since it already
exists.",
+ stateTable.getNameWithNamespaceInclAsString());
+ return;
+ }
+
HTableDescriptor htd = new HTableDescriptor(stateTable);
htd.addFamily(new
HColumnDescriptor(DataJanitorState.FAMILY).setMaxVersions(1));
admin.createTable(htd);
LOG.info("Created pruneTable {}",
stateTable.getNameWithNamespaceInclAsString());
} catch (TableExistsException ex) {
- // Expected if the prune state table already exists
- LOG.debug("Not creating pruneStateTable since it already exists.
{}", ex.getMessage());
+ // Expected if the prune state table is being created at the same
time by another client
+ LOG.debug("Not creating pruneStateTable {} since it already exists.
{}",
+ stateTable.getNameWithNamespaceInclAsString(),
ex.getMessage());
--- End diff --
Log the throwable
---
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 [email protected] or file a JIRA ticket
with INFRA.
---