Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Prepare
run: |
sudo apt update
sudo apt install emacs-nox
- name: Install Erlang/OTP
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
with:
otp-version: '26.2.4'
rebar3-version: '3.23.0'
Expand All @@ -33,9 +33,9 @@ jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install typos
uses: taiki-e/install-action@5d427d86f088a6cedcddb92b3ad038d30721b52f # v2.44.71
uses: taiki-e/install-action@14083e64ac8cf1f5e54356df00b9779b23e192a1 # v2.58.29
with:
tool: typos
- name: Run typos
Expand All @@ -51,14 +51,14 @@ jobs:
- otp-version: '26.2.5.5'
- otp-version: '25.3.2.15'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Erlang/OTP
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
with:
otp-version: ${{ matrix.otp-version }}
rebar3-version: '3.23.0'
- name: Install packages for common tests
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
with:
packages: redis-server faketime
version: 1.0
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/db-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
- valkey-version: 8.0.1
- valkey-version: 7.2.5
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install redis-cli required by common tests
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
with:
packages: redis-server
version: 1.0
- name: Install Erlang/OTP
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
with:
otp-version: '26.2.4'
rebar3-version: '3.23.0'
Expand All @@ -44,14 +44,14 @@ jobs:
- redis-version: 7.0.15
- redis-version: 6.2.14
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install packages for common tests
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2
uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
with:
packages: redis-server faketime
version: 1.0
- name: Install Erlang/OTP
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
with:
otp-version: '26.2.4'
rebar3-version: '3.23.0'
Expand Down
2 changes: 1 addition & 1 deletion src/ered.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, ered,
[{description, "Valkey Cluster client library application"},
{vsn, "0.6.0"},
{vsn, "0.7.1"},
{registered, []},
{applications,
[kernel,
Expand Down
2 changes: 1 addition & 1 deletion src/ered_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ handle_info({{command_reply, Pid}, Reply}, State = #st{pending = Pending, connec
{noreply, process_commands(State#st{pending = NewPending})}
end;

handle_info({command_reply, _Pid, _Reply}, State) ->
handle_info({{command_reply, _Pid}, _Reply}, State) ->
%% Stray message from a defunct client? ignore!
{noreply, State};

Expand Down
9 changes: 4 additions & 5 deletions src/ered_cluster.erl
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,8 @@ handle_info({converged, Result, FromAddr, Version},
{noreply, update_cluster_state(State1)}
end;
false ->
cancel_convergence_check(State),
State1 = State#st{convergence_check = nok},
{noreply, update_cluster_state(State1)}
%% Ignore and let the convergence check time out.
{noreply, State}
end;

handle_info({timeout, TimerRef, {time_to_update_slots,PreferredNodes}}, State) ->
Expand All @@ -374,7 +373,7 @@ handle_info({timeout, TimerRef, start_convergence_check},
{noreply, start_convergence_check(State)};

handle_info({timeout, TimerRef, cancel_convergence_check},
State = #st{convergence_check = {scheduled, TimerRef}}) ->
State = #st{convergence_check = {ongoing, _, TimerRef}}) ->
cancel_convergence_check(State),
State1 = State#st{convergence_check = nok},
{noreply, update_cluster_state(State1)};
Expand Down Expand Up @@ -547,7 +546,7 @@ start_convergence_check(State) ->
Expected = ered_lib:slotmap_master_slots(State#st.slot_map),
lists:foreach(fun (Addr) ->
ClientPid = maps:get(Addr, State#st.nodes),
Cb = fun ({ok, Reply}) ->
Cb = fun ({ok, Reply = [_|_]}) ->
IsMatch = ered_lib:slotmap_master_slots(Reply) =:= Expected,
ClusterPid ! {converged, IsMatch, Addr, Version};
(_) ->
Expand Down
22 changes: 11 additions & 11 deletions src/ered_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,17 @@ receive_data(0, _Time, Acc) ->
{data, lists:unzip(lists:reverse(Acc))};
receive_data(N, Time, Acc) ->
receive
Msg ->
case Msg of
{recv_exit, Reason} ->
{recv_exit, Reason};
{send, Pid, Ref, Commands} ->
Data = ered_command:get_data(Commands),
Class = ered_command:get_response_class(Commands),
RefInfo = {Class, Pid, Ref, []},
Acc1 = [{RefInfo, Data} | Acc],
receive_data(N, 0, Acc1)
end
{recv_exit, Reason} ->
{recv_exit, Reason};
{send, Pid, Ref, Commands} ->
Data = ered_command:get_data(Commands),
Class = ered_command:get_response_class(Commands),
RefInfo = {Class, Pid, Ref, []},
Acc1 = [{RefInfo, Data} | Acc],
receive_data(N - 1, 0, Acc1);
_Ignore ->
%% Mitigate OTP TLS 1.3 bug #10273 leaking a message {Ref, ok}.
receive_data(N, 0, Acc)
after Time ->
receive_data(0, 0, Acc)
end.