-
Notifications
You must be signed in to change notification settings - Fork 25.4k
[Transform] Auto-migrate max_page_search_size #119348
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
Conversation
`max_page_search_size` had been deprecated in Pivot and migrated to Settings in ES 7.x. We are removing the key in Pivot in 9.x. It is still possible to create Pivots with `max_page_search_size`, though a deprecation is logged. To prep for its removal, this change automatically migrates `max_page_search_size` from Pivot to Settings as if the user called `_update`. - `PUT _transform` with `max_page_search_size` in Pivot will migrate the value to Settings as part of the Transform's creation. The user will receive an additional deprecation warning informing of this migration. - Existing transforms with `max_page_search_size` in Pivot will migrate the value to Settings as part of node assignment during start. Transform Messages and Elasticsearch logs will record this event so users will know what happened.
Hi @prwhelan, I've created a changelog YAML for you. |
Pinging @elastic/ml-core (Team:ML) |
assertThat(createTransformResponse.get("acknowledged"), equalTo(Boolean.TRUE)); | ||
|
||
Map<String, Object> transform = getTransformConfig(transformId, BASIC_AUTH_VALUE_TRANSFORM_ADMIN_WITH_SOME_DATA_ACCESS); | ||
assertThat(XContentMapValues.extractValue("pivot.max_page_search_size", transform), equalTo(null)); |
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.
Minor: Can just use assertNull
here.
.withThrowable(validationException) | ||
.log( | ||
"Failed to validate auto-migrated Config. Please use the _update API to correct and update " | ||
+ "the Transform configuration. Continuing with old config." |
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.
Minor: Extra whitespace in between sentences.
private TransformConfig autoMigrateConfig(Request request) { | ||
var config = transformConfigAutoMigration.migrate(request.getConfig()); | ||
if (config != request.getConfig()) { | ||
deprecationLogger.warn( |
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.
Could this logging logic be contained within the transformConfigAutoMigration.migrate(...)
function logic? Seems like something we'd want to happen whenever we call migrate and adding the logic there instead would also add a deprecation log when we call migrateAndSave
.
import static org.mockito.Mockito.verify; | ||
import static org.mockito.Mockito.verifyNoInteractions; | ||
|
||
public class TransformConfigAutoMigrationTests extends ESTestCase { |
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.
Can we add a test for when the transform has a max_page_search_size
in both pivot config and settings and we just set the value to null? I know it's not a case we expect to actually hit but the code does specifically has this as an implementation decision we made so it's nice to have a test for it so we don't accidentally change this behavior.
@elasticmachine update branch |
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.
LGTM!
@elasticmachine update branch |
@elasticmachine update branch |
Verified with latest changes, settings
|
`max_page_search_size` had been deprecated in Pivot and migrated to Settings in ES 7.x. We are removing the key in Pivot in 9.x. It is still possible to create Pivots with `max_page_search_size`, though a deprecation is logged. To prep for its removal, this change automatically migrates `max_page_search_size` from Pivot to Settings as if the user called `_update`. - `PUT _transform` with `max_page_search_size` in Pivot will migrate the value to Settings as part of the Transform's creation. The user will receive an additional deprecation warning informing of this migration. - Existing transforms with `max_page_search_size` in Pivot will migrate the value to Settings as part of node assignment during start. Transform Messages and Elasticsearch logs will record this event so users will know what happened.
`max_page_search_size` had been deprecated in Pivot and migrated to Settings in ES 7.x. We are removing the key in Pivot in 9.x. It is still possible to create Pivots with `max_page_search_size`, though a deprecation is logged. To prep for its removal, this change automatically migrates `max_page_search_size` from Pivot to Settings as if the user called `_update`. - `PUT _transform` with `max_page_search_size` in Pivot will migrate the value to Settings as part of the Transform's creation. The user will receive an additional deprecation warning informing of this migration. - Existing transforms with `max_page_search_size` in Pivot will migrate the value to Settings as part of node assignment during start. Transform Messages and Elasticsearch logs will record this event so users will know what happened.
max_page_search_size
had been deprecated in Pivot and migrated to Settings in ES 7.x. We are removing the key in Pivot in 9.x. It is still possible to create Pivots withmax_page_search_size
, though a deprecation is logged. To prep for its removal, this change automatically migratesmax_page_search_size
from Pivot to Settings as if the user called_update
.PUT _transform
withmax_page_search_size
in Pivot will migrate the value to Settings as part of the Transform's creation. The user will receive an additional deprecation warning informing of this migration.max_page_search_size
in Pivot will migrate the value to Settings as part of node assignment during start. Transform Messages and Elasticsearch logs will record this event so users will know what happened.