mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-36587 InnoDB uses too much memory
log_t::clear_mmap(): Do not modify buf_size; we may have
file_size==0 here during bootstrap.
log_t::set_recovered(): If we are writing to a memory-mapped log,
update log_sys.buf_size to the record payload area of log_sys.buf.
This fixes up commit acd071f599
(MDEV-21923).
This commit is contained in:
@@ -1237,11 +1237,10 @@ void log_t::clear_mmap() noexcept
|
||||
#ifdef HAVE_PMEM
|
||||
if (!is_opened())
|
||||
{
|
||||
latch.wr_lock(SRW_LOCK_CALL);
|
||||
ut_d(latch.wr_lock(SRW_LOCK_CALL));
|
||||
ut_ad(!resize_in_progress());
|
||||
ut_ad(get_lsn() == get_flushed_lsn(std::memory_order_relaxed));
|
||||
buf_size= unsigned(std::min<uint64_t>(capacity(), buf_size_max));
|
||||
latch.wr_unlock();
|
||||
ut_d(latch.wr_unlock());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@@ -4590,7 +4590,10 @@ inline void log_t::set_recovered() noexcept
|
||||
}
|
||||
#ifdef HAVE_PMEM
|
||||
else
|
||||
{
|
||||
buf_size= unsigned(std::min<uint64_t>(capacity(), buf_size_max));
|
||||
mprotect(buf, size_t(file_size), PROT_READ | PROT_WRITE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user