Skip to content
4 changes: 3 additions & 1 deletion _api-reference/snapshots/create-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Request parameters depend on the type of repository: `fs` or `s3`.

### Common parameters

The following table lists parameters that can be used with both the `fs` and `s3` repositories.
The following table lists parameters that can be used with both the `fs` and `s3` repositories.

Request field | Description
:--- | :---
Expand All @@ -54,6 +54,7 @@ Request field | Description
`max_restore_bytes_per_sec` | The maximum rate at which snapshots restore. Default is 40 MB per second (`40m`). Optional.
`max_snapshot_bytes_per_sec` | The maximum rate at which snapshots take. Default is 40 MB per second (`40m`). Optional.
`remote_store_index_shallow_copy` | Boolean | Determines whether the snapshot of the remote store indexes are captured as a shallow copy. Default is `false`.
`shallow_snapshot_v2` | Boolean | Determines whether the snapshot of the remote store indexes are captured as a shallow copy v2. Default is `false`.
`readonly` | Whether the repository is read-only. Useful when migrating from one cluster (`"readonly": false` when registering) to another cluster (`"readonly": true` when registering). Optional.


Expand All @@ -73,6 +74,7 @@ Request field | Description
`max_snapshot_bytes_per_sec` | The maximum rate at which snapshots take. Default is 40 MB per second (`40m`). Optional.
`readonly` | Whether the repository is read-only. Useful when migrating from one cluster (`"readonly": false` when registering) to another cluster (`"readonly": true` when registering). Optional.
`remote_store_index_shallow_copy` | Boolean | Whether the snapshot of the remote store indexes is captured as a shallow copy. Default is `false`.
`shallow_snapshot_v2` | Boolean | Determines whether the snapshot of the remote store indexes are captured as a shallow copy v2. Default is `false`.
`server_side_encryption` | Whether to encrypt snapshot files in the S3 bucket. This setting uses AES-256 with S3-managed keys. See [Protecting data using server-side encryption](https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). Default is `false`. Optional.
`storage_class` | Specifies the [S3 storage class](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) for the snapshots files. Default is `standard`. Do not use the `glacier` and `deep_archive` storage classes. Optional.

Expand Down
3 changes: 2 additions & 1 deletion _api-reference/snapshots/create-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,5 @@ The snapshot definition is returned.
| failures | array | Failures, if any, that occured during snapshot creation. |
| shards | object | Total number of shards created along with number of successful and failed shards. |
| state | string | Snapshot status. Possible values: `IN_PROGRESS`, `SUCCESS`, `FAILED`, `PARTIAL`. |
| remote_store_index_shallow_copy | Boolean | Whether the snapshot of the remote store indexes is captured as a shallow copy. Default is `false`. |
| remote_store_index_shallow_copy | Boolean | Whether the snapshot of the remote store indexes is captured as a shallow copy. Default is `false`. |
| pinned_timestamp | long | Timestamp (in milliseconds) that is pinned by the snapshot for implicit locking of remote store files referenced by the snapshot. |
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PUT /_snapshot/snap_repo
```
{% include copy-curl.html %}

Once enabled, all requests using the [Snapshot API]({{site.url}}{{site.baseurl}}/api-reference/snapshots/index/) will remain the same for all snapshots. After the setting is enabled, we recommend not disabling the setting. Doing so could affect data durability.
Once enabled, all requests using the [Snapshot API]({{site.url}}{{site.baseurl}}/api-reference/snapshots/index/) will remain the same for all snapshots. After the setting is enabled, we recommend not disabling the setting. Doing so could affect data durability.

## Considerations

Expand All @@ -37,3 +37,39 @@ Consider the following before using shallow copy snapshots:
- All nodes in the cluster must use OpenSearch 2.10 or later to take advantage of shallow copy snapshots.
- The `incremental` file count and size between the current snapshot and the last snapshot is `0` when using shallow copy snapshots.
- Searchable snapshots are not supported inside shallow copy snapshots.

# Shallow Snapshot v2 (OpenSearch 2.17+)

Starting with OpenSearch version 2.17, the shallow snapshot feature has been improved with a new version called shallow snapshot v2. This improvement aims to make snapshot operations more efficient and scalable by introducing the following enhancements:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global: Should all instances of "Shallow snapshot v2" be shallow snapshot v2?

* Deterministic Snapshot Operations: Shallow snapshot v2 makes snapshot operations more deterministic, ensuring consistent and predictable behavior.
* Minimized Cluster State Updates: The improvement minimizes the number of cluster state updates required during snapshot operations, reducing overhead and improving performance.
* Scalability: Shallow snapshot v2 allows snapshot operations to scale independently of the number of shards in the cluster, enabling better performance and efficiency for large datasets.

## Enabling Shallow Snapshot v2

To enable the shallow snapshot v2, you need to set two repository settings:

1. remote_store_index_shallow_copy: Set this to true to enable the existing shallow snapshot feature.
2. shallow_snapshot_v2: Set this to true to enable the shallow snapshot v2 improvement.

Here's an example of how to create a repository with both settings enabled:

```bash
PUT /_snapshot/snap_repo
{
"type": "s3",
"settings": {
"bucket": "test-bucket",
"base_path": "daily-snaps",
"remote_store_index_shallow_copy": true,
"shallow_snapshot_v2": true
}
}
```
{% include copy-curl.html %}

## Limitations and Caveats

* Shallow snapshot v2 only work for remote-backed indexes.
* All nodes in the cluster must use OpenSearch 2.17 or later to take advantage of shallow snapshot v2.