Metadata Conflict Detection
Conflict detection is part of version 25.4
Introduction
The metadata of objects can be updated, and different actors can simultaneously update an object. For example, after the ingest is completed for an object, the end user can edit its metadata. However, at the same time, the AI Features can enrich the object with additional metadata. This combination can potentially lead to concurrent metadata updates on the object.
Conflict Detection
The new system metadata field Internal.LastUpdatePremisEventId is a number that increases each time an object is updated and corresponds exactly to the Events of the last update premis event.
If this last update’s premis ID is provided when updating a record with new metadata, then the conflict detection mechanism will do the following
Load the Difference stored for each premis event between the event specified by the provided premis ID and now.
If the Difference corresponding to the new update intersects with any of the loaded differences, for example, the title was changed in between, then raise a conflict
If there is no intersection, it means that either there were no intermediate updates or the updates changed different metadata fields, and hence, there is no conflict.
REST API Support
When updating a record, it is now possible to provide the last update premis event ID of the retrieved record, using the HTTPS header If-Match in the form of
W/"<Internal.LastUpdatePremisEventId>"e.g.
W/"14096704"
If a metadata collision is detected, the HTTP status 412 Precondition Failed will be raised. When no (valid) If-Match is provided, no metadata collisions will be detected, making this feature fully backwards compatible.
Fragment Support
As described in Fragments the non-dynamic and non-descriptive fields are intrinsically shared between the main fragment and all its pure fragments. This means that when such a metadata field changes, it affects all fragments and, consequently, the likelihood of a metadata collision. To track this, when updating an object with actual pure fragments, there will be up to two premis events
A
RECORDS.UPDATEevent containing the difference for the descriptive and dynamic fieldsAn optional
UPDATE.FRAGMENT_METADATA_INHERITANCEevent containing the difference for the non-dynamic and non-descriptive metadata fields. This event is only present when at least one such metadata field has changed.
The conflict detection will take both events into account when applicable.
Search Engine Support
From version 25.4, the indexation is scalable with multiple instances updating the search engine. The combination of the metadata fields Internal.LastUpdatePremisEventId and Internal.LastDatabaseRetrievalDate is used to prevent out-of-order updates.