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

Initial version of the trie module #3535

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

vladpaiu
Copy link
Member

@vladpaiu vladpaiu commented Dec 3, 2024

Summary
Initial version of the trie module

Details
Add a generic trie module implementation.

The drouting module is trying to do too many things at once. For the use cases where we just need maintain and query and internal trie ( and we do not have any gateways/carriers or routing involved ), the trie module provides a more memory efficient alternative.

Furthermore, due to the drouting complexity, we cannot easily update a rule in place and/or delete a prefix rule. The new trie module exposes new upsert&delete MI commands, thus getting rid of the limitation of having to reload the whole dataset in case minor changes need to be made to the trie.

Solution
New trie module.

Compatibility
Backwards compatible

@vladpaiu vladpaiu added this to the 3.6-dev milestone Dec 3, 2024
Copy link

github-actions bot commented Jan 3, 2025

Any updates here? No progress has been made in the last 30 days, marking as stale.

@github-actions github-actions bot added the stale label Jan 3, 2025
@github-actions github-actions bot closed this Jan 10, 2025
@bogdan-iancu bogdan-iancu reopened this Jan 10, 2025
@stale stale bot removed the stale label Jan 10, 2025
@bogdan-iancu
Copy link
Member

Hi @vladpaiu , thank you for the contribution here. Just for the sake of the discussion , you know you can use the drouting module without the carriers and gateways part, and have the do_routing() to do only matching, nothing more. And IMHO this is a 100% overlapping with this new module....if I'm not missing anything.
But of course, all the time there are different ways to skin the cat. And having this as module will avoid any conflicts and direct overlapping - just more options.
Could you look into the failed checks from CI system and have them addressed please?

@bogdan-iancu bogdan-iancu self-assigned this Jan 13, 2025
@vladpaiu
Copy link
Member Author

the reason for splitting this away from drouting was mostly memory usage related, while doing comparisons this is using close to 3x less mem. also, it was about adding/deleting rules without having to worry about all of the drouting 'dependencies'.

in regards to the CI/CD failures, they are not related to this PR changes:

cachedb/cachedb_dict.c:481:31: error: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Werror,-Wformat]
481 | i += sprintf(obj+i, "%ld", pair->val.val.i64);

@bogdan-iancu bogdan-iancu merged commit 12390b4 into OpenSIPS:master Jan 14, 2025
77 of 102 checks passed
@bogdan-iancu
Copy link
Member

@vladpaiu , please check the above CI issues, there are specific to the trie module this time :)

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

Successfully merging this pull request may close these issues.

2 participants