Skip to content

Commit 6e96d18

Browse files
authored
[Common] run number specified in CcdbInspector queries (#2380)
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.
1 parent dfc102a commit 6e96d18

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/Common/src/CcdbInspectorTask.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ CcdbInspectorTask::ObjectStatus CcdbInspectorTask::inspectObject(CcdbInspectorTa
211211

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

0 commit comments

Comments
 (0)