From 02af419b6884be3e36c12b0ae4e488f33f0327ad Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 3 Feb 2026 15:22:35 -0500 Subject: [PATCH] reader: Add committed_chunk_id/1 callback implementation This adds an implementation for `osiris_log_reader:committed_chunk_id/1` which was added upstream recently in . The committed chunk ID is now a different concept than the committed offset. The committed chunk Id is the first offset in the chunk which is committed by a quorum. The committed offset is the last offset in that chunk. Here we do the same as `osiris_log`: read the values which are being maintained in the `osiris_log_shared` atomic. --- src/rabbitmq_stream_s3_log_reader.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rabbitmq_stream_s3_log_reader.erl b/src/rabbitmq_stream_s3_log_reader.erl index 3bc0e99..cd6f2b8 100644 --- a/src/rabbitmq_stream_s3_log_reader.erl +++ b/src/rabbitmq_stream_s3_log_reader.erl @@ -50,6 +50,7 @@ -export([ init_offset_reader/2, next_offset/1, + committed_chunk_id/1, committed_offset/1, close/1, send_file/3, @@ -127,8 +128,13 @@ next_offset(#?MODULE{mode = #remote{next_offset = NextOffset}}) -> next_offset(#?MODULE{mode = Local}) -> osiris_log:next_offset(Local). -committed_offset(#?MODULE{mode = #remote{shared = Shared}}) -> +committed_chunk_id(#?MODULE{mode = #remote{shared = Shared}}) -> osiris_log_shared:committed_chunk_id(Shared); +committed_chunk_id(#?MODULE{mode = Local}) -> + osiris_log:committed_chunk_id(Local). + +committed_offset(#?MODULE{mode = #remote{shared = Shared}}) -> + osiris_log_shared:committed_offset(Shared); committed_offset(#?MODULE{mode = Local}) -> osiris_log:committed_offset(Local).