Skip to content

Bug: Snapshot status "partial" misreported #28692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
redbearsam opened this issue Feb 15, 2018 · 6 comments
Open

Bug: Snapshot status "partial" misreported #28692

redbearsam opened this issue Feb 15, 2018 · 6 comments
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.

Comments

@redbearsam
Copy link

Related to issue #5792 .

Bug: Snapshot status "partial" misreported

When hitting the _snapshot/{repoName}/{snapshotName}/_status endpoint, the partial state is never returned (as it is for example when hitting the _snapshot/{repoName}/{snapshotName} endpoint.

The following code and TODO are to be found inside the relevant file (elasticsearch/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotStatusAction):

final SnapshotsInProgress.State state;
switch (snapshotInfo.state()) {
    case FAILED:
        state = SnapshotsInProgress.State.FAILED;
        break;
    case SUCCESS:
    case PARTIAL:
        // Translating both PARTIAL and SUCCESS to SUCCESS for now
        // TODO: add the differentiation on the metadata level in the next major release
        state = SnapshotsInProgress.State.SUCCESS;
        break;
    default:
        throw new IllegalArgumentException("Unknown snapshot state " + snapshotInfo.state());

Suggest implementing the suggested TODO. Can't see any obvious issues therein. I expect to make a pull request to this effect quite soon, given the go-ahead.

Elasticsearch version (bin/elasticsearch --version): v1.7 through v6.2

@bleskes bleskes added >enhancement :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Feb 15, 2018
@bleskes
Copy link
Contributor

bleskes commented Feb 15, 2018

@tlrx can you voice an opinion please?

@tlrx
Copy link
Member

tlrx commented Feb 20, 2018

Thanks @redbearsam. Indeed, I think we can now correctly report the PARTIAL status. Do you still want to submit a pull request?

@redbearsam
Copy link
Author

Cool yes, thy will be done. Submission will be tomorrow. Thanks tlrx.

@tlrx
Copy link
Member

tlrx commented Mar 27, 2018

Pull request has been submitted: #28801

redbearsam added a commit to redbearsam/elasticsearch that referenced this issue Jun 12, 2018
@original-brownbear
Copy link
Member

There is another issue here, SUCCESS from the status API doesn't necessarily mean that the snapshot has actually completed. It will also be returned after all shard snapshots have finished but before snapshot finalization has happened, see #49533

@rjernst rjernst added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label May 4, 2020
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.
Projects
None yet
Development

No branches or pull requests

6 participants