Skip to content

Commit

Permalink
[Common] run number specified in CcdbInspector queries
Browse files Browse the repository at this point in the history
In the case of queries to the CCDB the metadata was completely empty, so
the latest version of the queried object was retrieved regardless of the
run number.
This leads to failures in retrieving the appropriate object in cases where
the same type of object is updated by multiple parallel runs, as it is the
case for example for the CTP configuration object. In such cases the object
from the wrong run might be retrieved, if it was created shortly after the
good one.

To avoid that this kind of corner cases leads to wrongly reported failures,
the run number is now explicitly set in the metadata used for the CCDB
queries, as it was already done for the QCDB ones.
  • Loading branch information
aferrero2707 committed Aug 8, 2024
1 parent 4c8dac4 commit 2931444
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Modules/Common/src/CcdbInspectorTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ CcdbInspectorTask::ObjectStatus CcdbInspectorTask::inspectObject(CcdbInspectorTa

// get timestamps and run numberof the last available object
auto fullObjectPath = (mDatabaseType == "qcdb" ? trigger.activity.mProvenance + "/" : "") + path;
auto metadata = mDatabaseType == "qcdb" ? activity_helpers::asDatabaseMetadata(trigger.activity, false) : std::map<std::string, std::string>();
// metadata for CCDB queries, only specifying the run number
std::map<std::string, std::string> metadataCcdb{ { "runNumber", std::to_string(trigger.activity.mId) } };
auto metadata = mDatabaseType == "qcdb" ? activity_helpers::asDatabaseMetadata(trigger.activity, false) : metadataCcdb;
auto timestamps = getObjectInfo(path, metadata);
auto creationTime = std::get<2>(timestamps);
auto runNumber = std::get<3>(timestamps);
Expand Down

0 comments on commit 2931444

Please sign in to comment.