Skip to content

Commit bbfdcb0

Browse files
kjnilssonacogoluegnes
authored andcommitted
Streams: pass previous iterator to next.
This allows better use of read ahead data.
1 parent b92304c commit bbfdcb0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deps/rabbit/src/rabbit_stream_queue.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ stream_entries(QName, Name, CTag, LocalPid,
11761176
credit = Credit} = Str0) ->
11771177
case Credit > 0 of
11781178
true ->
1179-
case chunk_iterator(Str0, LocalPid) of
1179+
case chunk_iterator(Str0, LocalPid, undefined) of
11801180
{ok, Str} ->
11811181
stream_entries(QName, Name, CTag, LocalPid, Str);
11821182
{end_of_stream, Str} ->
@@ -1229,7 +1229,7 @@ stream_entries(QName, Name, CTag, LocalPid,
12291229
gen_server:cast(self(), queue_event(QName, {resume_filtering, CTag})),
12301230
{Str0#stream{filtering_paused = true}, lists:reverse(Acc0)};
12311231
end_of_chunk ->
1232-
case chunk_iterator(Str0, LocalPid) of
1232+
case chunk_iterator(Str0, LocalPid, Iter0) of
12331233
{ok, Str} ->
12341234
stream_entries(QName, Name, CTag, LocalPid, Str, Acc0);
12351235
{end_of_stream, Str} ->
@@ -1294,8 +1294,8 @@ stream_entries(QName, Name, CTag, LocalPid,
12941294

12951295
chunk_iterator(#stream{credit = Credit,
12961296
listening_offset = LOffs,
1297-
log = Log0} = Str0, LocalPid) ->
1298-
case osiris_log:chunk_iterator(Log0, Credit) of
1297+
log = Log0} = Str0, LocalPid, PrevIterator) ->
1298+
case osiris_log:chunk_iterator(Log0, Credit, PrevIterator) of
12991299
{ok, _ChunkHeader, Iter, Log} ->
13001300
{ok, Str0#stream{chunk_iterator = Iter,
13011301
log = Log}};

0 commit comments

Comments
 (0)