]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
neocls log trimming (marker based): fix infinite loop on ENODATA
authorOguzhan Ozmen <oozmen@bloomberg.net>
Tue, 12 May 2026 19:38:12 +0000 (19:38 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Tue, 26 May 2026 19:09:04 +0000 (19:09 +0000)
commit949c22ee3f9ea63f8f2b4399da8ccc6217ac46af
tree66f7f9297de8c7980cd3ce173763d1993537f058
parent3d01dd29d4c7d22808fceb4d61cc7401940e15d6
neocls log trimming (marker based): fix infinite loop on ENODATA

The use_awaitable_t overload of trim() has the try-catch for
ENODATA (no_message_available) inside the for(;;) loop. When
cls_log_trim returns ENODATA (i.e., nothing left to trim), the exception is
caught and silently swallowed execution falls through the catch block
back to for(;;), retrying the trim forever.

This should be a rare condition as 3 conditions should be met in a
single-cluster (once configured as multisite):
 - a realm/period exists
 - zone endpoints are configured
 - data_log* objects exist

Since in a properly setup multisite cluster, data churn is continious so
hard to notice. In the case client reported, the multisite cluster was
reverted back to single site so data_logs have no data all the time;
hence, the issue is pronounced.

This fix adds co_return inside the catch block so ENODATA exits the loop.

Fixes: https://tracker.ceph.com/issues/76563
Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
(cherry picked from commit e1a6ed169dd72868eba5321b52b180fdb057b314)
src/neorados/cls/log.h
src/test/cls_log/test_neocls_log.cc