Skip to content

IGNITE-29050 Introduce snapshot deletion command - #13577

Open
Vladsz83 wants to merge 82 commits into
apache:masterfrom
Vladsz83:Introduce-snapshot-deletion-command
Open

Vladsz83 wants to merge 82 commits into
apache:masterfrom
Vladsz83:Introduce-snapshot-deletion-command

Conversation

@Vladsz83

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.

@zstan
zstan requested a lite review from Copilot September 23, 2026 13:56

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 3 High severity · 8 Medium severity · 5 Low severity

Open (16)
Resolved since last review (9)

Comment thread docs/_docs/snapshots/snapshots.adoc
Comment thread docs/_docs/snapshots/snapshots.adoc Outdated
Comment thread docs/_docs/snapshots/snapshots.adoc Outdated

/** */
public String snapshotName() {
return snapshotName;

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.

It`s not about arg processing, it about @Nullable annotation

* @return {@code True}, if data is found and completely deleted;
* {@code False}, if nothing found or if data is found but might not be deleted completely.
*/
public boolean deleteLocalSnapshot(SnapshotFileTree sft, @Nullable AtomicBoolean existsFlag) {

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.

I question about atomic - you reply about lambda and final )
Seems this complication cause you want return
IgniteSnapshotManager#deleteLocalSnapshot 2 states here, from return mechanism and from AtomicBoolean state, overcomplicated, change it plz

* proceeds if snapshot already deleted.
*/
@Test
public void testConcurrentSnapshotDeleteOperation() throws Exception {

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 java doc: "Tests that snapshot create detects concurrent deletion", but i see that it tests only already existing snap ? Seems this test is not cover conc deletion opertion, other conc tests need to be re checked too

@Vladsz83 Vladsz83 Sep 24, 2026 •

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.

This test does cover concurrent snapshot creation operation which cannot start. Of course, we create cnapshot. With an unexisting snapshot the deletion doesn't start at all - the metas aren't found. There will be no cuncurrency, The opposite tests (when deletion cannot start) are in IgniteClusterSnapshotDeleteTest. For example, testSnapshotDeleteWhenCreateInProgress.

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.

For concurrent delete with create operations I expect the different err message here?

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.

The messages are different. Actually, snapshot creation a bit differs from other snp. operations. First things first, it checks snp. existence. But only on the node where the process starts. Also, there is the same isSnapshotDeleting() check in the first stage of the creation routine within its DP (initLocalSnapshotStartStage), near the other checks.

Comment thread docs/_docs/snapshots/snapshots.adoc Outdated

/** */
@RunWith(Parameterized.class)
public class IgniteClusterSnapshotDeleteTest extends AbstractSnapshotSelfTest {

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.

plz add test where you create 2 snaps in different cases, i.e. snap and snAp and check for deletion all of them?

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.

I realized I need a case-insensitive filesystem. I'll return to this question later.

Comment thread docs/_docs/snapshots/snapshots.adoc

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.

Copilot review overview

🟡 Changes recommended

Request identity and absent-node calculation currently produce incorrect concurrency blocking and operator warnings.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity · 4 Low severity

Open (6)
Resolved since last review (17)


var curCreateRq = snpMgr.currentCreateRequest();

if (curCreateRq != null && curCreateRq.snpName.equalsIgnoreCase(req.snpName)) {
Comment on lines +75 to +80
return Objects.equals(resolvedPath, other.resolvedPath);
}

/** {@inheritDoc} */
@Override public int hashCode() {
return Objects.hash(resolvedPath);

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

Comment thread docs/_docs/snapshots/snapshots.adoc Outdated
Comment on lines +318 to +319
# Delete the snapshot "snapshot_09062021" located in the "/tmp/ignite/snapshots" folder.
control.bat --snapshot delete snapshot_09062021 --src /tmp/ignite/snapshots

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

@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/SnapshotDeleteCommandArg.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotDeleteProcessResult.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotDeleteRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotDeleteResponse.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