Skip to content

Add counting of some DB queries for investigation of issue #155

David Smith requested to merge 155-count-gettapesbyvid into release_4.8.3

Summary

Issue 155 notes "Tape server querying DB at very high rate". A previous MR 121 was hoped to address the high query rate, but unfortunately did not bring the hoped-for reduction in the top query.

This MR adds counters: to the catalogue at the point were the frequent query is issued (RdbmsCatalogue::getTapesByVid(const std::string& vid)) and also in 16 places in various places, including ostore and Scheduler, that lead to the call. Counters are reported to the standard logging service at INFO level at most every 600s. The counts are stored in a shared mmap region, since in cta-taped the place were the counters are incremented (drivehandler sub-process) is usually terminated periodically. (i.e. when tape in unmounted). Other processes, such as frontend, may also log counts if they are issuing the queries.

The intent for this patch (see issue #155 (closed)) is to include it in a tag on top of 4.8.2-1, with this MR only. Since this MR deals only with logging information for a specific call it probably does not make sense to leave this MR in the release after this specific investigation. (A more general logging of certain calls, e.g. to catalogue or ostore, might be useful and would be a new MR).

Requires manual tests in pre-production

No special tests in preproduction; but we should verify log message present as expected in pre-production. For deployment in production it may only be needed on a few tape servers if the code path leading to the frequent query is clear after looking at only a few tape server logs.

References

#155 (closed)

Does not close #155 (closed), but allows further investigation.

Edited by David Smith

Merge request reports