-
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
[Meta] Validate plugins compatibility with segment replication #8211
Comments
Related, remote store compat with system indices is broken until #8193 is resolved. |
@opensearch-project/admin : Request to add |
@dreamer-89 , @Rishikesh1159 can you please share a sample test that we can refer to which we need to add to create system indices and verify that if system/hidden indices in a given plugin work correctly with segment replication? |
Thanks you @minalsha for your question. Sharing below details on how to create segment replication indices and adding tests. Please have a look and let me know if you have more questions. Create segment replication indicesThere are two ways you can enable segment replication for an index as mentioned below. The documentation also covers this. Cluster level settingUse cluster level setting to create all indices with segment replication. This setting takes 1)
Index level setting (overrides cluster level setting)To enable segment replication at index level, we can pass in
Though, it is easier to follow the option of using
Adding testsThere are two options to add tests. But, please ensure your test uses > 0 number of replica shards
ValidationsThe validation may vary from different plugins and I will leave it to plugin owners to decide that. At minimum, you need to verify that your shards (both primary and replica) have same number of documents and are searchable. |
Hey @dreamer-89 I'm trying to use this programmatically when creating a system index to make sure The current code uses CreateIndexRequest request = new CreateIndexRequest(LOCK_INDEX_NAME) ... So in my case if I create a settings object to pass a setting "replication.type" (which is probably a constant somewhere) of "DOCUMENT" (which is an enum) this now becomes: CreateIndexRequest request = new CreateIndexRequest(LOCK_INDEX_NAME, replicationSettings) ... this would always have that index set document even if the user chose SEGMENT for their cluster, correct? |
Thanks @dbwiddis for your comment. Yes index level |
@dreamer-89 Understood. To be clear:
In Job Scheduler, a system index is used for locking in highly parallel, performance-sensitive use cases. We absolutely need a way for users in these use cases to change this. And while the "change the index setting" works for other indices, changing settings on system indices has more safeguards. I take your comment above " What, then, is the correct action for a performance-sensitive application that does not want WAIT_UNTIL on their system index to take here? |
To echo @dbwiddis, I am concerned with the effect that these changes will have on other sensitive system index use cases. With the current security model, we make use of a system index to store important user information such as internal role mapping. With opensearch-project/security#2903, we appear to handle the consistency issue which arises with the replication. However, we still don't account for the performance impact of copying the system index repeatedly. We already run into performance concerns due to reloading the nodes every time there is a configuration change related to Security: opensearch-project/security#2443. With this change, I am concerned we would be significantly increasing the cost as we now would need to update the duplicated system index frequently. Perhaps I am conflating the processes at hand here, but I do think we should aim for verifiable performance metrics before making such a significant change. |
I have a question on this:
In case of primary shard failure, does a replica get all the update before it gets promoted to primary? Otherwise strong read isn't guaranteed even if we read only from primary. |
@seankao-az |
Today with document replication only way to get strong reads is with GET request by ID (which reads from translog independent of refresh cycle) or use the RefreshPolicy.WAIT_UNTIL during ingest followed by issuing a search request. Segment Replication does not currently support either of these mechanisms. With WAIT_UNTIL the write would be ack'd only after the primary has made the docs searchable, the replicas would still be in the process of syncing. To achieve strong read after this request is made the search would also need to prefer primary to achieve a strong read. There is no reason (that I'm currently aware of) why we can't support get by id. This is a miss - I made an issue here to support this.
Yes, in failover case the new primary catches up before serving reads or new writes. |
Hi @dbwiddis, Yes, if primary shard based searching does not work for you, then your plan as mentioned in job-scheduler issue sounds right to me. |
Closing this issue as all plugins except alerting have done necessary changes for compatibility with SEGMENT replication feature. For alerting, created a separate issue on core to fix #9669 and created documentation issue to mark this as limitation in opensearch-project/documentation-website#4967 CC @anasalkouz @mch2 |
Summary
With 2.9.0 release, there are lot of enhancements going in for segment replication[1][2] feature (went GA in 2.7.0), we need to ensure different plugins are compatible with current state of this feature. Previously, we ran tests on plugin repos to verify this compatibility but want plugin owners to be aware of these changes so that required updates (if any) can be made. With
2.10.0
release, remote store feature is going GA which internally uses SEGMENT replication strategy only i.e. it enforces all indices to useSEGMENT
replication strategy. So, it is important to validate plugins are compatible with segment replication feature.What changed
1. Refresh policy behavior
2. Refresh lag on replicas
With segment replication, there is inherent delay in documents to be searchable on replica shard copies. This is due to the fact that replica shard copies over data (segment) files from primary. Thus, compared to document replication, there will be on average increase in amount of time the replica shards are consistent with primaries.
3. System/hidden indices support
With #8200, system and hidden indices are now supported with
SEGMENT
replication strategy. We need to ensure there are no bottlenecks which prevents system/hidden indices with segment replication.Next steps
With segment replication strong reads are not guaranteed. Thus, if the plugin needs strong reads guarantees specially as alternative to change in behavior of refresh policy and lag on replicas (point 1 and 2 above), we need to update search requests to target primary shard only. With #7375, core now supports primary shards only based search. Please follow documentation for examples and details
Open questions
In case of any questions or issues, please post your question on core
Reference
[1] Design
[2] Documentation
Opensearch Plugins
OpenSearch-dashboard plugins
The text was updated successfully, but these errors were encountered: