Skip to content
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

Merged
merged 5 commits into from
Jun 17, 2024

Conversation

keynslug
Copy link
Contributor

@keynslug keynslug commented Jun 17, 2024

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 tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

@keynslug keynslug marked this pull request as ready for review June 17, 2024 14:21
@keynslug keynslug requested a review from a team as a code owner June 17, 2024 14:21
@@ -23,6 +23,8 @@
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
-include_lib("stdlib/include/assert.hrl").

-import(emqx_utils_conv, [bin/1]).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to avoid imports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped in 10e78ea.

|| I <- lists:seq(1, 200),
TS <- Timestamps,
TS <- lists:seq(0, 1_000, 10),
Copy link
Member

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.

Copy link
Contributor Author

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.

Comment on lines 207 to 212
PrevRuntimeData :: term()
) ->
{_Schema, cf_refs()}.
Copy link
Member

@ieQu1 ieQu1 Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PrevRuntimeData :: term()
) ->
{_Schema, cf_refs()}.
Schema | undefined
) ->
{Schema, cf_refs()}.

?

Copy link
Contributor Author

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.

Comment on lines 488 to 489
make_topic(T1, T2, T3, T4) ->
make_topic([T1, T2, T3, T4]).
Copy link
Member

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.

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))}
Copy link
Member

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.

Copy link
Contributor Author

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.

@keynslug keynslug merged commit eede9f3 into emqx:release-57 Jun 17, 2024
176 checks passed
@keynslug keynslug deleted the fix/ds/inherited-lts-lost branch June 17, 2024 17:25
@emqxqa
Copy link

emqxqa commented Jun 20, 2024

TestExecution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants