Skip to content

IGNITE-29056 Introduce snapshot lists command to control.sh - #13666

Open
Vladsz83 wants to merge 151 commits into
apache:masterfrom
Vladsz83:IGNITE-29056-Introduce-snapshot-lists-command-to-control.sh
Open

Vladsz83 wants to merge 151 commits into
apache:masterfrom
Vladsz83:IGNITE-29056-Introduce-snapshot-lists-command-to-control.sh

Conversation

@Vladsz83

@Vladsz83 Vladsz83 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see tab PR Check at TC.Bot - Instance 1 or TC.Bot - Instance 2)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical feature-ID compatibility and moderate snapshot metadata validation findings remain.

1 open issue
What changed in this PR

Adds control.sh|bat --snapshot list to enumerate snapshots, metadata, sizes, incremental parts, and external storage usage.

Changes:

  • Adds snapshot-list commands, tasks, DTOs, and output formatting.
  • Adds feature gating, documentation, help updates, and extensive tests.
  • Updates snapshot metadata handling and test utilities.
File Description
modules/​ducktests/​src/​main/​java/​org/​apache/​ignite/​internal/​ducktest/​tests/​ContinuousDataLoadApplication.java Corrects a typo.
modules/​core/​src/​test/​resources/​org.apache.ignite.util/​GridCommandHandlerClusterByClassWithSSLTest_help.output Updates CLI help.
modules/​core/​src/​test/​resources/​org.apache.ignite.util/​GridCommandHandlerClusterByClassTest_help.output Updates CLI help.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​testsuites/​IgniteSnapshotTestSuite9.java Adds snapshot-list test suite.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​rollingupgrade/​feature/​TestIgniteReleaseFeatures_2_19_4.java Adds release feature definitions.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​rollingupgrade/​AbstractRollingUpgradeTest.java Updates release feature coverage.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​incremental/​IncrementalSnapshotNodeFailureTest.java Updates snapshot manager access.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​incremental/​AbstractIncrementalSnapshotTest.java Updates snapshot manager access.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​IgniteClusterSnapshotListTest.java Adds snapshot-list tests.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​IgniteClusterSnapshotListRollingUpgradeTest.java Adds rolling-upgrade tests.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​AbstractSnapshotSelfTest.java Generalizes snapshot helpers.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​rollingupgrade/​feature/​CoreFeatureRegistry.java Registers the snapshot-list feature.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​metastorage/​persistence/​DistributedMetaStorageImpl.java Corrects a typo.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​SnapshotMetadataVerificationTask.java Adds TODO documentation.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​SnapshotListTaskResult.java Adds aggregate result DTO.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​SnapshotListJobResult.java Adds per-node result DTO.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​SnapshotCheckProcess.java Corrects a typo.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​snapshot/​IgniteSnapshotManager.java Supports tolerant metadata reads.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​persistence/​filename/​SnapshotFileTree.java Documents path limitations.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​cache/​distributed/​dht/​preloader/​GridDhtPartitionsSingleMessage.java Corrects a typo.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​management/​snapshot/​SnapshotListTask.java Implements snapshot discovery and sizing.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​management/​snapshot/​SnapshotListCommandArg.java Adds the --src argument.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​management/​snapshot/​SnapshotListCommand.java Formats command output.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​management/​snapshot/​SnapshotCommand.java Registers the list subcommand.
modules/​control-utility/​src/​test/​java/​org/​apache/​ignite/​util/​GridCommandHandlerListSnapshotTest.java Adds CLI tests.
modules/​control-utility/​src/​test/​java/​org/​apache/​ignite/​util/​GridCommandHandlerAbstractTest.java Refactors test cache setup.
modules/​control-utility/​src/​test/​java/​org/​apache/​ignite/​testsuites/​IgniteControlUtilityTestSuite6.java Adds CLI test suite.
docs/​_docs/​snapshots/​snapshots.adoc Documents snapshot listing.

Review effort: Lite

Comment thread docs/_docs/snapshots/snapshots.adoc

// Sorted snapshots names for better user reading.
new TreeMap<>(nodeResult.snapshots()).forEach((snpName, snpInfo) -> {
printer.accept("\t\tSnapshot '%s': totalSize=%s (%db), created='%s' (epoch=%d)".formatted(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output like : Snapshot 'testSnapshot0': totalSize=659.0 KB (674843b), created='2026-10-19 09:11:00 +0300' (epoch=1792390260252)
Why do you deside that: 1. size in bytes 2. epoch is helpful somehow ? I just think it looks like a garbage, fix me if i`m wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Here's the thinking:

Exact date: tying the output to a hardcoded format isn't a good practice actually (it varies by region). Adding a config option would bloat this ticket. If anyone want othe date format, epoch time
is always available. I was actually thinking of a verbose flag that would return epoch time and the byte size.

Exact size: familiar commands across OSes give you both a friendly and an exact view. I kept it, but I'm fine dropping the byte value if the team prefers.

WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems we need table with columns format here, if it common case for control utility output

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from discussion: need to investigate common usage timporal output format, probably : dd.MM.YYYY - HH:MM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my research, the current format is close to well-known standards and common practices. Examples:

  • ISO 8601: '2026-09-18T12:00:00Z' / '2026-09-18T12:00:00+03:00'
  • DateTimeFormatter.ISO_INSTANT: '2024-01-15T14:30:45.123Z'
  • DateTimeFormatter.ISO_OFFSET_DATE_TIME: '2024-01-15T17:30:45.123+03:00'
  • Typical SQL-like timestamp: 'uuuu-MM-dd HH:mm:ss.SSS'

The main principle is that larger units (such as years or months) come before smaller ones (such as hours, minutes, and seconds). The timezone (if required) comes last.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the table format, the date format isn’t relevant. I believe we should discuss and choose a single common format, but not in this ticket. Here I’m sticking with the existing one.

Comment on lines +361 to +363
private void doTestWrongSnapshotPath(boolean missing) throws Exception {
// Doesn't matter here, speeds up the tests.
assumeFalse(snpThrdPoolSz < 2);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private void doTestWrongSnapshotPath(boolean missing) throws Exception {
// Doesn't matter here, speeds up the tests.
assumeFalse(snpThrdPoolSz < 2);
private void doTestWrongSnapshotPath(boolean missing) throws Exception {
// Doesn't matter here, speeds up the tests.
snpThrdPoolSz = DFLT_SNAPSHOT_THREAD_POOL_SIZE;
assumeFalse(snpThrdPoolSz < 2);

Seems you need to simplify tests, remove snpThrdPoolSz from params and use directly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why snpThrdPoolSz = DFLT_SNAPSHOT_THREAD_POOL_SIZE;? It would be configured.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we should skip the pool size parameter. We do use the pool. I've already met stuck issues in snapshots when a user configures just one thread.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First - you remove "assumeFalse(snpThrdPoolSz < 2);" and after you write this comment ) My - become unrelevant after your changes )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Removed everywhere except the spot that intentionally blocks a thread for testing.

…s-command-to-control.sh' into IGNITE-29056-Introduce-snapshot-lists-command-to-control.sh
…and-to-control.sh

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/feature/CoreFeatureRegistry.java
…and-to-control.sh

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/feature/CoreFeatureRegistry.java
…and-to-control.sh-dev

# Conflicts:
#	docs/_docs/snapshots/snapshots.adoc
#	modules/control-utility/src/test/java/org/apache/ignite/testsuites/IgniteControlUtilityTestSuite6.java
#	modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotCommand.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotMetadataVerificationTask.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/feature/CoreFeatureRegistry.java
#	modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSnapshotTestSuite9.java
#	modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassTest_help.output
#	modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_help.output
…l.sh-dev' into IGNITE-29056-Introduce-snapshot-lists-command-to-control.sh
@github-actions

Copy link
Copy Markdown

Possible compatibility issues. Please, check rolling upgrade cases

This PR modifies protected classes (with Order annotation).
Changes to these classes can break rolling upgrade compatibility.

Affected files:

  • modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotCheckCommandArg.java
  • modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotDeleteCommandArg.java
  • modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotListCommandArg.java
  • modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotRestoreCommandArg.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotListJobResult.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotListTaskResult.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants