alex-plekhanov commented on code in PR #10328:
URL: https://github.com/apache/ignite/pull/10328#discussion_r1161682134
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java:
##########
@@ -83,6 +83,11 @@ public class VerifyBackupPartitionsTaskV2 extends
ComputeTaskAdapter<VisorIdleVe
/** First version of Ignite that is capable of executing Idle Verify V2. */
public static final IgniteProductVersion V2_SINCE_VER =
IgniteProductVersion.fromString("2.5.3");
+ /** Error thrown when idle_verify is called on an inactive cluster with
persistence. */
+ public static final String IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE =
"Can not perform the operation because " +
+ "the cluster is inactive and data regions are persistent. To activate
the cluster call " +
Review Comment:
IMO 'and data regions are persistent' is confusing here. It's just a corner
case and we will still get the same message if cluster is not persistent and
not activated.
##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/cache/IdleVerify.java:
##########
@@ -341,6 +343,15 @@ private void cacheIdleVerifyV2(
if (F.isEmpty(res.exceptions()))
return;
+ Optional<Exception> inactiveE = res.exceptions().values()
+ .stream()
+ .filter(e -> X.hasCause(e,
VerifyBackupPartitionsTaskV2.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE,
+ IgniteException.class))
+ .findFirst();
+
+ if (inactiveE.isPresent())
+ throw new IllegalStateException(inactiveE.get().getMessage());
Review Comment:
Why only this particular exception treated as "illegal state", but other
exceptions printed to "idle-verify...txt" file?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java:
##########
@@ -83,6 +83,11 @@ public class VerifyBackupPartitionsTaskV2 extends
ComputeTaskAdapter<VisorIdleVe
/** First version of Ignite that is capable of executing Idle Verify V2. */
public static final IgniteProductVersion V2_SINCE_VER =
IgniteProductVersion.fromString("2.5.3");
+ /** Error thrown when idle_verify is called on an inactive cluster with
persistence. */
+ public static final String IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE =
"Can not perform the operation because " +
+ "the cluster is inactive and data regions are persistent. To activate
the cluster call " +
+ "Ignite.cluster().state(ClusterState.ACTIVE).";
Review Comment:
This is control-utility command message, recomendation to use java code
looks inappropriate here.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java:
##########
@@ -83,6 +83,11 @@ public class VerifyBackupPartitionsTaskV2 extends
ComputeTaskAdapter<VisorIdleVe
/** First version of Ignite that is capable of executing Idle Verify V2. */
public static final IgniteProductVersion V2_SINCE_VER =
IgniteProductVersion.fromString("2.5.3");
+ /** Error thrown when idle_verify is called on an inactive cluster with
persistence. */
+ public static final String IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE =
"Can not perform the operation because " +
Review Comment:
'Can not' -> 'Cannot'?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]