https://s3.amazonaws.com/clickhouse-test-reports/0/8ea7b9c9784f7014dccb4fe0dfd269265126a30d/stress_test__msan_.html

Post-processed traces: https://pastila.nl/?0006a09d/4a3864799d8b23c3998deeefcdca5d8f
Post-processed traces without boring threads: https://pastila.nl/?0006a09d/f342d95a823d513df62d68a5d8a1a50b

Explanation: https://pastila.nl/?000fcc82/3a48f372d3410a8691d50cb5647b2c20
{
    auto found = query_kind_amounts.find(query_kind);
    if (found == query_kind_amounts.end())
        query_kind_amounts[query_kind] = 1;
    else
        found->second += 1;
}
void ProcessList::decreaseQueryKindAmount(const IAST::QueryKind & query_kind)
{
    auto found = query_kind_amounts.find(query_kind);
    
    if (found == query_kind_amounts.end())
        throw Exception(ErrorCodes::LOGICAL_ERROR, "Wrong query kind amount: decrease before increase on '{}'", query_kind);
    else if (found->second == 0)
        throw Exception(ErrorCodes::LOGICAL_ERROR, "Wrong query kind amount: decrease to negative on '{}'", query_kind, found->second);
    else
        found->second -= 1;
}
ProcessList::QueryAmount ProcessList::getQueryKindAmount(const IAST::QueryKind & query_kind) const
{
    auto found = query_kind_amounts.find(query_kind);
    if (found == query_kind_amounts.end())
        return 0;
    return found->second;
}
}