-
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
Prevent future convertToMultiNamespaceType migrations #147369
Prevent future convertToMultiNamespaceType migrations #147369
Conversation
Pinging @elastic/kibana-core (Team:Core) |
@@ -37,6 +37,10 @@ import { createIndexMap } from './core/build_index_map'; | |||
import { runResilientMigrator } from './run_resilient_migrator'; | |||
import { migrateRawDocsSafely } from './core/migrate_raw_docs'; | |||
|
|||
// ensure plugins don't try to convert SO namespaceTypes after 8.0.0 | |||
// see https://github.com/elastic/kibana/issues/147344 | |||
const ALLOWED_CONVERT_VERSION = '8.0.0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to @rudolf, but are we sure we don't want to allow type owners to migrate to shareable until some versions to come? This PR basically hard block any type from being converted as soon as merged. I want to make sure we're fine with the consequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I understood correctly, this is a pre-requisite to only migrate an index if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I just saw #147198, but it is converting from "agnostic".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My 2cents are: as claimed in #147344, if we are not reindexing when there are no mapping updates (or, at least, no breaking changes), we cannot support any further version unless we change the current logic to identify that we need reindex anyway because a conversion must happen.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah if someone REALLY REALLY REALLY needs this we'll need to re-enable and detect this to ensure we reindex (which again will introduce downtime).
Re #147198 this is sort of a unique case because it's a new saved object type, there aren't any files
saved objects in users clusters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update the docs accordingly?
- Deprecate the option:
kibana/packages/core/saved-objects/core-saved-objects-server/src/migration.ts
Lines 77 to 80 in 4f4c160
/** * The version in which this object type is being converted to a multi-namespace type */ readonly convertToMultiNamespaceTypeVersion?: string; kibana/packages/core/saved-objects/core-saved-objects-server/src/saved_objects_type.ts
Line 117 in 167797c
convertToMultiNamespaceTypeVersion?: string;
- The documentation page Sharing saved objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is what we want 😅 . LGTM
@@ -345,6 +338,7 @@ function validateMigrationDefinition( | |||
); | |||
} | |||
if (convertToMultiNamespaceTypeVersion) { | |||
// CHECKPOINT 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Checkpoint!
@@ -321,9 +314,9 @@ function validateMigrationDefinition( | |||
throw new Error( | |||
`Invalid convertToMultiNamespaceTypeVersion for type ${type}. Expected value to be a semver, but got '${convertToMultiNamespaceTypeVersion}'.` | |||
); | |||
} else if (Semver.lt(convertToMultiNamespaceTypeVersion, minimumConvertVersion)) { | |||
} else if (convertVersion && Semver.neq(convertToMultiNamespaceTypeVersion, convertVersion)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My gut feeling would have been to keep 8.0.0
as the minimum version and introduces a new maximumConvertVersion
that we would set either to 8.0.0
or the current version like 8.6.0
. But I'm probably overthinking this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could we useful if in the future we wish to unfreeze the functionality.
But at that point, we will probably have to rollback future changes in migration logic as well, otherwise we would have unexpected results.
…amespace-type-migrations
@@ -4,6 +4,7 @@ | |||
This guide describes the "Sharing saved objects" effort, and the breaking changes that plugin developers need to be aware of for the planned | |||
8.0 release of {kib}. It also describes how developers can take advantage of this feature. | |||
|
|||
`From *8.7.0*, as a step towards Zero-Down-Time upgrades, plugins are no longer allowed to switch to shareable saved objects.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Addresses #147344