diff --git a/dbms/src/Dictionaries/CacheDictionary.cpp b/dbms/src/Dictionaries/CacheDictionary.cpp index c8a50c79abe..73d9b4733c6 100644 --- a/dbms/src/Dictionaries/CacheDictionary.cpp +++ b/dbms/src/Dictionaries/CacheDictionary.cpp @@ -821,7 +821,7 @@ void CacheDictionary::update(BunchUpdateUnit & bunch_update_unit) const const auto now = std::chrono::system_clock::now(); - if (now > backoff_end_time) + if (now > backoff_end_time.load()) { try { @@ -902,7 +902,7 @@ void CacheDictionary::update(BunchUpdateUnit & bunch_update_unit) const backoff_end_time = now + std::chrono::seconds(calculateDurationWithBackoff(rnd_engine, error_count)); tryLogException(last_exception, log, "Could not update cache dictionary '" + getFullName() + - "', next update is scheduled at " + ext::to_string(backoff_end_time)); + "', next update is scheduled at " + ext::to_string(backoff_end_time.load())); } } diff --git a/dbms/src/Dictionaries/CacheDictionary.h b/dbms/src/Dictionaries/CacheDictionary.h index 1f37eaf133a..059bbe29b75 100644 --- a/dbms/src/Dictionaries/CacheDictionary.h +++ b/dbms/src/Dictionaries/CacheDictionary.h @@ -318,7 +318,7 @@ private: mutable std::exception_ptr last_exception; mutable std::atomic error_count = 0; - mutable std::chrono::system_clock::time_point backoff_end_time; + mutable std::atomic backoff_end_time; mutable pcg64 rnd_engine;