timoninmaxim commented on code in PR #12494: URL: https://github.com/apache/ignite/pull/12494#discussion_r2498060891
########## modules/core/src/main/java/org/apache/ignite/internal/management/rollingupgrade/RollingUpgradeDisableCommand.java: ########## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.management.rollingupgrade; + +import java.util.Collection; +import java.util.function.Consumer; +import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.management.api.ComputeCommand; +import org.apache.ignite.internal.management.api.NoArg; +import org.apache.ignite.lang.IgniteExperimental; + +import static org.apache.ignite.internal.management.api.CommandUtils.coordinatorOrNull; + +/** Command to disable rolling upgrade mode. */ +@IgniteExperimental +public class RollingUpgradeDisableCommand implements ComputeCommand<NoArg, RollingUpgradeTaskResult> { + /** {@inheritDoc} */ + @Override public String description() { + return "Disable rolling upgrade"; Review Comment: Let's mention that all nodes in cluster must be the same version. ########## modules/core/src/main/java/org/apache/ignite/internal/management/rollingupgrade/RollingUpgradeTaskResult.java: ########## @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.management.rollingupgrade; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.internal.dto.IgniteDataTransferObject; +import org.apache.ignite.internal.util.lang.IgnitePair; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.lang.IgniteProductVersion; + +/** */ +public class RollingUpgradeTaskResult extends IgniteDataTransferObject { + /** */ + private static final long serialVersionUID = 0L; + + /** */ + private boolean enabled; + + /** */ + private IgnitePair<IgniteProductVersion> rollUpVers; + + /** */ + private Throwable exception; Review Comment: User should not receive full exception with internal ignite stacktrace. Let's send only exception message instead. ########## modules/core/src/main/java/org/apache/ignite/internal/management/rollingupgrade/RollingUpgradeEnableCommand.java: ########## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.management.rollingupgrade; + +import java.util.Collection; +import java.util.function.Consumer; +import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.management.api.ComputeCommand; +import org.apache.ignite.lang.IgniteExperimental; + +import static org.apache.ignite.internal.management.api.CommandUtils.coordinatorOrNull; + +/** Command to enable rolling upgrade. */ +@IgniteExperimental +public class RollingUpgradeEnableCommand implements ComputeCommand<RollingUpgradeEnableCommandArg, RollingUpgradeTaskResult> { Review Comment: Let's also add a confirmation prompt, also let's write it in description and javadocs. "This command enables rolling upgrade mode. It allows cluster with mixed-version nodes. You are responsible for upgrading nodes manually. This mode can be disabled only when all nodes (including client nodes) run the same version." ########## modules/core/src/main/java/org/apache/ignite/internal/management/rollingupgrade/RollingUpgradeTaskResult.java: ########## @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.management.rollingupgrade; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.internal.dto.IgniteDataTransferObject; +import org.apache.ignite.internal.util.lang.IgnitePair; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.lang.IgniteProductVersion; + +/** */ +public class RollingUpgradeTaskResult extends IgniteDataTransferObject { + /** */ + private static final long serialVersionUID = 0L; + + /** */ + private boolean enabled; + + /** */ + private IgnitePair<IgniteProductVersion> rollUpVers; Review Comment: IgnitePair is an internal class. Should not escaped to control.sh. ########## modules/core/src/main/java/org/apache/ignite/internal/management/rollingupgrade/RollingUpgradeEnableCommandArg.java: ########## @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.management.rollingupgrade; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.internal.dto.IgniteDataTransferObject; +import org.apache.ignite.internal.management.api.Argument; +import org.apache.ignite.internal.util.typedef.internal.U; + +/** Rolling upgrade enable command argument. */ +public class RollingUpgradeEnableCommandArg extends IgniteDataTransferObject { + /** */ + private static final long serialVersionUID = 0; + + /** Target version. */ + @Argument(description = "Target Ignite version", example = "2.18.0") Review Comment: Should be positional. ########## modules/core/src/main/java/org/apache/ignite/internal/management/rollingupgrade/RollingUpgradeTaskResult.java: ########## @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.management.rollingupgrade; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import org.apache.ignite.internal.dto.IgniteDataTransferObject; +import org.apache.ignite.internal.util.lang.IgnitePair; +import org.apache.ignite.internal.util.typedef.internal.S; +import org.apache.ignite.lang.IgniteProductVersion; + +/** */ +public class RollingUpgradeTaskResult extends IgniteDataTransferObject { + /** */ + private static final long serialVersionUID = 0L; + + /** */ + private boolean enabled; + + /** */ + private IgnitePair<IgniteProductVersion> rollUpVers; + + /** */ + private Throwable exception; + + /** */ + public RollingUpgradeTaskResult(boolean enabled, IgnitePair<IgniteProductVersion> rollUpVers, Throwable exception) { + this.enabled = enabled; + this.exception = exception; + this.rollUpVers = rollUpVers; + } + + /** */ + public RollingUpgradeTaskResult() { + // No-op. + } + + /** */ + public boolean enabled() { Review Comment: Used in tests only. -- 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]
