0
0
Elasticsearchquery~20 mins

Snapshot and restore in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Snapshot and Restore Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this snapshot creation request?

Given the following Elasticsearch snapshot creation request, what will be the response status if the repository exists and is accessible?

Elasticsearch
{
  "repository": "my_backup",
  "snapshot": "snapshot_1",
  "body": {
    "indices": "index1,index2",
    "ignore_unavailable": true,
    "include_global_state": false
  }
}
AAcknowledged: true, Snapshot created successfully
BError: Repository not found
CSnapshot creation failed due to missing indices
DTimeout error during snapshot creation
Attempts:
2 left
💡 Hint

Check if the repository exists and the indices are available.

Predict Output
intermediate
2:00remaining
What does this restore request do?

Consider this Elasticsearch restore request. What will be the effect on the cluster?

Elasticsearch
{
  "repository": "my_backup",
  "snapshot": "snapshot_1",
  "body": {
    "indices": "index1",
    "rename_pattern": "index(\\d+)",
    "rename_replacement": "restored_index$1",
    "include_global_state": false
  }
}
ARestores index1 as restored_index1 without changing cluster settings
BRestores all indices and overwrites cluster settings
CFails because rename_pattern is invalid
DRestores index1 but keeps the original name
Attempts:
2 left
💡 Hint

Look at the rename_pattern and rename_replacement fields.

🔧 Debug
advanced
2:00remaining
Why does this snapshot creation fail with a repository error?

Analyze the following snapshot creation request and identify the cause of the failure.

Elasticsearch
{
  "repository": "backup_repo",
  "snapshot": "snap_2024",
  "body": {
    "indices": "*",
    "ignore_unavailable": false
  }
}
Aignore_unavailable must be true when using '*' wildcard
BThe repository 'backup_repo' is not registered or accessible
CThe wildcard '*' is invalid for indices
DSnapshot name 'snap_2024' is invalid
Attempts:
2 left
💡 Hint

Check repository registration and accessibility.

Predict Output
advanced
2:00remaining
What is the output of this snapshot status request?

Given this request to check snapshot status, what will be the output if the snapshot is currently in progress?

Elasticsearch
GET /_snapshot/my_backup/snapshot_1/_status
A{"snapshots":[{"snapshot":"snapshot_1","state":"SUCCESS"}]}
B{"error":"Snapshot not found"}
C{"snapshots":[{"snapshot":"snapshot_1","state":"IN_PROGRESS"}]}
D{"snapshots":[]}
Attempts:
2 left
💡 Hint

Consider the snapshot lifecycle states.

🧠 Conceptual
expert
3:00remaining
Which option correctly describes the behavior of restoring snapshots with include_global_state set to true?

When restoring a snapshot with include_global_state set to true, what happens?

AGlobal state is ignored and only indices are restored
BOnly index data is restored; cluster settings remain unchanged
CRestoring fails if global state is included
DCluster settings, templates, and persistent metadata from the snapshot are restored, potentially overwriting current cluster state
Attempts:
2 left
💡 Hint

Think about what global state means in Elasticsearch snapshots.