|
28 | 28 | * {@link org.elasticsearch.cluster.SnapshotsInProgress}. All nodes consume the state of the {@code SnapshotsInProgress} and will start or
|
29 | 29 | * abort relevant shard snapshot tasks accordingly.</li>
|
30 | 30 | * <li>Nodes that are executing shard snapshot tasks report either success or failure of their snapshot task by submitting a
|
31 |
| - * {@link org.elasticsearch.snapshots.SnapshotShardsService.UpdateIndexShardSnapshotStatusRequest} to the master node that will |
32 |
| - * update the snapshot's entry in the cluster-state accordingly.</li> |
| 31 | + * {@link org.elasticsearch.snapshots.SnapshotShardsService.UpdateIndexShardSnapshotStatusRequest} to the master node that will update the |
| 32 | + * snapshot's entry in the cluster state accordingly.</li> |
33 | 33 | * </ul>
|
34 | 34 | *
|
35 | 35 | * <h1>Snapshot Creation</h1>
|
36 | 36 | * <p>Snapshots are created by the following sequence of events:</p>
|
37 | 37 | * <ol>
|
38 | 38 | * <li>An invocation of {@link org.elasticsearch.snapshots.SnapshotsService#createSnapshot} enqueues a cluster state update to create
|
39 |
| - * a {@link org.elasticsearch.cluster.SnapshotsInProgress.Entry} in the cluster-state's {@code SnapshotsInProgress}. |
40 |
| - * This initial snapshot entry has its state set to {@code INIT} and an empty map set for the state of the individual shard's snapshots. |
41 |
| - * </li> |
| 39 | + * a {@link org.elasticsearch.cluster.SnapshotsInProgress.Entry} in the cluster state's {@code SnapshotsInProgress}. This initial snapshot |
| 40 | + * entry has its state set to {@code INIT} and an empty map set for the state of the individual shard's snapshots.</li> |
42 | 41 | *
|
43 |
| - * <li>After the snapshot's entry with state {@code INIT} is in the cluster-state, |
44 |
| - * {@link org.elasticsearch.snapshots.SnapshotsService} determines the primary shards' assignments for all indices that are being |
45 |
| - * snapshotted and updates the existing {@code SnapshotsInProgress.Entry} with state {@code STARTED} and adds the map of |
46 |
| - * {@link org.elasticsearch.index.shard.ShardId} to {@link org.elasticsearch.cluster.SnapshotsInProgress.ShardSnapshotStatus} that tracks |
47 |
| - * the assignment of which node is to snapshot which shard. All shard snapshots are executed on the shard's primary node. |
48 |
| - * Thus all shards for which the primary node was found to have a healthy copy of the shard are marked as being in state {@code INIT} in |
49 |
| - * this map. |
50 |
| - * If the primary for a shard is unassigned, it is marked as {@code MISSING} in this |
51 |
| - * map. In case the primary is initializing at this point, it is marked as in state |
52 |
| - * {@code WAITING}.</li> |
| 42 | + * <li>After the snapshot's entry with state {@code INIT} is in the cluster state, {@link org.elasticsearch.snapshots.SnapshotsService} |
| 43 | + * determines the primary shards' assignments for all indices that are being snapshotted and updates the existing |
| 44 | + * {@code SnapshotsInProgress.Entry} with state {@code STARTED} and adds the map of {@link org.elasticsearch.index.shard.ShardId} to |
| 45 | + * {@link org.elasticsearch.cluster.SnapshotsInProgress.ShardSnapshotStatus} that tracks the assignment of which node is to snapshot which |
| 46 | + * shard. All shard snapshots are executed on the shard's primary node. Thus all shards for which the primary node was found to have a |
| 47 | + * healthy copy of the shard are marked as being in state {@code INIT} in this map. If the primary for a shard is unassigned, it is marked |
| 48 | + * as {@code MISSING} in this map. In case the primary is initializing at this point, it is marked as in state {@code WAITING}.</li> |
53 | 49 | *
|
54 | 50 | * <li>The new {@code SnapshotsInProgress.Entry} is then observed by
|
55 |
| - * {@link org.elasticsearch.snapshots.SnapshotShardsService#clusterChanged} on all nodes and since the entry is in state |
56 |
| - * {@code STARTED} the {@code SnapshotShardsService} will check if any local primary shards are to be snapshotted |
57 |
| - * (signaled by the shard's snapshot state being {@code INIT}). |
58 |
| - * For those local primary shards found in state {@code INIT}) the snapshot process |
59 |
| - * of writing the shard's data files to the snapshot's {@link org.elasticsearch.repositories.Repository} is executed. |
60 |
| - * Once the snapshot execution finishes for a shard an {@code UpdateIndexShardSnapshotStatusRequest} is sent to the master node signaling |
61 |
| - * either status {@code SUCCESS} or {@code FAILED}. |
62 |
| - * The master node will then update a shard's state in the snapshots {@code SnapshotsInProgress.Entry} whenever |
63 |
| - * it receives such a {@code UpdateIndexShardSnapshotStatusRequest}.</li> |
64 |
| - * |
65 |
| - * <li>If as a result of the received status update requests, all shards in the cluster-state are in a completed state, i.e are marked as |
66 |
| - * either {@code SUCCESS}, {@code FAILED} or {@code MISSING}, the {@code SnapshotShardsService} |
67 |
| - * will update the state of the {@code Entry} itself and mark it as {@code SUCCESS}. |
68 |
| - * At the same time {@link org.elasticsearch.snapshots.SnapshotsService#endSnapshot} is executed, writing the metadata necessary to |
69 |
| - * finalize the snapshot in the repository to the repository.</li> |
70 |
| - * |
71 |
| - * <li>After writing the final metadata to the repository, a cluster-state update to remove the snapshot from the repository is submitted |
72 |
| - * and the removal of the snapshot's {@code SnapshotsInProgress.Entry} from the cluster-state completes the snapshot process.</li> |
| 51 | + * {@link org.elasticsearch.snapshots.SnapshotShardsService#clusterChanged} on all nodes and since the entry is in state {@code STARTED} |
| 52 | + * the {@code SnapshotShardsService} will check if any local primary shards are to be snapshotted (signaled by the shard's snapshot state |
| 53 | + * being {@code INIT}). For those local primary shards found in state {@code INIT}) the snapshot process of writing the shard's data files |
| 54 | + * to the snapshot's {@link org.elasticsearch.repositories.Repository} is executed. Once the snapshot execution finishes for a shard an |
| 55 | + * {@code UpdateIndexShardSnapshotStatusRequest} is sent to the master node signaling either status {@code SUCCESS} or {@code FAILED}. |
| 56 | + * The master node will then update a shard's state in the snapshots {@code SnapshotsInProgress.Entry} whenever it receives such a |
| 57 | + * {@code UpdateIndexShardSnapshotStatusRequest}.</li> |
| 58 | + * |
| 59 | + * <li>If as a result of the received status update requests, all shards in the cluster state are in a completed state, i.e are marked as |
| 60 | + * either {@code SUCCESS}, {@code FAILED} or {@code MISSING}, the {@code SnapshotShardsService} will update the state of the {@code Entry} |
| 61 | + * itself and mark it as {@code SUCCESS}. At the same time {@link org.elasticsearch.snapshots.SnapshotsService#endSnapshot} is executed, |
| 62 | + * writing the metadata necessary to finalize the snapshot in the repository to the repository.</li> |
| 63 | + * |
| 64 | + * <li>After writing the final metadata to the repository, a cluster state update to remove the snapshot from the cluster state is |
| 65 | + * submitted and the removal of the snapshot's {@code SnapshotsInProgress.Entry} from the cluster state completes the snapshot process. |
| 66 | + * </li> |
73 | 67 | * </ol>
|
74 | 68 | *
|
75 | 69 | * <h1>Deleting a Snapshot</h1>
|
|
88 | 82 | * the {@code SnapshotShardsService}, then the shard's state will be reported to master as {@code SUCCESS}.
|
89 | 83 | * Otherwise, it will be reported as {@code FAILED}.</li>
|
90 | 84 | *
|
91 |
| - * <li>Once all the shards are reported to master as either {@code SUCCESS} or |
92 |
| - * {@code FAILED} the {@code SnapshotsService} on the master will finish the snapshot process as all shard's |
93 |
| - * states are now completed and hence the snapshot can be completed as explained in point 4 of the snapshot creation section above.</li> |
| 85 | + * <li>Once all the shards are reported to master as either {@code SUCCESS} or {@code FAILED} the {@code SnapshotsService} on the master |
| 86 | + * will finish the snapshot process as all shard's states are now completed and hence the snapshot can be completed as explained in point 4 |
| 87 | + * of the snapshot creation section above.</li> |
94 | 88 | * </ol>
|
95 | 89 | *
|
96 | 90 | * <h2>Deleting a Snapshot from a Repository</h2>
|
97 | 91 | *
|
98 | 92 | * <ol>
|
99 |
| - * <li>Assuming there are no entries in the cluster-state's {@code SnapshotsInProgress}, deleting a snapshot |
100 |
| - * starts by the {@code SnapshotsService} creating an entry for deleting the snapshot in |
101 |
| - * the cluster-state's {@link org.elasticsearch.cluster.SnapshotDeletionsInProgress}.</li> |
| 93 | + * <li>Assuming there are no entries in the cluster state's {@code SnapshotsInProgress}, deleting a snapshot starts by the |
| 94 | + * {@code SnapshotsService} creating an entry for deleting the snapshot in the cluster state's |
| 95 | + * {@link org.elasticsearch.cluster.SnapshotDeletionsInProgress}.</li> |
102 | 96 | *
|
103 |
| - * <li>Once the cluster-state contains the deletion entry in {@code SnapshotDeletionsInProgress} the {@code SnapshotsService} will invoke |
| 97 | + * <li>Once the cluster state contains the deletion entry in {@code SnapshotDeletionsInProgress} the {@code SnapshotsService} will invoke |
104 | 98 | * {@link org.elasticsearch.repositories.Repository#deleteSnapshot} for the given snapshot, which will remove files associated with the
|
105 | 99 | * snapshot from the repository as well as update its meta-data to reflect the deletion of the snapshot.</li>
|
106 | 100 | *
|
107 |
| - * <li>After the deletion of the snapshot's data from the repository finishes, the {@code SnapshotsService} will submit a cluster-state |
108 |
| - * update to remove the deletion's entry in {@code SnapshotDeletionsInProgress} which concludes the process of |
109 |
| - * deleting a snapshot.</li> |
| 101 | + * <li>After the deletion of the snapshot's data from the repository finishes, the {@code SnapshotsService} will submit a cluster state |
| 102 | + * update to remove the deletion's entry in {@code SnapshotDeletionsInProgress} which concludes the process of deleting a snapshot.</li> |
110 | 103 | * </ol>
|
111 | 104 | */
|
112 | 105 | package org.elasticsearch.snapshots;
|
0 commit comments