Use modelVersions instead of hashes to track changes in SO types#176803
Use modelVersions instead of hashes to track changes in SO types#176803gsoldevila merged 29 commits intoelastic:mainfrom
Conversation
jloleysens
left a comment
There was a problem hiding this comment.
Overall approach makes sense to me to facilitate the transition away from md5 hashes. I left a few comments!
There was a problem hiding this comment.
nit: it's a little funky that migrationMappingPropertyHashes will no longer contain hashes, but doesn't seem worth the upheaval of changing it and seems like something we need to keep bwc support for anyway.
Don't have a good solution in mind right now other than tracking it for later and adding a comment on wherever this type is defined.
There was a problem hiding this comment.
Thinking about it, I think I'll switch to the same property names used on ZDT algorithm: appVersions and docVersions. This way, I will not impact the existing hashes field (which will simply be deprecated).
I believe the advantages of doing this are worth it:
- We will not be reusing a property with an outdated / misleading name.
- We will align with the _meta stored by the ZDT algorithm, which could, in the future, facilitate transition from Cloud to Serverless.
- If a migration fails or Kibana fails to start after a migration, and a rollback is performed, the previous version using hashes will still have the hashes field in place. This will prevent the migration logic from picking up ALL types (this could be a costly operation for large customers).
There was a problem hiding this comment.
If I understand this correctly: we need to know for sure that this map correctly reflects hashes for the previous 8.x release in order to know we will have "hits" for this md5 hashes. For non-stack releases, to my knowledge this is only serverless, we accept that this static map may have misses? Am I following correctly 😄
If that's true I'd consider naming this file something like 8_13_0_hash_to_version_map.json since that is the last stack version where we will be storing hashes in migrationMappingPropertyHashes.
There was a problem hiding this comment.
nit: might be worth adding a README.md explaining the purpose/reason of this file (transitioning off of md5)
There was a problem hiding this comment.
Agree to both comments!
There was a problem hiding this comment.
For non-stack releases, to my knowledge this is only serverless, we accept that this static map may have misses?
On serverless we use the ZDT algorithm, which uses the mappingVersions and docVersions instead of the migrationMappingPropertyHashes, so this change only impacts cloud and on prem.
There was a problem hiding this comment.
nit: might be worth adding a README.md explaining the purpose/reason of this file (transitioning off of md5)
Added a description (now a const instead of a JSON file).
pgayvallet
left a comment
There was a problem hiding this comment.
A few NITs and questions, but the approach looks fine to me
There was a problem hiding this comment.
Asking as I'm not sure anymore: Could left.updatedHashes contain root fields (e.g namespace and so on) in addition to types previously, and did that change in that PR in left.updatedTypes?
There was a problem hiding this comment.
The modelVersion logic is currently not including the root fields, so with the PR we're not storing model versions for them in the _meta.
I have an update on the pipes to preserve existing behavior, and what I propose is to deep compare the mappings objects for the root fields (which are pretty simple). This way, the updated types will handle comparison of SO types through their modelVersions and comparison of root fields through deep compare of their mappings.
It will emit 2 different Left responses depending on which of them has changed (root_fields_changed vs types_changed), which in turn will simplify the logic in model.ts.
WDYT?
There was a problem hiding this comment.
NIT: I know this was there already, but can somehow use something more precise than any for those parameters?
There was a problem hiding this comment.
NIT: why is the import * as XXX required here compared to import XXX from ?
There was a problem hiding this comment.
It was not apparently. I have moved it to constants.ts on @kbn/core-saved-objects-base-server-internal.
There was a problem hiding this comment.
NIT: I see it defaults to HASH_TO_VERSION_MAP, but I think I'd still rather have the new parameter not optional, wdyt?
There was a problem hiding this comment.
Sounds good to me, we'll be more consistent with similar params that are being passed 👌🏼
There was a problem hiding this comment.
Is it possible to tighten the types and remove any?
There was a problem hiding this comment.
(now part of diff_mappings.ts)
Fixed in the latest updates
There was a problem hiding this comment.
When a type's metadata isn't available in the index actual[type] will be undefined so indexHashOrVersion could also be undefined.
There was a problem hiding this comment.
(Now part of compare_mappings.ts)
Correct, this has been made optional in the latest updates.
There was a problem hiding this comment.
${type}|${indexHashOrVersion} can type ever be undefined?
There was a problem hiding this comment.
(Now part of compare_mappings.ts)
type cannot be undefined, as we loop through the different types from the registry.
On the other hand, indexHashOrVersion could be undefined (e.g. if it is a new type).
In this scenario, searching for type|undefined in the map would yield no results, and thus that type would be considered as updated.
db3ff4c to
8cb7af1
Compare
4223d6a to
99d8ea8
Compare
b4eebbf to
cd0e33f
Compare
…appings_addition`s
8ca46c7 to
05fa106
Compare
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @gsoldevila |
## Summary Follow-up of #176803 Now that `8.14` has been branched and it is about to be released, we can remove the test that ensures the `HASH_TO_VERSION_MAP` is aligned. This PR also rolls back a few changes on the map that shouldn't have been performed, as they belong to `8.15.0`.
## Summary Follow-up of elastic#176803 Now that `8.14` has been branched and it is about to be released, we can remove the test that ensures the `HASH_TO_VERSION_MAP` is aligned. This PR also rolls back a few changes on the map that shouldn't have been performed, as they belong to `8.15.0`. (cherry picked from commit ed2e59f)
# Backport This will backport the following commits from `main` to `8.14`: - [Kbn 176803 cleanup 8.14 md5 check (#183416)](#183416) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2024-05-15T09:37:42Z","message":"Kbn 176803 cleanup 8.14 md5 check (#183416)\n\n## Summary\r\n\r\nFollow-up of #176803\r\n\r\nNow that `8.14` has been branched and it is about to be released, we can\r\nremove the test that ensures the `HASH_TO_VERSION_MAP` is aligned.\r\n\r\nThis PR also rolls back a few changes on the map that shouldn't have\r\nbeen performed, as they belong to `8.15.0`.","sha":"ed2e59fea95b39dcc853f948ce122544515370f0","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","backport:prev-minor","Feature:FIPS","v8.15.0"],"title":"Kbn 176803 cleanup 8.14 md5 check","number":183416,"url":"https://github.com/elastic/kibana/pull/183416","mergeCommit":{"message":"Kbn 176803 cleanup 8.14 md5 check (#183416)\n\n## Summary\r\n\r\nFollow-up of #176803\r\n\r\nNow that `8.14` has been branched and it is about to be released, we can\r\nremove the test that ensures the `HASH_TO_VERSION_MAP` is aligned.\r\n\r\nThis PR also rolls back a few changes on the map that shouldn't have\r\nbeen performed, as they belong to `8.15.0`.","sha":"ed2e59fea95b39dcc853f948ce122544515370f0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/183416","number":183416,"mergeCommit":{"message":"Kbn 176803 cleanup 8.14 md5 check (#183416)\n\n## Summary\r\n\r\nFollow-up of #176803\r\n\r\nNow that `8.14` has been branched and it is about to be released, we can\r\nremove the test that ensures the `HASH_TO_VERSION_MAP` is aligned.\r\n\r\nThis PR also rolls back a few changes on the map that shouldn't have\r\nbeen performed, as they belong to `8.15.0`.","sha":"ed2e59fea95b39dcc853f948ce122544515370f0"}}]}] BACKPORT--> Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in #176803
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in elastic#176803 (cherry picked from commit 8de3636)
…197573) # Backport This will backport the following commits from `main` to `8.16`: - [Update mappings if/when new SO types are introduced (#197061)](#197061) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T08:21:43Z","message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","v8.16.0","v8.15.3"],"title":"Update mappings if/when new SO types are introduced","number":197061,"url":"https://github.com/elastic/kibana/pull/197061","mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197061","number":197061,"mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in elastic#176803 (cherry picked from commit 8de3636) # Conflicts: # src/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts # src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kb_nodes.test.ts # src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.fixtures.ts
## Summary Addresses elastic/elastic-entity-model#70 Fixes regression introduced in elastic#176803 (cherry picked from commit 8de3636) # Conflicts: # src/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts
…197598) # Backport This will backport the following commits from `main` to `8.15`: - [Update mappings if/when new SO types are introduced (#197061)](#197061) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T08:21:43Z","message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","v8.16.0","v8.15.3"],"number":197061,"url":"https://github.com/elastic/kibana/pull/197061","mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197061","number":197061,"mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/197573","number":197573,"state":"MERGED","mergeCommit":{"sha":"3687435cb4531b1a0470abf42f69a420e2041cd2","message":"[8.16] Update mappings if/when new SO types are introduced (#197061) (#197573)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.16`:\n- [Update mappings if/when new SO types are introduced\n(#197061)](https://github.com/elastic/kibana/pull/197061)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Gerard\nSoldevila\",\"email\":\"gerard.soldevila@elastic.co\"},\"sourceCommit\":{\"committedDate\":\"2024-10-24T08:21:43Z\",\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"Team:Core\",\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\",\"backport:prev-major\",\"v8.16.0\",\"v8.15.3\"],\"title\":\"Update\nmappings if/when new SO types are\nintroduced\",\"number\":197061,\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.16\",\"8.15\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"number\":197061,\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},{\"branch\":\"8.16\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.15\",\"label\":\"v8.15.3\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>"}},{"branch":"8.15","label":"v8.15.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…197597) # Backport This will backport the following commits from `main` to `8.x`: - [Update mappings if/when new SO types are introduced (#197061)](#197061) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T08:21:43Z","message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","v8.16.0","v8.15.3"],"number":197061,"url":"https://github.com/elastic/kibana/pull/197061","mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197061","number":197061,"mergeCommit":{"message":"Update mappings if/when new SO types are introduced (#197061)\n\n## Summary\r\n\r\nAddresses https://github.com/elastic/elastic-entity-model/issues/70\r\nFixes regression introduced in\r\nhttps://github.com//pull/176803","sha":"8de3636e43be7c874b2c3457f1496a0fc31f224d"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/197573","number":197573,"state":"MERGED","mergeCommit":{"sha":"3687435cb4531b1a0470abf42f69a420e2041cd2","message":"[8.16] Update mappings if/when new SO types are introduced (#197061) (#197573)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.16`:\n- [Update mappings if/when new SO types are introduced\n(#197061)](https://github.com/elastic/kibana/pull/197061)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Gerard\nSoldevila\",\"email\":\"gerard.soldevila@elastic.co\"},\"sourceCommit\":{\"committedDate\":\"2024-10-24T08:21:43Z\",\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"Team:Core\",\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\",\"backport:prev-major\",\"v8.16.0\",\"v8.15.3\"],\"title\":\"Update\nmappings if/when new SO types are\nintroduced\",\"number\":197061,\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.16\",\"8.15\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/197061\",\"number\":197061,\"mergeCommit\":{\"message\":\"Update\nmappings if/when new SO types are introduced (#197061)\\n\\n##\nSummary\\r\\n\\r\\nAddresses\nhttps://github.com/elastic/elastic-entity-model/issues/70\\r\\nFixes\nregression introduced\nin\\r\\nhttps://github.com//pull/176803\",\"sha\":\"8de3636e43be7c874b2c3457f1496a0fc31f224d\"}},{\"branch\":\"8.16\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.15\",\"label\":\"v8.15.3\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>"}},{"branch":"8.15","label":"v8.15.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
Address #169734 .
We're currently storing information about Saved Object types in the
<index>.mapping._meta.More specifically, we're storing hashes of the mappings of each type, under the
migrationMappingPropertyHashesproperty.This allows us to detect which types' mappings have changed, in order to update and pick up changes only for those types.
The problem is that
md5cannot be used if we want to be FIPS compliant.Thus, the idea is to stop using hashes to track changes in the SO mappings.
Instead, we're going to use the same
modelVersionsintroduced by ZDT:Whenever mappings change for a given SO type, the corresponding
modelVersionwill change too, somodelVersionscan be used to determine if mappings have changed.