-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Ability to obtain an index's name from its UUID. #13001
Comments
This mapping could be easily obtained using
|
From an internal API standpoint, if you have a reference to
|
Thanks @reta and @msfroh. One of our constraints is as follows. |
Would Plugin.onIndexModule be useful here? I tried the snippet that @msfroh provided using the GuiceHolder pattern in a plugin to get the indices service and tried to get the indexName within Plugin.createComponents or ClusterPlugin.onNodeStarted, but neither worked and the IndexService returned from Before the node is fully initialized, Plugin.onIndexModule is called for every index in the cluster where you can obtain the index name and UUID for all indices in the cluster. On Node bootstrap, you may see messages like:
and this line directly comes from
Example of security plugin overriding onIndexModule: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java#L664-L665 |
@cwperks Thanks. This looks promising. I will run it by my engineering team. Will comment again in a few days. Much appreciated. |
@cwperks Also an alternative option could be store this Any pointers would be helpful. |
@anto-tl I do see this when I look in the data directory of a node:
Where
It is on disk, but I'm not sure of how to read that in from a plugin before |
@cwperks Thanks for checking the details.
So to avoid complexity, I am looking for a way to do an internal call using code itself from plugin to get I found that RestIndicesAction class is used for _cat/indices call internally. Any idea how to call this class method in plugin to get the |
@cwperks Any idea? I have also tried multiple Listeners like |
@anto-tl could you please clarify what you mean by
|
Calling: Store.tryOpenIndexCalling: Lucene.readSegmentInfos
Note: |
Ah I see, thanks @anto-tl for detailed explanation ... The The sequence of initialization looks valid to me: the index has to be initialized first before |
Hello @reta Thanks for the pointer on |
@reta Is there a way to get |
@anto-tl I don't think you could alter Besides that, I think we are getting to the end of the possible options, it seems like the feature you are working on needs to be looked to suggest the path forward. |
@reta Will take a look. Explained the multi node problem here and this is why wanted to external api call. If mTLS enabled (or) call goes to other on startup we can't get the needed _cat/indices response, that's why wanted to avoid external api call. |
I thought you run into initialization sequence here, when the cluster was not ready to handle the requests when you called the API? In any case,
The |
@reta Thanks. If possible can you send some code snippet example for how to call Also more more clarification: When we use the |
@reta Finally I have found one way to get indexName and uuid mapping on the startup by below code Works
Not worked
|
Is your feature request related to a problem? Please describe
Portal26 (AWS Partner) builds and sells a plugin for OpenSearch. Among other things the plugin adds encryption at rest for the data written to the file system. Customers can specify different encryption keys for different indices. In order to do this, customers must maintain a mapping between an index's UUID and the encryption key that must be used for it.
Some of our customers run their SaaS business on top of OpenSearch. They tend to have 100s of indices for each of their customers. And they host 10s of such customer on one cluster. Maintaining a mapping with between 1,000s of UUIDs to their corresponding encryption key becomes error-prone.
They happen to have a index naming convention where the index names start with a unique_customer_name. They want to maintain a mapping between index name prefix to encryption key.
The Lucene Codec plugin that Portal26 implements does not get index name. Instead it gets a file system location that contains the indices' UUID. Portal26 would like to get the index's name from its UUID.
This way we can support our customers to maintain a mapping between Index Name Prefix to Encryption Key. And we can translate the UUID to its index name and then retrieve the key.
Describe the solution you'd like
An internal API/ method which accepts an index's UUID and return's the index's name.
Related component
Indexing
Describe alternatives you've considered
We have considered building and maintaining a mapping within the plugin. But since the plugin does not persist anything (it is stateless) it has to build and maintain this in memory and it could be an expensive operation. And every time a new index is added, it has to modify this mapping which could involve periodic polling adding to the cluster workload.
Additional context
The customer who wants this is Pega systems. They asked us to tag them in this ticket. They will also voice their vote on the ticket.
The text was updated successfully, but these errors were encountered: