From 08899552fe4da07caf6c1da47dfaf628a9355695 Mon Sep 17 00:00:00 2001 From: JimMoen Date: Mon, 22 Nov 2021 17:07:25 +0800 Subject: [PATCH] fix(mgmt): fix broken `ets:continuation` been sent between nodes --- apps/emqx_management/src/emqx_mgmt_api.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/emqx_management/src/emqx_mgmt_api.erl b/apps/emqx_management/src/emqx_mgmt_api.erl index 0f3ecd49b..8fd0a29a1 100644 --- a/apps/emqx_management/src/emqx_mgmt_api.erl +++ b/apps/emqx_management/src/emqx_mgmt_api.erl @@ -213,9 +213,9 @@ select_table_with_count(Tab, {Ms, FuzzyFilterFun}, ?FRESH_SELECT, Limit, FmtFun) Rows = FuzzyFilterFun(RawResult), {length(Rows), lists:map(FmtFun, Rows), NContinuation} end; -select_table_with_count(_Tab, {_Ms, FuzzyFilterFun}, Continuation, _Limit, FmtFun) +select_table_with_count(_Tab, {Ms, FuzzyFilterFun}, Continuation, _Limit, FmtFun) when is_function(FuzzyFilterFun) -> - case ets:select(Continuation) of + case ets:select(ets:repair_continuation(Continuation, Ms)) of '$end_of_table' -> {0, [], ?FRESH_SELECT}; {RawResult, NContinuation} -> @@ -230,8 +230,8 @@ select_table_with_count(Tab, Ms, ?FRESH_SELECT, Limit, FmtFun) {RawResult, NContinuation} -> {length(RawResult), lists:map(FmtFun, RawResult), NContinuation} end; -select_table_with_count(_Tab, _Ms, Continuation, _Limit, FmtFun) -> - case ets:select(Continuation) of +select_table_with_count(_Tab, Ms, Continuation, _Limit, FmtFun) -> + case ets:select(ets:repair_continuation(Continuation, Ms)) of '$end_of_table' -> {0, [], ?FRESH_SELECT}; {RawResult, NContinuation} ->