I have a business need to drop and re-create indices with new mappings. I have been doing that successfully until I encountered the following problem:
Cannot delete indices that are being snapshotted. Try again after snapshot finishes or cancel the currently running snapshot.
- How do I check if the snapshot is ongoing?
- How do I cancel the currently running snapshot?
Is there a Java API for it? I am using version 6.01.
Advertisement
Answer
Get all running snapshots using
GET /_snapshot/_status
Deletion of a running snapshot will stop and then delete the snapshot:
DELETE /_snapshot/my_repository/snapshot_to_stop
Source: snapshot api
There is no offical java api supporting rhe snapshot and restore module but you can easily issue a http call using the official http rest client