]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: Fix ops logs sometimes having several entries per line. 68881/head
authorJacques Heunis <jheunis@bloomberg.net>
Wed, 13 May 2026 09:14:05 +0000 (09:14 +0000)
committerJacques Heunis <jheunis@bloomberg.net>
Wed, 13 May 2026 09:31:03 +0000 (09:31 +0000)
commitf8d3db622a5a7d105b8536992425106f7db58882
tree09342ff38e1ca5ea0e0a22f3c424bde1db1423b5
parent5f72d090166a8de86fe29e09aac930c6bf411a99
rgw: Fix ops logs sometimes having several entries per line.

Although not explicitly documented, the RGW ops log is generally
formatted with one entry per line. This makes it work well with log
shipping/ingestion services (many of which default to treating each line
as a separate entry) and in particular works well with log servers that
index based on the available JSON fields.

The current implementation separates the log call from the resulting
disk IO: Logs are written to a buffer and a separate thread flushes them
to disk (possibly in batches). The current code appends a newline only
at the end of the batch being flushed to disk and in many cases when
under load this means that several log entries are concatenated onto a
single line, which complicates attempts to process those logs.

This PR separates the addition of a new line from the flush to disk,
appending a newline after every log entry but still only flushing at the
end of the batch to avoid additional IO overhead.

Fixes: https://tracker.ceph.com/issues/76566
Signed-off-by: Jacques Heunis <jheunis@bloomberg.net>
src/rgw/rgw_log.cc