From 47bcfb24ff878b2593a2400778436ea8077a2459 Mon Sep 17 00:00:00 2001 From: Daniel Roberts ddanielr Date: Mon, 12 Jan 2026 18:11:56 +0000 Subject: [PATCH 1/2] Fixes the shell fate delete command Changes the delete action of the `shell fate --delete` to actually remove the fate transaction id from table_locks instead of looking for the zlock under the manager lock. This matches the same delete behavior as the `admin fate --delete` command --- .../org/apache/accumulo/shell/commands/FateCommand.java | 6 +++--- .../org/apache/accumulo/shell/commands/FateCommandTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java index 881b2f99a11..974593330a0 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java @@ -170,7 +170,7 @@ public int execute(final String fullCommand, final CommandLine cl, final Shell s } else if (cl.hasOption(delete.getOpt())) { String[] txids = cl.getOptionValues(delete.getOpt()); validateArgs(txids); - failedCommand = deleteTx(shellState.getWriter(), admin, zs, zk, managerLockPath, txids); + failedCommand = deleteTx(shellState.getWriter(), admin, zs, zk, managerLockPath, tableLocksPath, txids); } else if (cl.hasOption(list.getOpt())) { printTx(shellState, admin, zs, zk, tableLocksPath, cl.getOptionValues(list.getOpt()), cl); } else if (cl.hasOption(print.getOpt())) { @@ -237,11 +237,11 @@ protected void printTx(Shell shellState, AdminUtil admin, ZooStore< } protected boolean deleteTx(PrintWriter out, AdminUtil admin, - ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, String[] args) + ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, ServiceLockPath zTableLocksPath, String[] args) throws InterruptedException, KeeperException { for (int i = 1; i < args.length; i++) { if (admin.prepDelete(zs, zk, zLockManagerPath, args[i])) { - admin.deleteLocks(zk, zLockManagerPath, args[i]); + admin.deleteLocks(zk, zTableLocksPath, args[i]); } else { out.printf("Could not delete transaction: %s%n", args[i]); return false; diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java index 2419cbf9d82..b6e32f8a4a6 100644 --- a/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java +++ b/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java @@ -99,7 +99,7 @@ String dumpTx(ZooStore zs, String[] args) { @Override protected boolean deleteTx(PrintWriter out, AdminUtil admin, - ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, + ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, ServiceLockPath zTableLocksPath, String[] args) throws InterruptedException, KeeperException { deleteCalled = true; return true; From 4229f0467b69e189a4090f1a1fde0f8f07f2e81c Mon Sep 17 00:00:00 2001 From: Daniel Roberts ddanielr Date: Mon, 12 Jan 2026 18:31:08 +0000 Subject: [PATCH 2/2] fix-formatting --- .../org/apache/accumulo/shell/commands/FateCommand.java | 7 ++++--- .../apache/accumulo/shell/commands/FateCommandTest.java | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java index 974593330a0..82f9366748c 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/FateCommand.java @@ -170,7 +170,8 @@ public int execute(final String fullCommand, final CommandLine cl, final Shell s } else if (cl.hasOption(delete.getOpt())) { String[] txids = cl.getOptionValues(delete.getOpt()); validateArgs(txids); - failedCommand = deleteTx(shellState.getWriter(), admin, zs, zk, managerLockPath, tableLocksPath, txids); + failedCommand = + deleteTx(shellState.getWriter(), admin, zs, zk, managerLockPath, tableLocksPath, txids); } else if (cl.hasOption(list.getOpt())) { printTx(shellState, admin, zs, zk, tableLocksPath, cl.getOptionValues(list.getOpt()), cl); } else if (cl.hasOption(print.getOpt())) { @@ -237,8 +238,8 @@ protected void printTx(Shell shellState, AdminUtil admin, ZooStore< } protected boolean deleteTx(PrintWriter out, AdminUtil admin, - ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, ServiceLockPath zTableLocksPath, String[] args) - throws InterruptedException, KeeperException { + ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, + ServiceLockPath zTableLocksPath, String[] args) throws InterruptedException, KeeperException { for (int i = 1; i < args.length; i++) { if (admin.prepDelete(zs, zk, zLockManagerPath, args[i])) { admin.deleteLocks(zk, zTableLocksPath, args[i]); diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java index b6e32f8a4a6..fc02a83d82a 100644 --- a/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java +++ b/shell/src/test/java/org/apache/accumulo/shell/commands/FateCommandTest.java @@ -99,8 +99,9 @@ String dumpTx(ZooStore zs, String[] args) { @Override protected boolean deleteTx(PrintWriter out, AdminUtil admin, - ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, ServiceLockPath zTableLocksPath, - String[] args) throws InterruptedException, KeeperException { + ZooStore zs, ZooReaderWriter zk, ServiceLockPath zLockManagerPath, + ServiceLockPath zTableLocksPath, String[] args) + throws InterruptedException, KeeperException { deleteCalled = true; return true; }