diff --git a/dbms/src/IO/AIOContextPool.cpp b/dbms/src/IO/AIOContextPool.cpp index 1251bb651b3..3437f53ff81 100644 --- a/dbms/src/IO/AIOContextPool.cpp +++ b/dbms/src/IO/AIOContextPool.cpp @@ -84,13 +84,13 @@ void AIOContextPool::fulfillPromises(const io_event events[], const int num_even for (const auto & event : boost::make_iterator_range(events, events + num_events)) { /// get id from event - const auto id = event.data; + const auto completed_id = event.data; /// set value via promise and release it - const auto it = promises.find(id); + const auto it = promises.find(completed_id); if (it == std::end(promises)) { - LOG_ERROR(&Poco::Logger::get("AIOcontextPool"), "Found io_event with unknown id " << id); + LOG_ERROR(&Poco::Logger::get("AIOcontextPool"), "Found io_event with unknown id " << completed_id); continue; } @@ -126,7 +126,8 @@ std::future AIOContextPool::post(struct iocb & iocb) std::unique_lock lock{mutex}; /// get current id and increment it by one - const auto request_id = id++; + const auto request_id = next_id; + ++next_id; /// create a promise and put request in "queue" promises.emplace(request_id, std::promise{}); diff --git a/dbms/src/IO/AIOContextPool.h b/dbms/src/IO/AIOContextPool.h index 8a2d3e4adbe..64d01a0f45b 100644 --- a/dbms/src/IO/AIOContextPool.h +++ b/dbms/src/IO/AIOContextPool.h @@ -26,7 +26,7 @@ class AIOContextPool : public ext::singleton using BytesRead = ssize_t; /// Autoincremental id used to identify completed requests - ID id{}; + ID next_id{}; mutable std::mutex mutex; mutable std::condition_variable have_resources; std::map> promises; diff --git a/dbms/src/IO/ReadBufferAIO.cpp b/dbms/src/IO/ReadBufferAIO.cpp index 1b06f7e7e27..2bc3dfe7d21 100644 --- a/dbms/src/IO/ReadBufferAIO.cpp +++ b/dbms/src/IO/ReadBufferAIO.cpp @@ -191,7 +191,7 @@ off_t ReadBufferAIO::doSeek(off_t off, int whence) void ReadBufferAIO::synchronousRead() { - CurrentMetrics::Increment metric_increment{CurrentMetrics::Read}; + CurrentMetrics::Increment metric_increment_read{CurrentMetrics::Read}; prepare(); bytes_read = ::pread(fd, buffer_begin, region_aligned_size, region_aligned_begin); @@ -227,7 +227,7 @@ bool ReadBufferAIO::waitForAIOCompletion() if (is_eof || !is_pending_read) return false; - CurrentMetrics::Increment metric_increment{CurrentMetrics::Read}; + CurrentMetrics::Increment metric_increment_read{CurrentMetrics::Read}; bytes_read = future_bytes_read.get(); is_pending_read = false; diff --git a/dbms/src/IO/ZlibInflatingReadBuffer.cpp b/dbms/src/IO/ZlibInflatingReadBuffer.cpp index 4629da1c6f0..4433b0c9bb4 100644 --- a/dbms/src/IO/ZlibInflatingReadBuffer.cpp +++ b/dbms/src/IO/ZlibInflatingReadBuffer.cpp @@ -70,7 +70,7 @@ bool ZlibInflatingReadBuffer::nextImpl() } else { - int rc = inflateReset(&zstr); + rc = inflateReset(&zstr); if (rc != Z_OK) throw Exception(std::string("inflateReset failed: ") + zError(rc), ErrorCodes::ZLIB_INFLATE_FAILED); return true; diff --git a/dbms/src/IO/readFloatText.h b/dbms/src/IO/readFloatText.h index f3c6c55477b..d91a250ac77 100644 --- a/dbms/src/IO/readFloatText.h +++ b/dbms/src/IO/readFloatText.h @@ -372,7 +372,7 @@ ReturnType readFloatTextFastImpl(T & x, ReadBuffer & in) auto after_point_num_leading_zeros = after_leading_zeros_count - after_point_count; readUIntTextUpToNSignificantDigits(after_point, in); - int read_digits = in.count() - after_leading_zeros_count; + read_digits = in.count() - after_leading_zeros_count; after_point_exponent = (read_digits > significant_digits ? -significant_digits : -read_digits) - after_point_num_leading_zeros; }