Skip to content

Commit cd5db52

Browse files
A partial backport of #8358
1 parent a0aa6a6 commit cd5db52

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

deps/rabbit/priv/schema/rabbit.schema

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,6 +2783,12 @@ end}.
27832783
{datatype, [binary]}
27842784
]}.
27852785

2786+
2787+
%% See github.com/rabbitmq/osiris#192 and https://github.com/rabbitmq/rabbitmq-server/commit/9f162dfd01c1516d168e7d1fad39d33a929756e5
2788+
%% Enables read-head
2789+
{mapping, "stream.read_ahead", "rabbit.stream_read_ahead",
2790+
[{datatype, {enum, [true, false]}}]}.
2791+
27862792
{translation, "rabbit.cluster_tags",
27872793
fun(Conf) ->
27882794
case cuttlefish:conf_get("cluster_tags", Conf, undefined) of

deps/rabbit/src/rabbit_stream_queue.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
-include("mc.hrl").
1212

1313
-behaviour(rabbit_queue_type).
14-
-behaviour(rabbit_queue_commands).
1514

1615
-export([is_enabled/0,
1716
is_compatible/3,
@@ -1555,3 +1554,6 @@ reclaim_memory(_QName) ->
15551554

15561555
shrink_all(_Node) ->
15571556
{error, not_quorum_queue}.
1557+
1558+
read_ahead_on() ->
1559+
application:get_env(rabbit, stream_read_ahead, true).

deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,27 @@ credential_validator.regexp = ^abc\\d+",
12241224
]}],
12251225
[]},
12261226

1227+
%%
1228+
%% Stream read ahead on/off
1229+
%%
1230+
1231+
{stream_read_ahead,
1232+
"
1233+
stream.read_ahead = true
1234+
",
1235+
[{rabbit, [
1236+
{stream_read_ahead, true}
1237+
]}],
1238+
[]},
1239+
1240+
{stream_read_ahead,
1241+
"
1242+
stream.read_ahead = false
1243+
",
1244+
[{rabbit, [
1245+
{stream_read_ahead, false}
1246+
]}],
1247+
12271248
{stream_replication_port_range,
12281249
"
12291250
stream.replication.port_range.max = 4600

0 commit comments

Comments
 (0)