-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Refuse to start with unknown saved object types in 8.0 #107678
Comments
Pinging @elastic/kibana-core (Team:Core) |
Discussed this with @rudolf and @pgayvallet -- The main concern with solution (2) is around how to handle SO references:
|
I think it's actually the inbound references to the quarantined object that would break. When a type is unknown we don't know if we should regenerate the id's (it might be a single namespace type which doesn't require regeneration) so inbound references are left intact. When this type later becomes known we might regenerate it's id, but we wouldn't regenerate the inbound references.
For performance we don't want to resolve id's on every operation e.g. an update or get, so resolve only happens in the plugin code where that plugin expects to be handling user input (e.g. an url with an id). I think we have a few options that we could explore to solve this problem, but all of them means changes to a complex system that's quite hard to reason about and change. So perhaps we first need to establish whether this is a high enough priority from a product perspective? |
We have reached the following decision to be implemented in 8.0 Doing nothing in 8.0 is problematically lenient: if we don't implement a way to handle these cases, we risk causing data loss or corruption for users. Rather than allowing this, we'd prefer to fail fast with a clear message outlining the problem. |
FWIW, this is what we were doing before #105213, so implementing this should in theory just be a revert of the linked PR. |
Update: to protect users data we have decided to prevent upgrades from succeeding if unknown saved object types are encountered.
Context (newest-oldest) on this discussion:
In order to improve the reliability of the Saved Object migration system, we'd need to eliminate situations that can cause data integrity issues. One of those situations is with how we currently handle objects of unknown types. The current behavior will retain these documents in the Kibana index, unmodified from their previous state. Whenever the type becomes known again (by re-enabling a plugin), Kibana will migrate this document to the most recent schema.
Supporting this is becoming ever more challenging as we expand our ability to do different types of migrations. For example, this behavior will result in corrupted state if there are any other objects that reference objects of a disabled type during the multi-namespace migration and then that type is enabled again later.
Data integrity is important for the long-term maintenance of a Kibana installation and is especially important to long-term, wide-scale users of Kibana. If we want to eliminate this type of data corruption, then we need to take some action here to prevent such scenarios.
The scenario where the migration system encounters objects of unknown types can occur in the following situations:
First-party plugins
Third-party plugins
Solutions
For users that only use 1st party plugins the solution seems quite straightforward. Given that we've already made progress on mitigating the ways this issue could happen, we either:
(2) is preferable from a user perspective since it unblocks users from upgrading Kibana quickly, but has the drawback of 'silently' excluding documents.
The challenge is how can we handle the scenario with 3rd party plugins where they may not be installed during an upgrade. I propose we go with solution (2) and add a mechanism for importing & migrating documents from the .kibana-orphaned index that are detected as now being known by any plugin. This allows us to keep the default, happy path as safe as possible while giving more advanced users a way to recover their data in ways that may or may not be 100% integral. This mechanism could be exposed via either a config option or a UI prompt to import these objects after Kibana has started (which has some drawbacks but may work for most 3rd party plugins).
For customers that absolutely need 100% data integrity, we can recommend they ensure that all 3rd party plugins are installed during their upgrade rather than afterwards. For all others, we have an escape hatch that will probably work most of the time, but is not guaranteed and therefore not enabled by default.
The text was updated successfully, but these errors were encountered: