-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dsstore): persist inherited LTS trie #13276
Conversation
@@ -23,6 +23,8 @@ | |||
-include_lib("snabbkaffe/include/snabbkaffe.hrl"). | |||
-include_lib("stdlib/include/assert.hrl"). | |||
|
|||
-import(emqx_utils_conv, [bin/1]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to avoid imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped in 10e78ea.
6f046a5
to
49aca5b
Compare
|| I <- lists:seq(1, 200), | ||
TS <- Timestamps, | ||
TS <- lists:seq(0, 1_000, 10), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pretty confusing that TS
is used for both timestamp and as a topic level. I think it's better to use a constant timestamp for all messages (I believe it's irrelevant in this test), and rename TS
to J
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually not used as a topic level, but it indeed should be irrelevant.
PrevRuntimeData :: term() | ||
) -> | ||
{_Schema, cf_refs()}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PrevRuntimeData :: term() | |
) -> | |
{_Schema, cf_refs()}. | |
Schema | undefined | |
) -> | |
{Schema, cf_refs()}. |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last argument is actually RuntimeData
(i.e. the result of open/5
), not Schema
.
make_topic(T1, T2, T3, T4) -> | ||
make_topic([T1, T2, T3, T4]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function looks very specific to a particular testcase. Please remove it and use make_topic/1
with list argument.
Before this commit, inherited trie was actually only kept in memory cache. Also simplify storage backend behaviour around inheriting previous generation's legacy.
49aca5b
to
82588fb
Compare
Topic = emqx_topic:join(["wildcard", integer_to_list(I), "suffix", Suffix]), | ||
{TS, make_message(TS, Topic, integer_to_binary(TS))} | ||
end | ||
{TS, make_message(TS, make_topic([wildcard, I, suffix, Suffix]), bin(TS))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, TS is probably not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a different impression actually: sounds important for a replay test to have messages spread both in time and in "topic space" (here, TS
is not part of a topic).
Anyway, it'd probably be better to tackle the logic of unrelated testcase in a separate PR.
Release version: v/e5.7.1
Summary
Before this commit, inherited trie was actually only kept in memory cache.
Also simplify storage backend behaviour around inheriting previous generation's legacy.
PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
Added property-based tests for code which performs user input validationchanges/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md
filesCreated PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket