From 299495815a101b6c9471da13bdb80d203017dc24 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Tue, 30 Apr 2024 09:03:46 -0700 Subject: [PATCH] Add osiris.app.src file (#158) * Add osiris.app.src file Fixes compilation with `rebar3` * specify default env in app.src * improve app.src * app.src --------- Co-authored-by: Karl Nilsson --- Makefile | 24 +++++++++++++----------- src/osiris.app.src | 11 +++++++++++ src/osiris_replica.erl | 5 ++++- 3 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 src/osiris.app.src diff --git a/Makefile b/Makefile index 099dfd2..9d7bc4d 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,18 @@ PROJECT = osiris -PROJECT_DESCRIPTION = Foundation of the log-based streaming subsystem for RabbitMQ -PROJECT_VERSION = 1.8.1 +# PROJECT_DESCRIPTION = Foundation of the log-based streaming subsystem for RabbitMQ +# PROJECT_VERSION = 1.8.1 -define PROJECT_ENV -[ - {data_dir, "/tmp/osiris"}, - {port_range, {6000, 6500}}, - {max_segment_size_chunks, 256000}, - {replication_transport, tcp}, - {replica_forced_gc_default_interval, 4999} -] -endef +# define PROJECT_ENV +# [ +# {data_dir, "/tmp/osiris"}, +# {port_range, {6000, 6500}}, +# {max_segment_size_chunks, 256000}, +# {replication_transport, tcp}, +# {replica_forced_gc_default_interval, 4999} +# ] +# endef +# +# This project uses an app.src file LOCAL_DEPS = sasl crypto dep_gen_batch_server = hex 0.8.8 diff --git a/src/osiris.app.src b/src/osiris.app.src new file mode 100644 index 0000000..10c7807 --- /dev/null +++ b/src/osiris.app.src @@ -0,0 +1,11 @@ +{application,osiris, + [{description,"Foundation of the log-based streaming subsystem for RabbitMQ"}, + {vsn,"1.8.1"}, + {licenses,["Apache-2.0","MPL-2.0"]}, + {links,[{"github","https://github.com/rabbitmq/osiris"}]}, + {modules,[]}, + {registered,[ra_sup]}, + {applications,[kernel,stdlib,sasl,crypto,gen_batch_server, + seshat]}, + {mod,{osiris_app,[]}}, + {env,[{data_dir, "/tmp/osiris"}]}]}. diff --git a/src/osiris_replica.erl b/src/osiris_replica.erl index 188e536..90017d4 100644 --- a/src/osiris_replica.erl +++ b/src/osiris_replica.erl @@ -12,6 +12,8 @@ -include("osiris.hrl"). +-define(DEFAULT_PORT_RANGE, {6000, 6500}). + %% osiris replica, starts TCP listener ("server side" of the link), %% spawns remote reader, TCP listener replicates and %% confirms latest offset back to primary @@ -163,7 +165,8 @@ handle_continue(#{name := Name0, {badrpc, Reason} -> {stop, {badrpc, Reason}, undefined}; {ok, {LeaderRange, LeaderEpochOffs}} -> - {ok, {Min, Max}} = application:get_env(port_range), + {Min, Max} = application:get_env(osiris, port_range, + ?DEFAULT_PORT_RANGE), Transport = application:get_env(osiris, replication_transport, tcp), Self = self(), CntName = {?MODULE, ExtRef},