This is an automated email from the ASF dual-hosted git repository. mmiller pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new 114704bb58 Fix Fate enum name (#2904) 114704bb58 is described below commit 114704bb58a37073a0401c3b6f479761089bd1fb Author: Mike Miller <mmil...@apache.org> AuthorDate: Thu Sep 1 16:08:05 2022 +0000 Fix Fate enum name (#2904) * Rename enum to TX_NAME and pass in name to Fate seedTransaction() * Clean up FateLogger log and fateCommand print --- .../apache/accumulo/core/logging/FateLogger.java | 2 +- .../java/org/apache/accumulo/fate/AdminUtil.java | 24 +++++++------- .../main/java/org/apache/accumulo/fate/Fate.java | 7 ++-- .../accumulo/manager/FateServiceHandler.java | 38 +++++++++++----------- .../manager/ManagerClientServiceHandler.java | 4 +-- .../manager/metrics/fate/FateMetricValues.java | 2 +- .../commands/fateCommand/FateSummaryReport.java | 4 +-- .../shell/commands/fateCommand/FateTxnDetails.java | 8 ++--- .../commands/fateCommand/SummaryReportTest.java | 2 +- .../shell/commands/fateCommand/TxnDetailsTest.java | 6 ++-- .../accumulo/test/fate/zookeeper/FateIT.java | 10 +++--- .../test/functional/FateConcurrencyIT.java | 7 ++-- 12 files changed, 56 insertions(+), 58 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/logging/FateLogger.java b/core/src/main/java/org/apache/accumulo/core/logging/FateLogger.java index 56a9790205..ff630d7906 100644 --- a/core/src/main/java/org/apache/accumulo/core/logging/FateLogger.java +++ b/core/src/main/java/org/apache/accumulo/core/logging/FateLogger.java @@ -133,7 +133,7 @@ public class FateLogger { public void setTransactionInfo(long tid, Fate.TxInfo txInfo, Serializable val) { store.setTransactionInfo(tid, txInfo, val); if (storeLog.isTraceEnabled()) - storeLog.trace("{} setting {} txInfo to {}", formatTid(tid), txInfo, val); + storeLog.trace("{} setting {} to {}", formatTid(tid), txInfo, val); } @Override diff --git a/core/src/main/java/org/apache/accumulo/fate/AdminUtil.java b/core/src/main/java/org/apache/accumulo/fate/AdminUtil.java index dbe1fa5def..e22d005687 100644 --- a/core/src/main/java/org/apache/accumulo/fate/AdminUtil.java +++ b/core/src/main/java/org/apache/accumulo/fate/AdminUtil.java @@ -73,18 +73,18 @@ public class AdminUtil<T> { private final long txid; private final TStatus status; - private final String repoTarget; + private final String txName; private final List<String> hlocks; private final List<String> wlocks; private final String top; private final long timeCreated; - private TransactionStatus(Long tid, TStatus status, String repoTarget, List<String> hlocks, + private TransactionStatus(Long tid, TStatus status, String txName, List<String> hlocks, List<String> wlocks, String top, Long timeCreated) { this.txid = tid; this.status = status; - this.repoTarget = repoTarget; + this.txName = txName; this.hlocks = Collections.unmodifiableList(hlocks); this.wlocks = Collections.unmodifiableList(wlocks); this.top = top; @@ -105,10 +105,10 @@ public class AdminUtil<T> { } /** - * @return The repo target for the operation on the top of the stack for this Fate operation. + * @return The name of the transaction running. */ - public String getRepoTarget() { - return repoTarget; + public String getTxName() { + return txName; } /** @@ -364,7 +364,7 @@ public class AdminUtil<T> { zs.reserve(tid); - String repoTarget = (String) zs.getTransactionInfo(tid, Fate.TxInfo.REPO_TARGET); + String txName = (String) zs.getTransactionInfo(tid, Fate.TxInfo.TX_NAME); List<String> hlocks = heldLocks.remove(tid); @@ -390,8 +390,7 @@ public class AdminUtil<T> { zs.unreserve(tid, 0); if (includeByStatus(status, filterStatus) && includeByTxid(tid, filterTxid)) { - statuses - .add(new TransactionStatus(tid, status, repoTarget, hlocks, wlocks, top, timeCreated)); + statuses.add(new TransactionStatus(tid, status, txName, hlocks, wlocks, top, timeCreated)); } } @@ -419,10 +418,9 @@ public class AdminUtil<T> { for (TransactionStatus txStatus : fateStatus.getTransactions()) { fmt.format( - "txid: %s status: %-18s op: %-15s locked: %-15s locking: %-15s top: %-15s created: %s%n", - txStatus.getTxid(), txStatus.getStatus(), txStatus.getRepoTarget(), - txStatus.getHeldLocks(), txStatus.getWaitingLocks(), txStatus.getTop(), - txStatus.getTimeCreatedFormatted()); + "%-15s txid: %s status: %-18s locked: %-15s locking: %-15s op: %-15s created: %s%n", + txStatus.getTxName(), txStatus.getTxid(), txStatus.getStatus(), txStatus.getHeldLocks(), + txStatus.getWaitingLocks(), txStatus.getTop(), txStatus.getTimeCreatedFormatted()); } fmt.format(" %s transactions", fateStatus.getTransactions().size()); diff --git a/core/src/main/java/org/apache/accumulo/fate/Fate.java b/core/src/main/java/org/apache/accumulo/fate/Fate.java index 30ab7fd3c8..d45f039e28 100644 --- a/core/src/main/java/org/apache/accumulo/fate/Fate.java +++ b/core/src/main/java/org/apache/accumulo/fate/Fate.java @@ -67,7 +67,7 @@ public class Fate<T> { private final AtomicBoolean keepRunning = new AtomicBoolean(true); public enum TxInfo { - REPO_TARGET, AUTO_CLEAN, EXCEPTION, RETURN_VALUE + TX_NAME, AUTO_CLEAN, EXCEPTION, RETURN_VALUE } private class TransactionRunner implements Runnable { @@ -283,7 +283,8 @@ public class Fate<T> { // start work in the transaction.. it is safe to call this // multiple times for a transaction... but it will only seed once - public void seedTransaction(long tid, Repo<T> repo, boolean autoCleanUp, String goalMessage) { + public void seedTransaction(String txName, long tid, Repo<T> repo, boolean autoCleanUp, + String goalMessage) { store.reserve(tid); try { if (store.getStatus(tid) == NEW) { @@ -300,7 +301,7 @@ public class Fate<T> { if (autoCleanUp) store.setTransactionInfo(tid, TxInfo.AUTO_CLEAN, autoCleanUp); - store.setTransactionInfo(tid, TxInfo.REPO_TARGET, repo.getName()); + store.setTransactionInfo(tid, TxInfo.TX_NAME, txName); store.setStatus(tid, SUBMITTED); } diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java b/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java index 41ce18c9ff..c10c0bec9e 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java @@ -128,7 +128,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Create " + namespace + " namespace."; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new CreateNamespace(c.getPrincipal(), namespace, options)), autoCleanup, goalMessage); break; @@ -146,7 +146,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Rename " + oldName + " namespace to " + newName; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new RenameNamespace(namespaceId, oldName, newName)), autoCleanup, goalMessage); break; @@ -163,8 +163,8 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Delete namespace Id: " + namespaceId; - manager.fate.seedTransaction(opid, new TraceRepo<>(new DeleteNamespace(namespaceId)), - autoCleanup, goalMessage); + manager.fate.seedTransaction(op.toString(), opid, + new TraceRepo<>(new DeleteNamespace(namespaceId)), autoCleanup, goalMessage); break; } case TABLE_CREATE: { @@ -220,7 +220,7 @@ class FateServiceHandler implements FateService.Iface { goalMessage += "Create table " + tableName + " " + initialTableState + " with " + splitCount + " splits."; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new CreateTable(c.getPrincipal(), tableName, timeType, options, splitsPath, splitCount, splitsDirsPath, initialTableState, namespaceId)), autoCleanup, goalMessage); @@ -254,7 +254,7 @@ class FateServiceHandler implements FateService.Iface { goalMessage += "Rename table " + oldTableName + "(" + tableId + ") to " + oldTableName; try { - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new RenameTable(namespaceId, tableId, oldTableName, newTableName)), autoCleanup, goalMessage); } catch (NamespaceNotFoundException e) { @@ -321,8 +321,8 @@ class FateServiceHandler implements FateService.Iface { goalMessage += " and keep offline."; manager.fate.seedTransaction( - opid, new TraceRepo<>(new CloneTable(c.getPrincipal(), namespaceId, srcTableId, - tableName, propertiesToSet, propertiesToExclude, keepOffline)), + op.toString(), opid, new TraceRepo<>(new CloneTable(c.getPrincipal(), namespaceId, + srcTableId, tableName, propertiesToSet, propertiesToExclude, keepOffline)), autoCleanup, goalMessage); break; @@ -349,7 +349,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Delete table " + tableName + "(" + tableId + ")"; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new PreDeleteTable(namespaceId, tableId)), autoCleanup, goalMessage); break; } @@ -372,7 +372,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Online table " + tableId; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new ChangeTableState(namespaceId, tableId, tableOp)), autoCleanup, goalMessage); break; @@ -396,7 +396,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Offline table " + tableId; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new ChangeTableState(namespaceId, tableId, tableOp)), autoCleanup, goalMessage); break; @@ -430,7 +430,7 @@ class FateServiceHandler implements FateService.Iface { startRowStr, endRowStr); goalMessage += "Merge table " + tableName + "(" + tableId + ") splits from " + startRowStr + " to " + endRowStr; - manager.fate.seedTransaction(opid, new TraceRepo<>( + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>( new TableRangeOp(MergeInfo.Operation.MERGE, namespaceId, tableId, startRow, endRow)), autoCleanup, goalMessage); break; @@ -461,7 +461,7 @@ class FateServiceHandler implements FateService.Iface { goalMessage += "Delete table " + tableName + "(" + tableId + ") range " + startRow + " to " + endRow; - manager.fate.seedTransaction(opid, new TraceRepo<>( + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>( new TableRangeOp(MergeInfo.Operation.DELETE, namespaceId, tableId, startRow, endRow)), autoCleanup, goalMessage); break; @@ -494,7 +494,7 @@ class FateServiceHandler implements FateService.Iface { manager.updateBulkImportStatus(dir, BulkImportState.INITIAL); goalMessage += "Bulk import " + dir + " to " + tableName + "(" + tableId + ") failing to " + failDir; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new org.apache.accumulo.manager.tableOps.bulkVer1.BulkImport(tableId, dir, failDir, setTime)), autoCleanup, goalMessage); @@ -520,7 +520,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Compact table (" + tableId + ") with config " + compactionConfig; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new CompactRange(namespaceId, tableId, compactionConfig)), autoCleanup, goalMessage); break; @@ -543,7 +543,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Cancel compaction of table (" + tableId + ")"; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new CancelCompactions(namespaceId, tableId)), autoCleanup, goalMessage); break; } @@ -580,7 +580,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Import table with new name: " + tableName + " from " + exportDirs; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new ImportTable(c.getPrincipal(), tableName, exportDirs, namespaceId)), autoCleanup, goalMessage); break; @@ -608,7 +608,7 @@ class FateServiceHandler implements FateService.Iface { throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED); goalMessage += "Export table " + tableName + "(" + tableId + ") to " + exportDir; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new ExportTable(namespaceId, tableName, tableId, exportDir)), autoCleanup, goalMessage); break; @@ -644,7 +644,7 @@ class FateServiceHandler implements FateService.Iface { manager.updateBulkImportStatus(dir, BulkImportState.INITIAL); goalMessage += "Bulk import (v2) " + dir + " to " + tableName + "(" + tableId + ")"; - manager.fate.seedTransaction(opid, + manager.fate.seedTransaction(op.toString(), opid, new TraceRepo<>(new PrepBulkImport(tableId, dir, setTime)), autoCleanup, goalMessage); break; default: diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java b/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java index 778e3ffce5..85f50b418a 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java @@ -280,8 +280,8 @@ public class ManagerClientServiceHandler implements ManagerClientService.Iface { String msg = "Shutdown tserver " + tabletServer; - manager.fate.seedTransaction(tid, new TraceRepo<>(new ShutdownTServer(doomed, force)), false, - msg); + manager.fate.seedTransaction("ShutdownTServer", tid, + new TraceRepo<>(new ShutdownTServer(doomed, force)), false, msg); manager.fate.waitForCompletion(tid); manager.fate.delete(tid); diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/metrics/fate/FateMetricValues.java b/server/manager/src/main/java/org/apache/accumulo/manager/metrics/fate/FateMetricValues.java index 8e47bdb656..2ed6219c7b 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/metrics/fate/FateMetricValues.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/metrics/fate/FateMetricValues.java @@ -136,7 +136,7 @@ class FateMetricValues { // incr count for op type for for in_progress transactions. if (ReadOnlyTStore.TStatus.IN_PROGRESS.equals(tx.getStatus())) { - String opType = tx.getRepoTarget(); + String opType = tx.getTxName(); if (opType == null || opType.isEmpty()) { opType = "UNKNOWN"; } diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateSummaryReport.java b/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateSummaryReport.java index 0e8cc1ebbe..5dec5ca3c2 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateSummaryReport.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateSummaryReport.java @@ -72,8 +72,8 @@ public class FateSummaryReport { } String top = txnStatus.getTop(); stepCounts.merge(Objects.requireNonNullElse(top, "?"), 1, Integer::sum); - String debug = txnStatus.getRepoTarget(); - cmdCounts.merge(Objects.requireNonNullElse(debug, "?"), 1, Integer::sum); + String runningRepo = txnStatus.getTxName(); + cmdCounts.merge(Objects.requireNonNullElse(runningRepo, "?"), 1, Integer::sum); // filter status if provided. if (!statusFilterNames.isEmpty() && !statusFilterNames.contains(txnStatus.getStatus().name())) { diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateTxnDetails.java b/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateTxnDetails.java index e7bad94ca7..12ff2e1c96 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateTxnDetails.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/fateCommand/FateTxnDetails.java @@ -32,7 +32,7 @@ public class FateTxnDetails implements Comparable<FateTxnDetails> { private long running; private String status = "?"; - private String command = "?"; + private String txName = "?"; private String step = "?"; private String txnId = "?"; private List<String> locksHeld = List.of(); @@ -71,8 +71,8 @@ public class FateTxnDetails implements Comparable<FateTxnDetails> { if (txnStatus.getTop() != null) { step = txnStatus.getTop(); } - if (txnStatus.getRepoTarget() != null) { - command = txnStatus.getRepoTarget(); + if (txnStatus.getTxName() != null) { + txName = txnStatus.getTxName(); } if (txnStatus.getTxid() != null) { txnId = txnStatus.getTxid(); @@ -133,7 +133,7 @@ public class FateTxnDetails implements Comparable<FateTxnDetails> { String hms = String.format("%d:%02d:%02d", elapsed.toHours(), elapsed.toMinutesPart(), elapsed.toSecondsPart()); - return hms + "\t" + txnId + "\t" + status + "\t" + command + "\t" + step + "\theld:" + return hms + "\t" + txnId + "\t" + status + "\t" + txName + "\t" + step + "\theld:" + locksHeld.toString() + "\twaiting:" + locksWaiting.toString() + "\n"; } diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/SummaryReportTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/SummaryReportTest.java index c660b05059..14543e81d8 100644 --- a/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/SummaryReportTest.java +++ b/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/SummaryReportTest.java @@ -67,7 +67,7 @@ class SummaryReportTest { expect(status1.getTimeCreated()).andReturn(now - TimeUnit.DAYS.toMillis(1)).anyTimes(); expect(status1.getStatus()).andReturn(ReadOnlyTStore.TStatus.IN_PROGRESS).anyTimes(); expect(status1.getTop()).andReturn(null).anyTimes(); - expect(status1.getRepoTarget()).andReturn(null).anyTimes(); + expect(status1.getTxName()).andReturn(null).anyTimes(); expect(status1.getTxid()).andReturn("abcdabcd").anyTimes(); expect(status1.getHeldLocks()).andReturn(List.of()).anyTimes(); expect(status1.getWaitingLocks()).andReturn(List.of()).anyTimes(); diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/TxnDetailsTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/TxnDetailsTest.java index 1d8c65389a..df3d99b488 100644 --- a/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/TxnDetailsTest.java +++ b/shell/src/test/java/org/apache/accumulo/shell/commands/fateCommand/TxnDetailsTest.java @@ -52,7 +52,7 @@ class TxnDetailsTest { expect(status1.getTimeCreated()).andReturn(now - TimeUnit.DAYS.toMillis(1)).anyTimes(); expect(status1.getStatus()).andReturn(ReadOnlyTStore.TStatus.IN_PROGRESS).anyTimes(); expect(status1.getTop()).andReturn("step1").anyTimes(); - expect(status1.getRepoTarget()).andReturn("command1").anyTimes(); + expect(status1.getTxName()).andReturn("runningTx1").anyTimes(); expect(status1.getTxid()).andReturn("abcdabcd").anyTimes(); expect(status1.getHeldLocks()).andReturn(List.of()).anyTimes(); expect(status1.getWaitingLocks()).andReturn(List.of()).anyTimes(); @@ -61,7 +61,7 @@ class TxnDetailsTest { expect(status2.getTimeCreated()).andReturn(now - TimeUnit.DAYS.toMillis(7)).anyTimes(); expect(status2.getStatus()).andReturn(ReadOnlyTStore.TStatus.IN_PROGRESS).anyTimes(); expect(status2.getTop()).andReturn("step2").anyTimes(); - expect(status2.getRepoTarget()).andReturn("command2").anyTimes(); + expect(status2.getTxName()).andReturn("runningTx2").anyTimes(); expect(status2.getTxid()).andReturn("123456789").anyTimes(); expect(status2.getHeldLocks()).andReturn(List.of()).anyTimes(); expect(status2.getWaitingLocks()).andReturn(List.of()).anyTimes(); @@ -95,7 +95,7 @@ class TxnDetailsTest { expect(status1.getTimeCreated()).andReturn(now - TimeUnit.DAYS.toMillis(1)).anyTimes(); expect(status1.getStatus()).andReturn(ReadOnlyTStore.TStatus.IN_PROGRESS).anyTimes(); expect(status1.getTop()).andReturn("step1").anyTimes(); - expect(status1.getRepoTarget()).andReturn("command1").anyTimes(); + expect(status1.getTxName()).andReturn("runningTx").anyTimes(); expect(status1.getTxid()).andReturn("abcdabcd").anyTimes(); // incomplete lock info (W unknown ns id, no table)) expect(status1.getHeldLocks()).andReturn(List.of("R:1", "R:2", "W:a")).anyTimes(); diff --git a/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java b/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java index a24ef6d389..685cc6c82d 100644 --- a/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java +++ b/test/src/main/java/org/apache/accumulo/test/fate/zookeeper/FateIT.java @@ -173,7 +173,7 @@ public class FateIT { long txid = fate.startTransaction(); assertEquals(TStatus.NEW, getTxStatus(zk, txid)); - fate.seedTransaction(txid, new TestOperation(NS, TID), true, "Test Op"); + fate.seedTransaction("TestOperation", txid, new TestOperation(NS, TID), true, "Test Op"); assertEquals(TStatus.SUBMITTED, getTxStatus(zk, txid)); // wait for call() to be called callStarted.await(); @@ -238,7 +238,7 @@ public class FateIT { // cancel the transaction assertTrue(fate.cancel(txid)); assertTrue(FAILED_IN_PROGRESS == getTxStatus(zk, txid) || FAILED == getTxStatus(zk, txid)); - fate.seedTransaction(txid, new TestOperation(NS, TID), true, "Test Op"); + fate.seedTransaction("TestOperation", txid, new TestOperation(NS, TID), true, "Test Op"); assertTrue(FAILED_IN_PROGRESS == getTxStatus(zk, txid) || FAILED == getTxStatus(zk, txid)); fate.delete(txid); } finally { @@ -274,7 +274,7 @@ public class FateIT { long txid = fate.startTransaction(); LOG.debug("Starting test testCancelWhileSubmitted with {}", FateTxId.formatTid(txid)); assertEquals(NEW, getTxStatus(zk, txid)); - fate.seedTransaction(txid, new TestOperation(NS, TID), true, "Test Op"); + fate.seedTransaction("TestOperation", txid, new TestOperation(NS, TID), true, "Test Op"); assertEquals(SUBMITTED, getTxStatus(zk, txid)); assertTrue(fate.cancel(txid)); } @@ -308,7 +308,7 @@ public class FateIT { long txid = fate.startTransaction(); LOG.debug("Starting test testCancelWhileSubmitted with {}", FateTxId.formatTid(txid)); assertEquals(NEW, getTxStatus(zk, txid)); - fate.seedTransaction(txid, new TestOperation(NS, TID), true, "Test Op"); + fate.seedTransaction("TestOperation", txid, new TestOperation(NS, TID), true, "Test Op"); assertEquals(SUBMITTED, getTxStatus(zk, txid)); // This is false because the transaction runner has reserved the FaTe // transaction. @@ -350,7 +350,7 @@ public class FateIT { long txid = fate.startTransaction(); LOG.debug("Starting test testCancelWhileInCall with {}", FateTxId.formatTid(txid)); assertEquals(NEW, getTxStatus(zk, txid)); - fate.seedTransaction(txid, new TestOperation(NS, TID), true, "Test Op"); + fate.seedTransaction("TestOperation", txid, new TestOperation(NS, TID), true, "Test Op"); assertEquals(SUBMITTED, getTxStatus(zk, txid)); // wait for call() to be called callStarted.await(); diff --git a/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java b/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java index cfd7483be8..e522ee353a 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java @@ -384,11 +384,10 @@ public class FateConcurrencyIT extends AccumuloClusterHarness { log.trace("Fate id: {}, status: {}", tx.getTxid(), tx.getStatus()); String top = tx.getTop(); - String debug = tx.getRepoTarget(); - - return top != null && debug != null && top.contains("CompactionDriver") - && tx.getRepoTarget().contains("CompactRange"); + String txName = tx.getTxName(); + return top != null && txName != null && top.contains("CompactionDriver") + && tx.getTxName().equals("TABLE_COMPACT"); } /**