diff --git a/docs/_docs/persistence/change-data-capture.adoc b/docs/_docs/persistence/change-data-capture.adoc index a83e1eda2498d..c4499d74523a5 100644 --- a/docs/_docs/persistence/change-data-capture.adoc +++ b/docs/_docs/persistence/change-data-capture.adoc @@ -83,7 +83,8 @@ The distributed properties listed in the table below allow you to configure CDC |=== |Property | Description | Default Value |`cdc.disabled`| Disables CDC in the cluster to avoid disk overflow. Note that cache changes will be lost when CDC -is disabled. Useful if the CDC application is down for a long time. | false +is disabled. Useful if the CDC application is down for a long time. +See link:tools/control-script#working-with-cluster-properties[Working with Cluster Properties]. | false |=== == API @@ -207,6 +208,51 @@ The command will iterate over caches and writes primary copies of data entries t NOTE: There are no guarantees of notifying the CDC consumer on concurrent cache updates: use the `CdcEvent#version` to resolve version. +== Clear CDC directory + +Sometimes the CDC application has to start from scratch, for example, after a long CDC outage or when replication +is being set up again. In this case you can delete all WAL segment links and the CDC application state from the CDC +directory. + +NOTE: Use the link:#handling-skipped-segments[`--cdc delete_lost_segment_links`] command if the CDC application fails +because of skipped segments. Use the `--cdc clear` command to drop all the accumulated changes and the CDC application +state. + +WARNING: All changes in deleted segment links will be lost! + +To clear the CDC directory, follow the steps below. Steps 3–5 are required only if changes must be captured after +clearing. + + 1. Shut down the CDC application. The command fails if the CDC directory is locked by the running application. + 2. Run the following link:tools/control-script[Control Script] command: ++ +[source,shell] +---- +# Clear CDC directories on all server nodes. +control.sh|bat --cdc clear + +# Clear CDC directory on a node. +control.sh|bat --cdc clear --node-id node_id + +# Clear CDC directories completely, including the CDC mode state. +control.sh|bat --cdc clear --reset-mode +---- ++ +If the command fails, fix the reported error and run it again. Do not start the CDC application until the command +succeeds. + 3. If the command was run with `--reset-mode`, restart the cleared Ignite nodes with CDC enabled (before the restart, +make sure the `cdc.disabled` distributed property is set to `false`). Without the restart, the CDC application does not +capture changes. + 4. Start the CDC application. + 5. Synchronize data with the destination (e.g. a remote cluster), because changes in the cleared segment links are not +transmitted. Use the link:#forcefully-resend-all-cache-data-to-cdc[resend command], a snapshot or other methods. + +NOTE: There is no need to disable CDC with the `cdc.disabled` distributed property before clearing. Segment links +created after clearing are kept, and the CDC application consumes them after start. + +NOTE: The command clears CDC directories only on the server nodes that are in the topology. CDC directories of offline +nodes are not cleared. After such a node joins the cluster, clear its CDC directory with the `--node-id` argument. + == cdc-ext Ignite extensions project has link:https://github.com/apache/ignite-extensions/tree/master/modules/cdc-ext[cdc-ext] module which provides two way to setup cross cluster replication based on CDC. diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/CdcCommandTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/CdcCommandTest.java index 241b3adc51eeb..67c2d0dcc9c3d 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/CdcCommandTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/CdcCommandTest.java @@ -19,6 +19,7 @@ import java.io.File; import java.io.Serializable; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -86,6 +87,12 @@ public class CdcCommandTest extends GridCommandHandlerAbstractTest { /** */ public static final String RESEND = "resend"; + /** */ + public static final String CLEAR = "clear"; + + /** */ + public static final String RESET_MODE = "--reset-mode"; + /** */ private IgniteEx srv0; @@ -524,6 +531,249 @@ public void testResendOnClientJoin() throws Exception { waitForSize(cnsmr1, srv1.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.PRIMARY)); } + /** */ + @Test + public void testCdcClearOnAllNodes() throws Exception { + injectTestSystemOut(); + + prepareForClear(); + + // Temporary mode state can remain if the CDC application failed while saving it. + File tmpModeState = fileTree(0).tmpCdcModeState().toFile(); + + assertTrue(tmpModeState.createNewFile()); + + File[] links0 = cdcLinks(0); + File[] links1 = cdcLinks(1); + + assertContains(log, executeCommand(EXIT_CODE_OK, CDC, CLEAR), "CDC directories were successfully cleared."); + + checkCdcCleared(0, links0, true); + checkCdcCleared(1, links1, true); + } + + /** */ + @Test + public void testCdcClearOnOneNode() throws Exception { + injectTestSystemOut(); + + prepareForClear(); + + File[] links0 = cdcLinks(0); + File[] links1 = cdcLinks(1); + + assertContains(log, executeCommand(EXIT_CODE_OK, CDC, CLEAR, NODE_ID, grid(1).localNode().id().toString()), + "CDC directories were successfully cleared."); + + for (File link : links0) + assertTrue("Segment link is deleted: " + link, link.exists()); + + checkCdcNotCleared(0, 2); + checkCdcCleared(1, links1, true); + } + + /** */ + @Test + public void testCdcClearOnClientNode() throws Exception { + injectTestSystemOut(); + + IgniteEx client = startClientGrid("client"); + + assertContains(log, + executeCommand(EXIT_CODE_INVALID_ARGUMENTS, CDC, CLEAR, NODE_ID, client.localNode().id().toString()), + "Client nodes do not support CDC clear command."); + } + + /** */ + @Test + public void testCdcClearWithResetMode() throws Exception { + injectTestSystemOut(); + + prepareForClear(); + + File[] links0 = cdcLinks(0); + File[] links1 = cdcLinks(1); + + assertContains(log, executeCommand(EXIT_CODE_OK, CDC, CLEAR, RESET_MODE), + "CDC directories were successfully cleared."); + + checkCdcCleared(0, links0, false); + checkCdcCleared(1, links1, false); + } + + /** */ + @Test + public void testCdcClearWithLockAcquire() throws Exception { + injectTestSystemOut(); + + runCdc(grid(0)); + + archiveSegment(); + + waitForCdcState(0); + + File[] links1 = cdcLinks(1); + + assertTrue(links1.length > 0); + + assertContains(log, executeCommand(EXIT_CODE_UNEXPECTED_ERROR, CDC, CLEAR), + "Unable to acquire lock to the CDC folder. Make sure a CDC app is shut down"); + + checkCdcNotCleared(0, 1); + checkCdcCleared(1, links1, true); + + stopThreads(log); + + File[] links0 = cdcLinks(0); + + links1 = cdcLinks(1); + + assertContains(log, executeCommand(EXIT_CODE_OK, CDC, CLEAR), "CDC directories were successfully cleared."); + + checkCdcCleared(0, links0, true); + checkCdcCleared(1, links1, true); + } + + /** + * Checks that the CDC application captures changes after the CDC directory is cleared. The CDC application is not + * started on the second node before clear, so its CDC mode is not saved. + */ + @Test + public void testCdcCapturesChangesAfterClear() throws Exception { + injectTestSystemOut(); + + prepareForClear(false); + + assertFalse(fileTree(1).cdcModeState().toFile().exists()); + + assertContains(log, executeCommand(EXIT_CODE_OK, CDC, CLEAR), "CDC directories were successfully cleared."); + + UserCdcConsumer cnsmr0 = runCdc(grid(0)); + UserCdcConsumer cnsmr1 = runCdc(grid(1)); + + addData(grid(0).cache(DEFAULT_CACHE_NAME), KEYS_CNT, 2 * KEYS_CNT); + + checkPrimaryKeysCaptured(grid(0), cnsmr0, KEYS_CNT, 2 * KEYS_CNT); + checkPrimaryKeysCaptured(grid(1), cnsmr1, KEYS_CNT, 2 * KEYS_CNT); + } + + /** + * @param srv Server node. + * @param cnsmr CDC consumer of the node. + * @param from First key, inclusive. + * @param to Last key, exclusive. + */ + private void checkPrimaryKeysCaptured(IgniteEx srv, UserCdcConsumer cnsmr, int from, int to) throws Exception { + List expKeys = new ArrayList<>(); + + for (int key = from; key < to; key++) { + if (srv.affinity(DEFAULT_CACHE_NAME).isPrimary(srv.localNode(), key)) + expKeys.add(key); + } + + assertFalse(expKeys.isEmpty()); + + assertTrue(waitForCondition(() -> cnsmr.data(UPDATE, CU.cacheId(DEFAULT_CACHE_NAME)).containsAll(expKeys), + getTestTimeout())); + } + + /** */ + private void prepareForClear() throws Exception { + prepareForClear(true); + } + + /** @param runCdcOnSecondNode Whether to run the CDC application on the second node. */ + private void prepareForClear(boolean runCdcOnSecondNode) throws Exception { + for (int i = 0; i < 2; i++) { + NodeFileTree ft = fileTree(i); + + assertEquals(0, ft.walCdcSegments().length); + assertFalse(ft.cdcState().toFile().exists()); + } + + runCdc(grid(0)); + + if (runCdcOnSecondNode) + runCdc(grid(1)); + + archiveSegment(); + + waitForCdcState(0); + + if (runCdcOnSecondNode) + waitForCdcState(1); + + stopThreads(log); + + // Segments archived after CDC applications stop are not processed and not deleted. + archiveSegment(); + archiveSegment(); + + checkCdcNotCleared(0, 2); + + if (runCdcOnSecondNode) + checkCdcNotCleared(1, 2); + } + + /** @param idx Node index. */ + private void waitForCdcState(int idx) throws Exception { + NodeFileTree ft = fileTree(idx); + + assertTrue(waitForCondition(() -> ft.cdcWalState().toFile().exists(), getTestTimeout())); + } + + /** + * @param idx Node index. + * @param minSegCnt Minimal expected count of segment links. + */ + private void checkCdcNotCleared(int idx, int minSegCnt) throws Exception { + NodeFileTree ft = fileTree(idx); + + assertTrue(waitForCondition(() -> ft.walCdcSegments().length >= minSegCnt, getTestTimeout())); + assertTrue(ft.cdcWalState().toFile().exists()); + assertTrue(ft.cdcModeState().toFile().exists()); + } + + /** + * @param idx Node index. + * @return CDC segment links of the node. + */ + private File[] cdcLinks(int idx) { + return fileTree(idx).walCdcSegments(); + } + + /** + * @param idx Node index. + * @return File tree of the node. + */ + private NodeFileTree fileTree(int idx) { + return grid(idx).context().pdsFolderResolver().fileTree(); + } + + /** + * Checks that the CDC directory is cleared. Links created after clearing are kept, because CDC is enabled and + * segments can be archived by timeout. + * + * @param idx Node index. + * @param links Segment links existed before clearing. + * @param modeExists Whether CDC mode state is expected to exist. + */ + private void checkCdcCleared(int idx, File[] links, boolean modeExists) { + NodeFileTree ft = fileTree(idx); + + for (File link : links) + assertFalse("Segment link is not deleted: " + link, link.exists()); + + assertEquals(modeExists, ft.cdcState().toFile().exists()); + + if (modeExists) { + File[] stateFiles = ft.cdcState().toFile().listFiles(); + + assertEquals("Only CDC mode state is expected", 1, stateFiles.length); + assertEquals("Unexpected state file", ft.cdcModeState().toFile(), stateFiles[0]); + } + } + /** */ public static UserCdcConsumer runCdc(Ignite ign) { UserCdcConsumer cnsmr = new UserCdcConsumer(); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearCommand.java b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearCommand.java new file mode 100644 index 0000000000000..293b78cd4c470 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearCommand.java @@ -0,0 +1,82 @@ +/* + * 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.cdc; + +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.management.api.ComputeCommand; + +import static org.apache.ignite.internal.management.api.CommandUtils.node; +import static org.apache.ignite.internal.management.api.CommandUtils.servers; + +/** Command to clear CDC directory. */ +public class CdcClearCommand implements ComputeCommand { + /** {@inheritDoc} */ + @Override public String description() { + return "Clear CDC directory: delete WAL segment links and CDC application state"; + } + + /** {@inheritDoc} */ + @Override public Class argClass() { + return CdcClearCommandArg.class; + } + + /** {@inheritDoc} */ + @Override public Class taskClass() { + return CdcClearTask.class; + } + + /** {@inheritDoc} */ + @Override public Collection nodes(Collection nodes, CdcClearCommandArg arg) { + if (arg.nodeId() == null) + return servers(nodes); + + List node = node(arg.nodeId(), nodes); + + if (node.get(0).isClient()) + throw new IllegalArgumentException("You specified a client node id. " + + "Client nodes do not support CDC clear command."); + + return node; + } + + /** {@inheritDoc} */ + @Override public void printResult(CdcClearCommandArg arg, Void res, Consumer printer) { + printer.accept("CDC directories were successfully cleared."); + } + + /** {@inheritDoc} */ + @Override public String confirmationPrompt(CdcClearCommandArg arg) { + String prompt = """ + Warning: The command will delete all WAL segment links and CDC application state from the CDC directory. + The CDC application must be shut down. + All changes in deleted segment links will be lost! + To synchronize data after clearing, use the '--cdc resend' command, a snapshot or other methods."""; + + if (arg.resetMode()) { + prompt += """ + + CDC mode state will be deleted too. The CDC application will not capture changes \ + until Ignite nodes are restarted."""; + } + + return prompt; + } +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearCommandArg.java b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearCommandArg.java new file mode 100644 index 0000000000000..f977645cb0002 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearCommandArg.java @@ -0,0 +1,63 @@ +/* + * 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.cdc; + +import java.util.UUID; +import org.apache.ignite.internal.Order; +import org.apache.ignite.internal.dto.IgniteDataTransferObject; +import org.apache.ignite.internal.management.api.Argument; +import org.apache.ignite.internal.management.api.CliConfirmArgument; + +/** */ +@CliConfirmArgument +public class CdcClearCommandArg extends IgniteDataTransferObject { + /** */ + private static final long serialVersionUID = 0; + + /** */ + @Order(0) + @Argument(optional = true, description = "ID of the node to clear CDC directory from. " + + "If not set, the command will affect all server nodes") + UUID nodeId; + + /** */ + @Order(1) + @Argument(optional = true, description = "Also delete the CDC mode state. The CDC application will not " + + "capture changes until Ignite nodes are restarted") + boolean resetMode; + + /** */ + public UUID nodeId() { + return nodeId; + } + + /** */ + public void nodeId(UUID nodeId) { + this.nodeId = nodeId; + } + + /** */ + public boolean resetMode() { + return resetMode; + } + + /** */ + public void resetMode(boolean resetMode) { + this.resetMode = resetMode; + } +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearTask.java b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearTask.java new file mode 100644 index 0000000000000..5d66fe561f77d --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcClearTask.java @@ -0,0 +1,168 @@ +/* + * 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.cdc; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.IgniteException; +import org.apache.ignite.IgniteLogger; +import org.apache.ignite.compute.ComputeJobResult; +import org.apache.ignite.internal.cdc.CdcConsumerState; +import org.apache.ignite.internal.cdc.CdcFileLockHolder; +import org.apache.ignite.internal.cdc.CdcMode; +import org.apache.ignite.internal.cdc.CdcUtilityActiveCdcManager; +import org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree; +import org.apache.ignite.internal.processors.task.GridInternal; +import org.apache.ignite.internal.util.typedef.internal.CU; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.internal.visor.VisorJob; +import org.apache.ignite.internal.visor.VisorMultiNodeTask; +import org.apache.ignite.resources.LoggerResource; +import org.jetbrains.annotations.Nullable; + +/** Task to clear CDC directory. */ +@GridInternal +public class CdcClearTask extends VisorMultiNodeTask { + /** */ + private static final long serialVersionUID = 0L; + + /** {@inheritDoc} */ + @Override protected VisorJob job(CdcClearCommandArg arg) { + return new CdcClearJob(arg, false); + } + + /** {@inheritDoc} */ + @Override protected @Nullable Void reduce0(List results) throws IgniteException { + for (ComputeJobResult res : results) { + if (res.getException() != null) { + throw new IgniteException("Failed to clear CDC directory on a node " + + "[nodeId=" + res.getNode().id() + "]. The command can be rerun after fixing the error.", + res.getException()); + } + } + + return null; + } + + /** */ + private static class CdcClearJob extends VisorJob { + /** */ + private static final long serialVersionUID = 0L; + + /** */ + @LoggerResource + protected IgniteLogger log; + + /** */ + protected CdcClearJob(CdcClearCommandArg arg, boolean debug) { + super(arg, debug); + } + + /** {@inheritDoc} */ + @Override protected Void run(CdcClearCommandArg arg) throws IgniteException { + if (!CU.isCdcEnabled(ignite.configuration())) + throw new IgniteException("CDC is not configured."); + + NodeFileTree ft = ignite.context().pdsFolderResolver().fileTree(); + + CdcFileLockHolder lock = new CdcFileLockHolder(ft.walCdc().getAbsolutePath(), "Clear CDC job", log); + + try { + lock.tryLock(1); + + // Links go first, in ascending order: on partial failure the remaining links follow the kept WAL state, + // so the CDC application fails on start instead of consuming them. + File[] links = ft.walCdcSegments(); + + Arrays.sort(links, Comparator.comparingLong(link -> ft.walSegmentIndex(link.toPath()))); + + for (File link : links) + Files.delete(link.toPath()); + + if (arg.resetMode()) { + if (Files.exists(ft.cdcState()) && !U.delete(ft.cdcState())) + throw new IgniteException("Failed to delete CDC state directory [dir=" + ft.cdcState() + ']'); + } + else { + deleteStateExceptMode(ft); + saveUtilityActiveModeIfAbsent(ft); + } + + log.info("CDC directory cleared [dir=" + ft.walCdc().getAbsolutePath() + + ", deletedLinksCnt=" + links.length + ']'); + + return null; + } + catch (IgniteCheckedException e) { + throw new IgniteException("Failed to clear CDC directory. " + + "Unable to acquire lock to the CDC folder. Make sure a CDC app is shut down " + + "[dir=" + ft.walCdc().getAbsolutePath() + ", reason=" + e.getMessage() + ']', e); + } + catch (IOException e) { + throw new IgniteException("Failed to clear CDC directory " + + "[dir=" + ft.walCdc().getAbsolutePath() + ']', e); + } + finally { + U.closeQuiet(lock); + } + } + + /** + * Deletes CDC application state except the mode, otherwise the application waits for + * {@code CdcManagerStopRecord}, which is not logged again. + * + * @param ft Node file tree. + */ + private void deleteStateExceptMode(NodeFileTree ft) throws IOException { + // Including temporary files left after a failed save. + List stateFiles = List.of( + ft.cdcWalState(), ft.tmpCdcWalState(), + ft.cdcCachesState(), ft.tmpCdcCachesState(), + ft.cdcMappingsState(), ft.tmpCdcMappingsState(), + ft.cdcTypesState(), ft.tmpCdcTypesState(), + ft.tmpCdcModeState()); + + for (Path file : stateFiles) + Files.deleteIfExists(file); + } + + /** + * Saves {@link CdcMode#CDC_UTILITY_ACTIVE} for the default CDC manager if the mode is absent: + * {@code CdcManagerStopRecord} is logged once on node start and may be in a deleted link. + * + * @param ft Node file tree. + */ + private void saveUtilityActiveModeIfAbsent(NodeFileTree ft) throws IOException { + boolean dfltMgr = ignite.context().cache().context().cdc() instanceof CdcUtilityActiveCdcManager; + + if (!dfltMgr || Files.exists(ft.cdcModeState())) + return; + + // Absent if the CDC application has never started. + Files.createDirectories(ft.cdcState()); + + new CdcConsumerState(log, ft).saveCdcMode(CdcMode.CDC_UTILITY_ACTIVE); + } + } +} diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcCommand.java b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcCommand.java index a1ce8eb457b23..79685964bc4f5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcCommand.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcCommand.java @@ -25,7 +25,8 @@ public class CdcCommand extends CommandRegistryImpl { public CdcCommand() { super( new CdcDeleteLostSegmentLinksCommand(), - new CdcResendCommand() + new CdcResendCommand(), + new CdcClearCommand() ); } } diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties index b55a003c2de0e..7c88197e9162a 100644 --- a/modules/core/src/main/resources/META-INF/classnames.properties +++ b/modules/core/src/main/resources/META-INF/classnames.properties @@ -516,6 +516,9 @@ org.apache.ignite.internal.management.cache.scan.CacheScanTask$CacheScanJob org.apache.ignite.internal.management.cache.scan.CacheScanTaskResult org.apache.ignite.internal.management.cdc.CdcCacheDataResendTask org.apache.ignite.internal.management.cdc.CdcCacheDataResendTask$CdcCacheDataResendJob +org.apache.ignite.internal.management.cdc.CdcClearCommandArg +org.apache.ignite.internal.management.cdc.CdcClearTask +org.apache.ignite.internal.management.cdc.CdcClearTask$CdcClearJob org.apache.ignite.internal.management.cdc.CdcDeleteLostSegmentLinksCommandArg org.apache.ignite.internal.management.cdc.CdcDeleteLostSegmentsTask org.apache.ignite.internal.management.cdc.CdcDeleteLostSegmentsTask$CdcDeleteLostSegmentsJob diff --git a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_help.output b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_help.output index 91fead434ad99..487e903155c35 100644 --- a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_help.output +++ b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_help.output @@ -430,6 +430,13 @@ If the file name isn't specified the output file name is: '.bin': Parameters: --caches cache1,...,cacheN - specifies a comma-separated list of cache names. + Clear CDC directory: delete WAL segment links and CDC application state: + control.(sh|bat) --cdc clear [--node-id node_id] [--reset-mode] [--yes] + + Parameters: + --node-id node_id - ID of the node to clear CDC directory from. If not set, the command will affect all server nodes. + --reset-mode - Also delete the CDC mode state. The CDC application will not capture changes until Ignite nodes are restarted. + [EXPERIMENTAL] Check/Repair cache consistency using Read Repair approach: control.(sh|bat) --consistency repair --cache cache --partitions partition --strategy LWW|PRIMARY|RELATIVE_MAJORITY|REMOVE|CHECK_ONLY [--parallel] diff --git a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_help.output b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_help.output index 158f8d3b5f4f0..075f716afebcd 100644 --- a/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_help.output +++ b/modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_help.output @@ -430,6 +430,13 @@ If the file name isn't specified the output file name is: '.bin': Parameters: --caches cache1,...,cacheN - specifies a comma-separated list of cache names. + Clear CDC directory: delete WAL segment links and CDC application state: + control.(sh|bat) --cdc clear [--node-id node_id] [--reset-mode] [--yes] + + Parameters: + --node-id node_id - ID of the node to clear CDC directory from. If not set, the command will affect all server nodes. + --reset-mode - Also delete the CDC mode state. The CDC application will not capture changes until Ignite nodes are restarted. + [EXPERIMENTAL] Check/Repair cache consistency using Read Repair approach: control.(sh|bat) --consistency repair --cache cache --partitions partition --strategy LWW|PRIMARY|RELATIVE_MAJORITY|REMOVE|CHECK_ONLY [--parallel]