提交 b9a8f1fc 编写于 作者: N Nikita Mikhaylov

write lock

上级 599eed64
......@@ -752,7 +752,8 @@ void CacheDictionary::updateThreadFunction()
/// Word "bunch" must present in this log message, because it is being checked in tests.
if (current_queue_size > 0)
LOG_TRACE(log, "Performing bunch of keys update in cache dictionary with " << current_queue_size + 1 << " keys" );
LOG_TRACE(log, "Performing bunch of keys update in cache dictionary with "
<< current_queue_size + 1 << " keys" );
std::vector<UpdateUnitPtr> update_request;
update_request.reserve(current_queue_size + 1);
......
......@@ -39,7 +39,6 @@ template <typename AttributeType, typename OutputType, typename DefaultGetter>
void CacheDictionary::getItemsNumberImpl(
Attribute & attribute, const PaddedPODArray<Key> & ids, ResultArrayType<OutputType> & out, DefaultGetter && get_default) const
{
std::cout << StackTrace().toString() << std::endl;
/// Mapping: <id> -> { all indices `i` of `ids` such that `ids[i]` = <id> }
std::unordered_map<Key, std::vector<size_t>> cache_expired_ids;
std::unordered_map<Key, std::vector<size_t>> cache_not_found_ids;
......@@ -344,7 +343,6 @@ void CacheDictionary::prepareAnswer(
AbsentIdHandler && on_id_not_found) const
{
/// Prepare answer
const ProfilingScopedReadRWLock read_lock{rw_lock, ProfileEvents::DictCacheLockReadNs};
const auto now = std::chrono::system_clock::now();
for (const auto & id : update_unit_ptr->requested_ids)
......@@ -354,6 +352,8 @@ void CacheDictionary::prepareAnswer(
auto & cell = cells[cell_idx];
const auto was_id_updated = update_unit_ptr->found_ids_mask_ptr->at(id);
const ProfilingScopedWriteRWLock write_lock{rw_lock, ProfileEvents::DictCacheLockWriteNs};
if (was_id_updated)
{
on_cell_updated(id, find_result.cell_idx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册