Skip to content

Commit

Permalink
IGNITE-24084 Remove VerifyBackupPartitionsTaskV2#V2_SINCE_VER (#11788)
Browse files Browse the repository at this point in the history
* IGNITE-24084 Remove VerifyBackupPartitionsTaskV2#V2_SINCE_VER

* IGNITE-24084 Remove VerifyBackupPartitionsTaskV2#V2_SINCE_VER

* IGNITE-24084 Remove V2 related code

* IGNITE-24084 Resolve conflicts
  • Loading branch information
maksaska authored Jan 13, 2025
1 parent a5d2b4e commit 33315e7
Show file tree
Hide file tree
Showing 29 changed files with 121 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.GridKernalContextImpl;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.management.cache.IdleVerifyResultV2;
import org.apache.ignite.internal.management.cache.IdleVerifyResult;
import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
import org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIO;
import org.apache.ignite.internal.processors.compress.CompressionProcessor;
Expand Down Expand Up @@ -336,7 +336,7 @@ protected void createTestSnapshot() throws Exception {
for (String snpName : Arrays.asList(SNAPSHOT_WITH_HOLES, SNAPSHOT_WITHOUT_HOLES)) {
snp(ignite).createSnapshot(snpName, null, false, onlyPrimary).get(TIMEOUT);

IdleVerifyResultV2 res = ignite.context().cache().context().snapshotMgr().checkSnapshot(snpName, null)
IdleVerifyResult res = ignite.context().cache().context().snapshotMgr().checkSnapshot(snpName, null)
.get().idleVerifyResult();

StringBuilder b = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
import org.apache.ignite.internal.management.cache.IdleVerifyResultV2;
import org.apache.ignite.internal.management.cache.IdleVerifyResult;
import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
import org.apache.ignite.internal.pagemem.wal.record.DataRecord;
import org.apache.ignite.internal.pagemem.wal.record.TxRecord;
Expand Down Expand Up @@ -378,7 +378,7 @@ public void atomicCachesAreSkippedDuringTheCheck() throws Exception {

grid(0).snapshot().restoreSnapshot(atomicSnp, null, 1).get();

IdleVerifyResultV2 idleVerRes = idleVerify(grid(0), CACHE, atomicCache);
IdleVerifyResult idleVerRes = idleVerify(grid(0), CACHE, atomicCache);

idleVerRes.print(System.out::println, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.apache.ignite.events.EventType;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.management.cache.IdleVerifyTaskV2;
import org.apache.ignite.internal.management.cache.IdleVerifyTask;
import org.apache.ignite.internal.management.cache.ValidateIndexesClosure;
import org.apache.ignite.internal.management.cache.ValidateIndexesTask;
import org.apache.ignite.internal.util.typedef.internal.S;
Expand All @@ -57,7 +57,7 @@ public class GridCommandHandlerInterruptCommandTest extends GridCommandHandlerAb
private static final int LOAD_LOOP = 500_000;

/** Idle verify task name. */
private static final String IDLE_VERIFY_TASK_V2 = IdleVerifyTaskV2.class.getName();
private static final String IDLE_VERIFY_TASK = IdleVerifyTask.class.getName();

/** Validate index task name. */
private static final String VALIDATE_INDEX_TASK = ValidateIndexesTask.class.getName();
Expand Down Expand Up @@ -234,7 +234,7 @@ public void testIdleVerifyCommand() throws Exception {

preloadeData(ignite);

CountDownLatch startTaskLatch = waitForTaskEvent(ignite, IDLE_VERIFY_TASK_V2);
CountDownLatch startTaskLatch = waitForTaskEvent(ignite, IDLE_VERIFY_TASK);

LogListener lnsrValidationCancelled = LogListener.matches("The check procedure was cancelled.").build();
LogListener lnsrIdleVerifyStart = LogListener.matches("Idle verify procedure has started").build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
import org.apache.ignite.internal.client.util.GridConcurrentHashSet;
import org.apache.ignite.internal.management.cache.FindAndDeleteGarbageInPersistenceTaskResult;
import org.apache.ignite.internal.management.cache.IdleVerifyDumpTask;
import org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTaskV2;
import org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTask;
import org.apache.ignite.internal.management.tx.TxInfo;
import org.apache.ignite.internal.management.tx.TxTaskResult;
import org.apache.ignite.internal.managers.communication.GridIoMessage;
Expand Down Expand Up @@ -172,8 +172,8 @@
import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_UNEXPECTED_ERROR;
import static org.apache.ignite.internal.encryption.AbstractEncryptionTest.MASTER_KEY_NAME_2;
import static org.apache.ignite.internal.management.cache.CacheIdleVerifyCancelTask.TASKS_TO_CANCEL;
import static org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTaskV2.CACL_PART_HASH_ERR_MSG;
import static org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTaskV2.CP_REASON;
import static org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTask.CACL_PART_HASH_ERR_MSG;
import static org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTask.CP_REASON;
import static org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP;
import static org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.doSnapshotCancellationTest;
import static org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotSelfTest.snp;
Expand Down Expand Up @@ -772,7 +772,7 @@ public void testIdleVerifyOnInactiveClusterWithPersistence() throws Exception {

assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute("--cache", "idle_verify"));

assertContains(log, testOut.toString(), VerifyBackupPartitionsTaskV2.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);
assertContains(log, testOut.toString(), VerifyBackupPartitionsTask.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);
assertContains(log, testOut.toString(), "Failed to perform operation");

srv.cluster().state(ACTIVE);
Expand Down Expand Up @@ -843,7 +843,7 @@ public void testIdleVerifyCancelBeforeCalcPartitionHashStarted() throws Exceptio
}
};

VerifyBackupPartitionsTaskV2.poolSupplier = () -> pool;
VerifyBackupPartitionsTask.poolSupplier = () -> pool;
}, false);
}

Expand Down Expand Up @@ -895,7 +895,7 @@ public void testIdleVerifyCancelWhileCalcPartitionHashRunning() throws Exception
}
};

VerifyBackupPartitionsTaskV2.poolSupplier = () -> pool;
VerifyBackupPartitionsTask.poolSupplier = () -> pool;
}, checkCrc);

assertTrue("All tasks must be cancelled", interruptedOnCancel.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Represents a type of cache(s) that can be used for comparing update counters and checksums between primary and backup partitions.
* <br>
* @see VerifyBackupPartitionsTaskV2
* @see VerifyBackupPartitionsTask
*/
public enum CacheFilterEnum {
/** Default - user only, or all caches specified by name. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
/**
* Task that cancels jobs started by idle_verify command.
*
* @see IdleVerifyTaskV2
* @see VerifyBackupPartitionsTaskV2
* @see IdleVerifyTask
* @see VerifyBackupPartitionsTask
*/
public class CacheIdleVerifyCancelTask extends VisorMultiNodeTask<NoArg, Void, Void> {
/** */
private static final long serialVersionUID = 0L;

/** Jobs started by tasks must be canceled. */
public static final Set<String> TASKS_TO_CANCEL = Set.of(
IdleVerifyTaskV2.class.getName(),
VerifyBackupPartitionsTaskV2.class.getName()
IdleVerifyTask.class.getName(),
VerifyBackupPartitionsTask.class.getName()
);

/** {@inheritDoc} */
Expand All @@ -62,8 +62,8 @@ public class CacheIdleVerifyCancelTask extends VisorMultiNodeTask<NoArg, Void, V
/**
* Job that cancels jobs started by idle_verify command.
*
* @see IdleVerifyTaskV2
* @see VerifyBackupPartitionsTaskV2
* @see IdleVerifyTask
* @see VerifyBackupPartitionsTask
*/
private class CacheIdleVerifyCancelJob extends VisorJob<NoArg, Void> {
/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
/** Checks consistency of primary and backup partitions assuming no concurrent updates are happening in the cluster. */
@CliSubcommandsWithPrefix
public class CacheIdleVerifyCommand
extends CommandRegistryImpl<CacheIdleVerifyCommandArg, IdleVerifyResultV2>
implements ComputeCommand<CacheIdleVerifyCommandArg, IdleVerifyResultV2> {
extends CommandRegistryImpl<CacheIdleVerifyCommandArg, IdleVerifyResult>
implements ComputeCommand<CacheIdleVerifyCommandArg, IdleVerifyResult> {
/** */
public static final String IDLE_VERIFY_FILE_PREFIX = "idle_verify-";

Expand Down Expand Up @@ -70,12 +70,12 @@ public CacheIdleVerifyCommand() {
}

/** {@inheritDoc} */
@Override public Class<IdleVerifyTaskV2> taskClass() {
return IdleVerifyTaskV2.class;
@Override public Class<IdleVerifyTask> taskClass() {
return IdleVerifyTask.class;
}

/** {@inheritDoc} */
@Override public void printResult(CacheIdleVerifyCommandArg arg, IdleVerifyResultV2 res, Consumer<String> printer) {
@Override public void printResult(CacheIdleVerifyCommandArg arg, IdleVerifyResult res, Consumer<String> printer) {
logParsedArgs(arg, printer);

StringBuilder sb = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.ignite.internal.util.typedef.F;

/**
* This exception is used to collect exceptions occured in {@link VerifyBackupPartitionsTaskV2} execution.
* This exception is used to collect exceptions occured in {@link VerifyBackupPartitionsTask} execution.
*/
public class IdleVerifyException extends IgniteException {
/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
import static org.apache.ignite.internal.util.IgniteUtils.nl;

/**
* Encapsulates result of {@link VerifyBackupPartitionsTaskV2}.
* Encapsulates result of {@link VerifyBackupPartitionsTask}.
*/
public class IdleVerifyResultV2 extends VisorDataTransferObject {
public class IdleVerifyResult extends VisorDataTransferObject {
/** */
private static final long serialVersionUID = 0L;

Expand Down Expand Up @@ -82,20 +82,20 @@ public class IdleVerifyResultV2 extends VisorDataTransferObject {
/**
* Default constructor for Externalizable.
*/
public IdleVerifyResultV2() {
public IdleVerifyResult() {
}

/**
* @param exceptions Occurred exceptions.
*/
public IdleVerifyResultV2(Map<ClusterNode, Exception> exceptions) {
public IdleVerifyResult(Map<ClusterNode, Exception> exceptions) {
this.exceptions = exceptions;
}

/**
* @param txHashConflicts Transaction hashes conflicts.
*/
public IdleVerifyResultV2(
public IdleVerifyResult(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes,
@Nullable List<List<TransactionsHashRecord>> txHashConflicts,
@Nullable Map<ClusterNode, Collection<GridCacheVersion>> partiallyCommittedTxs
Expand All @@ -110,7 +110,7 @@ public IdleVerifyResultV2(
* @param clusterHashes Map of cluster partition hashes.
* @param exceptions Exceptions on each cluster node.
*/
public IdleVerifyResultV2(
public IdleVerifyResult(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes,
Map<ClusterNode, Exception> exceptions
) {
Expand Down Expand Up @@ -390,12 +390,12 @@ private void printConflicts(Consumer<String> printer) {
if (o == null || getClass() != o.getClass())
return false;

IdleVerifyResultV2 v2 = (IdleVerifyResultV2)o;
IdleVerifyResult v = (IdleVerifyResult)o;

return Objects.equals(cntrConflicts, v2.cntrConflicts) && Objects.equals(hashConflicts, v2.hashConflicts) &&
Objects.equals(movingPartitions, v2.movingPartitions) && Objects.equals(lostPartitions, v2.lostPartitions) &&
Objects.equals(exceptions, v2.exceptions) && Objects.equals(txHashConflicts, v2.txHashConflicts) &&
Objects.equals(partiallyCommittedTxs, v2.partiallyCommittedTxs);
return Objects.equals(cntrConflicts, v.cntrConflicts) && Objects.equals(hashConflicts, v.hashConflicts) &&
Objects.equals(movingPartitions, v.movingPartitions) && Objects.equals(lostPartitions, v.lostPartitions) &&
Objects.equals(exceptions, v.exceptions) && Objects.equals(txHashConflicts, v.txHashConflicts) &&
Objects.equals(partiallyCommittedTxs, v.partiallyCommittedTxs);
}

/** {@inheritDoc} */
Expand All @@ -412,6 +412,6 @@ private void printConflicts(Consumer<String> printer) {

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(IdleVerifyResultV2.class, this);
return S.toString(IdleVerifyResult.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* Task to verify checksums of backup partitions.
*/
@GridInternal
public class IdleVerifyTaskV2 extends VisorOneNodeTask<CacheIdleVerifyCommandArg, IdleVerifyResultV2> {
public class IdleVerifyTask extends VisorOneNodeTask<CacheIdleVerifyCommandArg, IdleVerifyResult> {
/** */
private static final long serialVersionUID = 0L;

/** {@inheritDoc} */
@Override protected VisorJob<CacheIdleVerifyCommandArg, IdleVerifyResultV2> job(CacheIdleVerifyCommandArg arg) {
@Override protected VisorJob<CacheIdleVerifyCommandArg, IdleVerifyResult> job(CacheIdleVerifyCommandArg arg) {
if (!ignite.context().state().publicApiActiveState(true))
throw new IgniteException(VerifyBackupPartitionsTaskV2.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);
throw new IgniteException(VerifyBackupPartitionsTask.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);

return new IdleVerifyJob<>(arg, debug, VerifyBackupPartitionsTaskV2.class);
return new IdleVerifyJob<>(arg, debug, VerifyBackupPartitionsTask.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apache.ignite.IgniteException;

/**
* Runtime exception that can be thrown in {@link VerifyBackupPartitionsTaskV2} when no caches matching given
* Runtime exception that can be thrown in {@link VerifyBackupPartitionsTask} when no caches matching given
* filter options can be found.
*/
public class NoMatchingCachesException extends IgniteException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class VerifyBackupPartitionsDumpTask extends ComputeTaskAdapter<CacheIdle
public static final String IDLE_DUMP_FILE_PREFIX = "idle-dump-";

/** Delegate for map execution */
private final VerifyBackupPartitionsTaskV2 delegate = new VerifyBackupPartitionsTaskV2();
private final VerifyBackupPartitionsTask delegate = new VerifyBackupPartitionsTask();

/** */
private CacheIdleVerifyDumpCommandArg taskArg;
Expand Down Expand Up @@ -172,7 +172,7 @@ record = records.get(i);
*/
private String writeHashes(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> partitions,
IdleVerifyResultV2 conflictRes,
IdleVerifyResult conflictRes,
int skippedRecords
) throws IgniteException {
String wd = ignite.configuration().getWorkDirectory();
Expand Down Expand Up @@ -204,7 +204,7 @@ private String writeHashes(
/** */
private void writeResult(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> partitions,
IdleVerifyResultV2 conflictRes,
IdleVerifyResult conflictRes,
int skippedRecords,
PrintWriter writer
) {
Expand Down
Loading

0 comments on commit 33315e7

Please sign in to comment.