Skip to content

Refactor data model to use config_id instead of datastore in xxx_object tables

These tables used to reference the datastore the invalid/missing object was found in, but not keeping the config entry, i.e. the checking session during which the invalid/missing object was found, which can be an issue when more than one checking session is executed on a given datastore.

This replaces the datastore field of tables corrupt_object, missing_object and missing_object_reference tables by config_id.

Adapt all the code accordingly.

Note that it changes a bit the cli usage: the kafka checker now needs a config entry, thus a kafka checking session can ony target a given object type (i.e. one kafka topic),

The migration script will fill the config_id column for corrupt_object using the check_config entry that matches the oject_type (of corrupt_object) and datastore. For missing_object and missing_object_reference, it will use this later table to idenify the check_config entry corresponding object type for the reference_id and datastore, since it is a checking session on this object type that will generate a missing object entry (which is generaaly not of the same type). For the missing_object table, the config_id will use the one extracted from the missing_object_reference (joining on the missing_id column).

Note that the migration script will fail if there are rows in one of these tables for which there exists more than one possible config_entry (i.e. with the same object_type and datastore).

Merge request reports