### Elasticsearch Version

master (& likely more)

### Installed Plugins

Any

### Java Version

_bundled_

### OS Version

Any

### Problem Description

https://github.com/elastic/elasticsearch/pull/84142 is introducing an assertion which verifies that the cluster state we write to disk can be loaded again. https://gradle-enterprise.elastic.co/s/id2j2df47glfe shows that this assertion currently does not hold due to an undeclared field called `xpack/ml/job/snapshot/upgrade`.

```
[2022-02-28T10:58:18,391][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [v8.0.1-2] fatal error in thread [elasticsearch[v8.0.1-2][cluster_coordination][T#1]], exiting
java.lang.AssertionError: org.elasticsearch.gateway.CorruptStateException: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [persistent_tasks] failed to parse field [tasks]
Caused by: org.elasticsearch.gateway.CorruptStateException: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [persistent_tasks] failed to parse field [tasks]
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [persistent_tasks] failed to parse field [tasks]
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [tasks] failed to parse field [task]
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [task] failed to parse field [xpack/ml/job/snapshot/upgrade]
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [named] failed to parse field [params]
Caused by: org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:32756] unknown field [xpack/ml/job/snapshot/upgrade]
```

If a node crashed after writing this state then it would not be able to restart.

### Steps to Reproduce

Run the failing tests on https://github.com/elastic/elasticsearch/pull/84142/commits/3eb6089edb1ead5e33f4a081c4b5a2719d9c4217.

### Logs (if relevant)

<details>
<summary>Expand for stack trace</summary>

```
[2022-02-28T10:58:18,391][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [v8.0.1-2] fatal error in thread [elasticsearch[v8.0.1-2][cluster_coordination][T#1]], exiting
java.lang.AssertionError: org.elasticsearch.gateway.CorruptStateException: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [persistent_tasks] failed to parse field [tasks]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1020) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.commit(PersistedClusterStateService.java:1007) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.writeIncrementalStateAndCommit(PersistedClusterStateService.java:823) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.GatewayMetaState$LucenePersistedState.setLastAcceptedState(GatewayMetaState.java:507) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.coordination.CoordinationState.handlePublishRequest(CoordinationState.java:392) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.coordination.Coordinator.handlePublishRequest(Coordinator.java:418) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.coordination.PublicationTransportHandler.acceptState(PublicationTransportHandler.java:203) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.coordination.PublicationTransportHandler.handleIncomingPublishRequest(PublicationTransportHandler.java:183) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.coordination.PublicationTransportHandler.lambda$new$0(PublicationTransportHandler.java:103) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$1.doRun(SecurityServerTransportInterceptor.java:253) ~[?:?]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:315) ~[?:?]
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler$3.onResponse(SecurityServerTransportInterceptor.java:305) ~[?:?]
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeSystemUser(AuthorizationService.java:610) ~[?:?]
	at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:251) ~[?:?]
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.lambda$inbound$1(ServerTransportFilter.java:113) ~[?:?]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.action.ActionListener$MappedActionListener.onResponse(ActionListener.java:101) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:93) ~[?:?]
	at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:199) ~[?:?]
	at org.elasticsearch.xpack.security.transport.ServerTransportFilter.inbound(ServerTransportFilter.java:105) ~[?:?]
	at org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor$ProfileSecuredRequestHandler.messageReceived(SecurityServerTransportInterceptor.java:326) ~[?:?]
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:67) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:287) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:776) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.elasticsearch.gateway.CorruptStateException: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [persistent_tasks] failed to parse field [tasks]
	at org.elasticsearch.gateway.PersistedClusterStateService.readXContent(PersistedClusterStateService.java:539) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.lambda$loadOnDiskState$2(PersistedClusterStateService.java:493) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.consumeFromType(PersistedClusterStateService.java:580) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.loadOnDiskState(PersistedClusterStateService.java:492) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1016) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	... 28 more
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [persistent_tasks] failed to parse field [tasks]
	at org.elasticsearch.xcontent.ObjectParser.throwFailedToParse(ObjectParser.java:626) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:621) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseArray(ObjectParser.java:614) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:647) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:392) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.fromXContent(PersistentTasksCustomMetadata.java:208) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry$Entry.lambda$new$0(NamedXContentRegistry.java:54) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:147) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:416) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.metadata.Metadata$Builder.fromXContent(Metadata.java:2188) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.readXContent(PersistedClusterStateService.java:537) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.lambda$loadOnDiskState$2(PersistedClusterStateService.java:493) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.consumeFromType(PersistedClusterStateService.java:580) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.loadOnDiskState(PersistedClusterStateService.java:492) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1016) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	... 28 more
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [tasks] failed to parse field [task]
	at org.elasticsearch.xcontent.ObjectParser.throwFailedToParse(ObjectParser.java:626) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:621) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:633) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$20(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.parseArray(AbstractObjectParser.java:418) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$21(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareField$10(ObjectParser.java:441) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseArray(ObjectParser.java:614) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:647) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:392) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.fromXContent(PersistentTasksCustomMetadata.java:208) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry$Entry.lambda$new$0(NamedXContentRegistry.java:54) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:147) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:416) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.metadata.Metadata$Builder.fromXContent(Metadata.java:2188) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.readXContent(PersistedClusterStateService.java:537) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.lambda$loadOnDiskState$2(PersistedClusterStateService.java:493) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.consumeFromType(PersistedClusterStateService.java:580) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.loadOnDiskState(PersistedClusterStateService.java:492) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1016) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	... 28 more
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [task] failed to parse field [xpack/ml/job/snapshot/upgrade]
	at org.elasticsearch.xcontent.ObjectParser.rethrowFieldParseFailure(ObjectParser.java:564) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObjects$14(ObjectParser.java:504) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObjects$15(ObjectParser.java:515) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:633) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$20(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.parseArray(AbstractObjectParser.java:418) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$21(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareField$10(ObjectParser.java:441) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseArray(ObjectParser.java:614) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:647) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:392) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.fromXContent(PersistentTasksCustomMetadata.java:208) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry$Entry.lambda$new$0(NamedXContentRegistry.java:54) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:147) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:416) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.metadata.Metadata$Builder.fromXContent(Metadata.java:2188) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.readXContent(PersistedClusterStateService.java:537) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.lambda$loadOnDiskState$2(PersistedClusterStateService.java:493) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.consumeFromType(PersistedClusterStateService.java:580) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.loadOnDiskState(PersistedClusterStateService.java:492) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1016) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	... 28 more
Caused by: org.elasticsearch.xcontent.XContentParseException: [-1:32756] [named] failed to parse field [params]
	at org.elasticsearch.xcontent.ObjectParser.throwFailedToParse(ObjectParser.java:626) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:621) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:633) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.lambda$static$3(PersistentTasksCustomMetadata.java:97) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObjects$14(ObjectParser.java:502) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObjects$15(ObjectParser.java:515) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:633) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$20(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.parseArray(AbstractObjectParser.java:418) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$21(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareField$10(ObjectParser.java:441) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseArray(ObjectParser.java:614) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:647) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:392) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.fromXContent(PersistentTasksCustomMetadata.java:208) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry$Entry.lambda$new$0(NamedXContentRegistry.java:54) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:147) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:416) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.metadata.Metadata$Builder.fromXContent(Metadata.java:2188) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.readXContent(PersistedClusterStateService.java:537) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.lambda$loadOnDiskState$2(PersistedClusterStateService.java:493) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.consumeFromType(PersistedClusterStateService.java:580) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.loadOnDiskState(PersistedClusterStateService.java:492) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1016) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	... 28 more
Caused by: org.elasticsearch.xcontent.NamedObjectNotFoundException: [-1:32756] unknown field [xpack/ml/job/snapshot/upgrade]
	at org.elasticsearch.xcontent.NamedXContentRegistry.lookupParser(NamedXContentRegistry.java:162) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:146) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:416) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.lambda$static$1(PersistentTasksCustomMetadata.java:89) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareField$10(ObjectParser.java:441) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:633) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.lambda$static$3(PersistentTasksCustomMetadata.java:97) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObjects$14(ObjectParser.java:502) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareNamedObjects$15(ObjectParser.java:515) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:633) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$20(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.parseArray(AbstractObjectParser.java:418) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareFieldArray$21(AbstractObjectParser.java:336) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.lambda$declareField$10(ObjectParser.java:441) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:619) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseArray(ObjectParser.java:614) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:647) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:319) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:258) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:392) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.persistent.PersistentTasksCustomMetadata.fromXContent(PersistentTasksCustomMetadata.java:208) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry$Entry.lambda$new$0(NamedXContentRegistry.java:54) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.NamedXContentRegistry.parseNamedObject(NamedXContentRegistry.java:147) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.xcontent.support.AbstractXContentParser.namedObject(AbstractXContentParser.java:416) ~[elasticsearch-x-content-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.cluster.metadata.Metadata$Builder.fromXContent(Metadata.java:2188) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.readXContent(PersistedClusterStateService.java:537) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.lambda$loadOnDiskState$2(PersistedClusterStateService.java:493) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.consumeFromType(PersistedClusterStateService.java:580) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService.loadOnDiskState(PersistedClusterStateService.java:492) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	at org.elasticsearch.gateway.PersistedClusterStateService$Writer.assertOnCommit(PersistedClusterStateService.java:1016) ~[elasticsearch-8.2.0-SNAPSHOT.jar:8.2.0-SNAPSHOT]
	... 28 more
```
</details>
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java
import org.elasticsearch.xpack.core.ml.action.MlInfoAction;
import org.elasticsearch.xpack.core.ml.action.OpenJobAction;
import org.elasticsearch.xpack.core.ml.action.PersistJobAction;
import org.elasticsearch.xpack.core.ml.action.PostCalendarEventsAction;
import org.elasticsearch.xpack.core.ml.action.PostDataAction;
import org.elasticsearch.xpack.core.ml.action.PreviewDatafeedAction;
import org.elasticsearch.xpack.core.ml.action.PutCalendarAction;
import org.elasticsearch.xpack.core.ml.action.PutDataFrameAnalyticsAction;
import org.elasticsearch.xpack.core.ml.action.PutDatafeedAction;
import org.elasticsearch.xpack.core.ml.action.PutFilterAction;
import org.elasticsearch.xpack.core.ml.action.PutJobAction;
import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction;
import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction;
import org.elasticsearch.xpack.core.ml.action.SetUpgradeModeAction;
import org.elasticsearch.xpack.core.ml.action.StartDataFrameAnalyticsAction;
import org.elasticsearch.xpack.core.ml.action.StartDatafeedAction;
import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction;
import org.elasticsearch.xpack.core.ml.action.UpdateCalendarJobAction;
import org.elasticsearch.xpack.core.ml.action.UpdateDataFrameAnalyticsAction;
import org.elasticsearch.xpack.core.ml.action.UpdateDatafeedAction;
import org.elasticsearch.xpack.core.ml.action.UpdateFilterAction;
import org.elasticsearch.xpack.core.ml.action.UpdateJobAction;
import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction;
import org.elasticsearch.xpack.core.ml.action.UpdateProcessAction;
import org.elasticsearch.xpack.core.ml.action.ValidateDetectorAction;
import org.elasticsearch.xpack.core.ml.action.ValidateJobConfigAction;
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedState;
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsTaskState;
import org.elasticsearch.xpack.core.ml.job.config.JobTaskState;
import org.elasticsearch.xpack.core.ml.job.snapshot.upgrade.SnapshotUpgradeTaskState;