Skip to content
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

[Searchable Snapshots] Implement mechanism to specify cache path (API/setting definition/moving cache) #6206

Open
kotwanikunal opened this issue Feb 6, 2023 · 1 comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Searchable Snapshots

Comments

@kotwanikunal
Copy link
Member

Is your feature request related to a problem? Please describe.
The feature request is a part of the overall file caching requirements needed for searchable snapshots.
As an user of searchable snapshots, I should be able to define a custom path for the cache.
Refer to #4964 for further details.

Describe alternatives you've considered
N/A

Additional context

@kotwanikunal kotwanikunal added enhancement Enhancement or improvement to existing feature or request untriaged labels Feb 6, 2023
@kotwanikunal kotwanikunal added Search Search query, autocomplete ...etc and removed untriaged labels Feb 6, 2023
@xuezhou25 xuezhou25 assigned xuezhou25 and unassigned xuezhou25 Feb 6, 2023
@xuezhou25
Copy link
Contributor

xuezhou25 commented Feb 10, 2023

This issue need more discussion because it maybe complex to implement cache moving.

For define the cache path through setting,
Currently, the cache directory is created in this class createRemoteSnapshotDirectoryFromSnapshot
right now, we use same path of shard path for caching

final BlobPath blobPath = new BlobPath().add("indices")
.add(IndexSettings.SEARCHABLE_SNAPSHOT_INDEX_ID.get(indexSettings.getSettings()))
.add(Integer.toString(localShardPath.getShardId().getId()));
final SnapshotId snapshotId = new SnapshotId(
IndexSettings.SEARCHABLE_SNAPSHOT_ID_NAME.get(indexSettings.getSettings()),
IndexSettings.SEARCHABLE_SNAPSHOT_ID_UUID.get(indexSettings.getSettings())
);
Path localStorePath = localShardPath.getDataPath().resolve(LOCAL_STORE_LOCATION);
FSDirectory localStoreDir = FSDirectory.open(Files.createDirectories(localStorePath));

To make this configurable, there is a similar function for user to define custom path through setting like this

public static final Setting<List<String>> PATH_DATA_SETTING = Setting.listSetting(

and then the new defined logic can be used in this class createRemoteSnapshotDirectoryFromSnapshot

Thanks @aabukhalil for his opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Searchable Snapshots
Projects
Status: 🆕 New
Status: Todo
Development

No branches or pull requests

3 participants