]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
log: Make log_max_recent have an effect again. 48311/head
authorJoshua Baergen <jbaergen@digitalocean.com>
Thu, 16 Jun 2022 16:14:12 +0000 (10:14 -0600)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Fri, 12 Jan 2024 12:14:50 +0000 (19:14 +0700)
commit847972f9b21b3a8213952512e287d1e4bff16801
tree214cc942cc2785b6c1225caaf4f6ac683920a33f
parentc53faa40f327c9bac91d1913ae26a7e0371c0802
log: Make log_max_recent have an effect again.

The log improvements in a747aeac13daf3dba43343120659e802cb569f6b
unfortunately left log_max_recent broken because m_max_recent wasn't
used anymore.

Eliminate m_max_recent and set the capacity of the m_recent ring buffer
when log_max_recent changes. In order to call set_capacity(),
ConcreteEntry needed its move constructor set noexcept.

I haven't followed the boost code all the way down but I suspect that
setting the ring buffer capacity to anything less than 1 entry will
probably cause problems, so restrict log_max_recent to >=1.

Also fix a wrong variable used for printing the max new entries during
"log dump".

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit 3d59ba1671e3e76326fb706a76b8d9638d782924)

Conflicts:
  - file: src/common/options/global.yaml.in
    desc: file not exists in pacific
  - file: src/common/options.cc
    desc: added 'set_min' for log_max_recent
src/common/options.cc
src/log/Entry.h
src/log/Log.cc
src/log/Log.h