feat(buffer_worker): use offload mode for `replayq`
To avoid confusion for the users as to what persistence guarantees we offer when buffering bridges/resources, we will always enable offload mode for `replayq`. With this, when the buffer size is above the max segment size, it'll flush the queue to disk, but on recovery after a restart it'll clean the existing segments rather than resuming from them.
This commit is contained in:
parent
0fd8880d0a
commit
bf3983e7c4
|
@ -139,10 +139,13 @@ init({Id, Index, Opts}) ->
|
||||||
true ->
|
true ->
|
||||||
replayq:open(#{
|
replayq:open(#{
|
||||||
dir => disk_queue_dir(Id, Index),
|
dir => disk_queue_dir(Id, Index),
|
||||||
seg_bytes => SegBytes,
|
marshaller => fun ?MODULE:queue_item_marshaller/1,
|
||||||
max_total_bytes => TotalBytes,
|
max_total_bytes => TotalBytes,
|
||||||
sizer => fun ?MODULE:estimate_size/1,
|
%% we don't want to retain the queue after
|
||||||
marshaller => fun ?MODULE:queue_item_marshaller/1
|
%% resource restarts.
|
||||||
|
offload => true,
|
||||||
|
seg_bytes => SegBytes,
|
||||||
|
sizer => fun ?MODULE:estimate_size/1
|
||||||
});
|
});
|
||||||
false ->
|
false ->
|
||||||
undefined
|
undefined
|
||||||
|
|
Loading…
Reference in New Issue