This is an automated email from the ASF dual-hosted git repository. andor pushed a commit to branch HBASE-29081_rebased in repository https://gitbox.apache.org/repos/asf/hbase.git
commit f7028b755bafc62bcf66636e99a07f0b4feb575f Author: Anuj Sharma <[email protected]> AuthorDate: Thu Dec 18 21:46:32 2025 +0530 HBASE-29778: Abort the retry operation if not allowed in read-only mode (#7554) * HBASE-29778: Abort the retry operation if not allowed in read-only mode Currenly, if we discover that the operation is not allowed in Read-Only Mode then we are sending exception, but the context does not get aborted leading to multiple same exceptions gets thrown. The real reason this is happening because we are sending IOException hence client retries same operation which is causing multiple similar exception. If we abort then it can lead to RS instability or corruption and using context.bypass will lead directly go to perform operation directly instead of aborting it, hence safer is to use DoNotRetryIOException. * Commit to rerun the job --- .../hbase/security/access/ReadOnlyController.java | 5 +- .../TestReadOnlyControllerBulkLoadObserver.java | 5 +- .../TestReadOnlyControllerEndpointObserver.java | 5 +- .../TestReadOnlyControllerMasterObserver.java | 99 +++++++++++----------- .../TestReadOnlyControllerRegionObserver.java | 69 +++++++-------- ...TestReadOnlyControllerRegionServerObserver.java | 9 +- 6 files changed, 99 insertions(+), 93 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java index 56de46b52d5..3ec772798be 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java @@ -27,6 +27,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.CoprocessorEnvironment; +import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.NamespaceDescriptor; @@ -99,9 +100,9 @@ public class ReadOnlyController implements MasterCoprocessor, RegionCoprocessor, private volatile boolean globalReadOnlyEnabled; - private void internalReadOnlyGuard() throws IOException { + private void internalReadOnlyGuard() throws DoNotRetryIOException { if (this.globalReadOnlyEnabled) { - throw new IOException("Operation not allowed in Read-Only Mode"); + throw new DoNotRetryIOException("Operation not allowed in Read-Only Mode"); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerBulkLoadObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerBulkLoadObserver.java index c17b2134432..598fd2fb8e1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerBulkLoadObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerBulkLoadObserver.java @@ -21,6 +21,7 @@ import static org.apache.hadoop.hbase.HConstants.HBASE_GLOBAL_READONLY_ENABLED_K import static org.mockito.Mockito.mock; import java.io.IOException; +import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -62,7 +63,7 @@ public class TestReadOnlyControllerBulkLoadObserver { } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPrePrepareBulkLoadReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.prePrepareBulkLoad(ctx); @@ -73,7 +74,7 @@ public class TestReadOnlyControllerBulkLoadObserver { readOnlyController.prePrepareBulkLoad(ctx); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCleanupBulkLoadReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCleanupBulkLoad(ctx); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerEndpointObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerEndpointObserver.java index b3562d8d3aa..344a02a4ecb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerEndpointObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerEndpointObserver.java @@ -21,6 +21,7 @@ import static org.apache.hadoop.hbase.HConstants.HBASE_GLOBAL_READONLY_ENABLED_K import static org.mockito.Mockito.mock; import java.io.IOException; +import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.coprocessor.ObserverContext; @@ -47,7 +48,7 @@ public class TestReadOnlyControllerEndpointObserver { ReadOnlyController readOnlyController; HBaseConfiguration readOnlyConf; - // Region Server Coprocessor mocking variables + // Region Server Coprocessor mocking variables. ObserverContext<? extends RegionCoprocessorEnvironment> ctx; Service service; String methodName; @@ -73,7 +74,7 @@ public class TestReadOnlyControllerEndpointObserver { } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreEndpointInvocationReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preEndpointInvocation(ctx, service, methodName, request); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerMasterObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerMasterObserver.java index 02fc9c77d5f..2d324f5827a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerMasterObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerMasterObserver.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Set; +import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.NamespaceDescriptor; @@ -149,7 +150,7 @@ public class TestReadOnlyControllerMasterObserver { } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCreateTableRegionsInfosReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCreateTableRegionsInfos(ctx, desc); @@ -160,7 +161,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preCreateTableRegionsInfos(ctx, desc); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCreateTableReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCreateTable(ctx, desc, regions); @@ -171,7 +172,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preCreateTable(ctx, desc, regions); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCreateTableActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCreateTableAction(ctx, desc, regions); @@ -182,7 +183,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preCreateTableAction(ctx, desc, regions); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDeleteTableReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDeleteTable(ctx, tableName); @@ -193,7 +194,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preDeleteTable(ctx, tableName); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDeleteTableActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDeleteTableAction(ctx, tableName); @@ -204,7 +205,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preDeleteTableAction(ctx, tableName); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreTruncateTableReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preTruncateTable(ctx, tableName); @@ -215,7 +216,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preTruncateTable(ctx, tableName); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreTruncateTableActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preTruncateTableAction(ctx, tableName); @@ -226,7 +227,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preTruncateTableAction(ctx, tableName); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreModifyTableReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preModifyTable(ctx, tableName, currentDescriptor, newDescriptor); @@ -237,7 +238,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preModifyTable(ctx, tableName, currentDescriptor, newDescriptor); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreModifyTableStoreFileTrackerReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preModifyTableStoreFileTracker(ctx, tableName, dstSFT); @@ -248,7 +249,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preModifyTableStoreFileTracker(ctx, tableName, dstSFT); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreModifyColumnFamilyStoreFileTrackerReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preModifyColumnFamilyStoreFileTracker(ctx, tableName, family, dstSFT); @@ -259,7 +260,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preModifyColumnFamilyStoreFileTracker(ctx, tableName, family, dstSFT); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreModifyTableActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preModifyTableAction(ctx, tableName, currentDescriptor, newDescriptor); @@ -270,7 +271,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preModifyTableAction(ctx, tableName, currentDescriptor, newDescriptor); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSplitRegionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSplitRegion(c, tableName, splitRow); @@ -281,7 +282,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSplitRegion(c, tableName, splitRow); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSplitRegionActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSplitRegionAction(c, tableName, splitRow); @@ -292,7 +293,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSplitRegionAction(c, tableName, splitRow); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSplitRegionBeforeMETAActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSplitRegionBeforeMETAAction(ctx, splitKey, metaEntries); @@ -303,7 +304,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSplitRegionBeforeMETAAction(ctx, splitKey, metaEntries); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSplitRegionAfterMETAActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSplitRegionAfterMETAAction(ctx); @@ -314,7 +315,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSplitRegionAfterMETAAction(ctx); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMergeRegionsActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMergeRegionsAction(ctx, regionsToMerge); @@ -325,7 +326,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMergeRegionsAction(ctx, regionsToMerge); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMergeRegionsCommitActionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMergeRegionsCommitAction(ctx, regionsToMerge, metaEntries); @@ -336,7 +337,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMergeRegionsCommitAction(ctx, regionsToMerge, metaEntries); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSnapshotReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSnapshot(ctx, snapshot, tableDescriptor); @@ -347,7 +348,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSnapshot(ctx, snapshot, tableDescriptor); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCloneSnapshotReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCloneSnapshot(ctx, snapshot, tableDescriptor); @@ -358,7 +359,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preCloneSnapshot(ctx, snapshot, tableDescriptor); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRestoreSnapshotReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRestoreSnapshot(ctx, snapshot, tableDescriptor); @@ -369,7 +370,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preRestoreSnapshot(ctx, snapshot, tableDescriptor); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDeleteSnapshotReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDeleteSnapshot(ctx, snapshot); @@ -380,7 +381,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preDeleteSnapshot(ctx, snapshot); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCreateNamespaceReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCreateNamespace(ctx, ns); @@ -391,7 +392,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preCreateNamespace(ctx, ns); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreModifyNamespaceReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preModifyNamespace(ctx, currentNsDescriptor, newNsDescriptor); @@ -402,7 +403,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preModifyNamespace(ctx, currentNsDescriptor, newNsDescriptor); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDeleteNamespaceReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDeleteNamespace(ctx, namespace); @@ -413,7 +414,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preDeleteNamespace(ctx, namespace); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMasterStoreFlushReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMasterStoreFlush(ctx); @@ -424,7 +425,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMasterStoreFlush(ctx); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSetUserQuotaReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSetUserQuota(ctx, userName, quotas); @@ -435,7 +436,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSetUserQuota(ctx, userName, quotas); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSetUserQuotaOnTableReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSetUserQuota(ctx, userName, tableName, quotas); @@ -446,7 +447,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSetUserQuota(ctx, userName, tableName, quotas); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSetUserQuotaOnNamespaceReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSetUserQuota(ctx, userName, namespace, quotas); @@ -457,7 +458,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSetUserQuota(ctx, userName, namespace, quotas); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSetTableQuotaReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSetTableQuota(ctx, tableName, quotas); @@ -468,7 +469,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSetTableQuota(ctx, tableName, quotas); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSetNamespaceQuotaReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSetNamespaceQuota(ctx, namespace, quotas); @@ -479,7 +480,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSetNamespaceQuota(ctx, namespace, quotas); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreSetRegionServerQuotaReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preSetRegionServerQuota(ctx, regionServer, quotas); @@ -490,7 +491,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preSetRegionServerQuota(ctx, regionServer, quotas); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMergeRegionsReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMergeRegions(ctx, regionsToMerge); @@ -501,7 +502,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMergeRegions(ctx, regionsToMerge); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMoveServersAndTablesReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMoveServersAndTables(ctx, servers, tables, targetGroup); @@ -512,7 +513,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMoveServersAndTables(ctx, servers, tables, targetGroup); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMoveServersReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMoveServers(ctx, servers, targetGroup); @@ -523,7 +524,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMoveServers(ctx, servers, targetGroup); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMoveTablesReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMoveTables(ctx, tables, targetGroup); @@ -534,7 +535,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preMoveTables(ctx, tables, targetGroup); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreAddRSGroupReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preAddRSGroup(ctx, name); @@ -545,7 +546,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preAddRSGroup(ctx, name); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRemoveRSGroupReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRemoveRSGroup(ctx, name); @@ -556,7 +557,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preRemoveRSGroup(ctx, name); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreBalanceRSGroupReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preBalanceRSGroup(ctx, groupName, request); @@ -567,7 +568,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preBalanceRSGroup(ctx, groupName, request); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRemoveServersReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRemoveServers(ctx, servers); @@ -578,7 +579,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preRemoveServers(ctx, servers); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRenameRSGroupReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRenameRSGroup(ctx, oldName, newName); @@ -589,7 +590,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preRenameRSGroup(ctx, oldName, newName); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreUpdateRSGroupConfigReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preUpdateRSGroupConfig(ctx, groupName, configuration); @@ -600,7 +601,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preUpdateRSGroupConfig(ctx, groupName, configuration); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreAddReplicationPeerReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preAddReplicationPeer(ctx, peerId, peerConfig); @@ -611,7 +612,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preAddReplicationPeer(ctx, peerId, peerConfig); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRemoveReplicationPeerReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRemoveReplicationPeer(ctx, peerId); @@ -622,7 +623,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preRemoveReplicationPeer(ctx, peerId); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreEnableReplicationPeerReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preEnableReplicationPeer(ctx, peerId); @@ -633,7 +634,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preEnableReplicationPeer(ctx, peerId); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDisableReplicationPeerReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDisableReplicationPeer(ctx, peerId); @@ -644,7 +645,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preDisableReplicationPeer(ctx, peerId); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreUpdateReplicationPeerConfigReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preUpdateReplicationPeerConfig(ctx, peerId, peerConfig); @@ -655,7 +656,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preUpdateReplicationPeerConfig(ctx, peerId, peerConfig); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreTransitReplicationPeerSyncReplicationStateReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); @@ -667,7 +668,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preTransitReplicationPeerSyncReplicationState(ctx, peerId, state); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreGrantReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preGrant(ctx, userPermission, mergeExistingPermissions); @@ -678,7 +679,7 @@ public class TestReadOnlyControllerMasterObserver { readOnlyController.preGrant(ctx, userPermission, mergeExistingPermissions); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRevokeReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRevoke(ctx, userPermission); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionObserver.java index 6bd02b62f58..12fe32c0d23 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionObserver.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CompareOperator; +import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.TableName; @@ -176,7 +177,7 @@ public class TestReadOnlyControllerRegionObserver { } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreFlushV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preFlush(c, flushLifeCycleTracker); @@ -187,7 +188,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preFlush(c, flushLifeCycleTracker); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreFlushV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preFlush(c, store, scanner, flushLifeCycleTracker); @@ -198,7 +199,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preFlush(c, store, scanner, flushLifeCycleTracker); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreFlushScannerOpenReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preFlushScannerOpen(c, store, options, flushLifeCycleTracker); @@ -209,7 +210,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preFlushScannerOpen(c, store, options, flushLifeCycleTracker); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMemStoreCompactionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMemStoreCompaction(c, store); @@ -220,7 +221,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preMemStoreCompaction(c, store); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMemStoreCompactionCompactScannerOpenReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMemStoreCompactionCompactScannerOpen(c, store, options); @@ -231,7 +232,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preMemStoreCompactionCompactScannerOpen(c, store, options); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreMemStoreCompactionCompactReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preMemStoreCompactionCompact(c, store, scanner); @@ -242,7 +243,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preMemStoreCompactionCompact(c, store, scanner); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCompactSelectionReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCompactSelection(c, store, candidates, compactionLifeCycleTracker); @@ -253,7 +254,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCompactSelection(c, store, candidates, compactionLifeCycleTracker); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCompactScannerOpenReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCompactScannerOpen(c, store, scanType, options, @@ -266,7 +267,7 @@ public class TestReadOnlyControllerRegionObserver { compactionLifeCycleTracker, compactionRequest); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCompactReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCompact(c, store, scanner, scanType, compactionLifeCycleTracker, @@ -279,7 +280,7 @@ public class TestReadOnlyControllerRegionObserver { compactionRequest); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPrePutV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.prePut(c, put, edit); @@ -290,7 +291,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.prePut(c, put, edit); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPrePutV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.prePut(c, put, edit, durability); @@ -301,7 +302,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.prePut(c, put, edit, durability); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDeleteV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDelete(c, delete, edit); @@ -312,7 +313,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preDelete(c, delete, edit); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreDeleteV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preDelete(c, delete, edit, durability); @@ -328,7 +329,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preBatchMutate(c, miniBatchOp); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndPutV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndPut(c, row, family, qualifier, op, comparator, put, result); @@ -339,7 +340,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndPut(c, row, family, qualifier, op, comparator, put, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndPutV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndPut(c, row, filter, put, result); @@ -350,7 +351,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndPut(c, row, filter, put, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndPutAfterRowLockV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndPutAfterRowLock(c, row, family, qualifier, op, comparator, put, @@ -363,7 +364,7 @@ public class TestReadOnlyControllerRegionObserver { result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndPutAfterRowLockV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndPutAfterRowLock(c, row, filter, put, result); @@ -374,7 +375,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndPutAfterRowLock(c, row, filter, put, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndDeleteV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndDelete(c, row, family, qualifier, op, comparator, delete, result); @@ -385,7 +386,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndDelete(c, row, family, qualifier, op, comparator, delete, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndDeleteV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndDelete(c, row, filter, delete, result); @@ -396,7 +397,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndDelete(c, row, filter, delete, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndDeleteAfterRowLockV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndDeleteAfterRowLock(c, row, family, qualifier, op, comparator, @@ -409,7 +410,7 @@ public class TestReadOnlyControllerRegionObserver { delete, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndDeleteAfterRowLockV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndDeleteAfterRowLock(c, row, filter, delete, result); @@ -420,13 +421,13 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndDeleteAfterRowLock(c, row, filter, delete, result); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreBatchMutateReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preBatchMutate(c, miniBatchOp); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndMutateReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndMutate(c, checkAndMutate, checkAndMutateResult); @@ -437,7 +438,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndMutate(c, checkAndMutate, checkAndMutateResult); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCheckAndMutateAfterRowLockReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCheckAndMutateAfterRowLock(c, checkAndMutate, checkAndMutateResult); @@ -448,7 +449,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCheckAndMutateAfterRowLock(c, checkAndMutate, checkAndMutateResult); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreAppendV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preAppend(c, append); @@ -459,7 +460,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preAppend(c, append); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreAppendV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preAppend(c, append, edit); @@ -470,7 +471,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preAppend(c, append, edit); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreAppendAfterRowLockReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preAppendAfterRowLock(c, append); @@ -481,7 +482,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preAppendAfterRowLock(c, append); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreIncrementV1ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preIncrement(c, increment); @@ -492,7 +493,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preIncrement(c, increment); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreIncrementV2ReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preIncrement(c, increment, edit); @@ -503,7 +504,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preIncrement(c, increment, edit); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreIncrementAfterRowLockReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preIncrementAfterRowLock(c, increment); @@ -514,7 +515,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preIncrementAfterRowLock(c, increment); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreReplayWALsReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preReplayWALs(ctx, info, edits); @@ -525,7 +526,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preReplayWALs(ctx, info, edits); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreBulkLoadHFileReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preBulkLoadHFile(ctx, familyPaths); @@ -536,7 +537,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preBulkLoadHFile(ctx, familyPaths); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreCommitStoreFileReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preCommitStoreFile(ctx, family, pairs); @@ -547,7 +548,7 @@ public class TestReadOnlyControllerRegionObserver { readOnlyController.preCommitStoreFile(ctx, family, pairs); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreWALAppendReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preWALAppend(ctx, key, edit); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionServerObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionServerObserver.java index 5d9d2561846..bb35232a636 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionServerObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionServerObserver.java @@ -21,6 +21,7 @@ import static org.apache.hadoop.hbase.HConstants.HBASE_GLOBAL_READONLY_ENABLED_K import static org.mockito.Mockito.mock; import java.io.IOException; +import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.client.Mutation; @@ -76,7 +77,7 @@ public class TestReadOnlyControllerRegionServerObserver { } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreRollWALWriterRequestReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preRollWALWriterRequest(ctx); @@ -87,7 +88,7 @@ public class TestReadOnlyControllerRegionServerObserver { readOnlyController.preRollWALWriterRequest(ctx); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreExecuteProceduresReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preExecuteProcedures(ctx); @@ -98,7 +99,7 @@ public class TestReadOnlyControllerRegionServerObserver { readOnlyController.preExecuteProcedures(ctx); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreReplicationSinkBatchMutateReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preReplicationSinkBatchMutate(ctx, walEntry, mutation); @@ -109,7 +110,7 @@ public class TestReadOnlyControllerRegionServerObserver { readOnlyController.preReplicationSinkBatchMutate(ctx, walEntry, mutation); } - @Test(expected = IOException.class) + @Test(expected = DoNotRetryIOException.class) public void testPreReplicateLogEntriesReadOnlyException() throws IOException { readOnlyController.onConfigurationChange(readOnlyConf); readOnlyController.preReplicateLogEntries(ctx);
