This adds a parameter to allow users to disable the delete queries in the usrloc module. This is mainly for problems due to the differences between how a relational DB and Cassandra work. If the schema for Cassandra is created in certain ways a delete query isn't required to keep the data clean. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/165
-- Commit Summary --
* Add option to disable delete queries in usrloc module.
-- File Changes --
M modules/usrloc/ucontact.c (16) M modules/usrloc/udomain.c (4) M modules/usrloc/ul_mod.c (2) M modules/usrloc/ul_mod.h (1) M modules/usrloc/urecord.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/165.patch https://github.com/kamailio/kamailio/pull/165.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/165
Hi,
The timer to delete records only runs if modparam "timer_interval" is greater than 0, so the new parameter is not required in this case.
Admittedly this is not documented, so the readme does need updating :)
Cheers, Charles
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/165#issuecomment-104030385
Oh, I thought I tried that and it just ran without halting instead of not running at all. I'll need to double check that.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/165#issuecomment-104032962
According to the module code, you should also ensure "timer_procs" modparam is set to 0 (default):
/* Register cache timer */ if(ul_timer_procs<=0) { if (timer_interval > 0) register_timer(ul_core_timer, 0, timer_interval); } else register_sync_timers(ul_timer_procs);
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/165#issuecomment-104037793
Ah, I looked through the code for usrloc and found where it registers the timer. It looks like if you have timer_interval set to 0 but timer_procs set to something > 0 (which I did due to cruft) it will spawn a new process and use timer_interval multiplied by 1000 (resulting in 0) for the amount of time to sleep, resulting in the churn. I should probably have looked at that first!
The relevant functions I looked at are: https://github.com/kamailio/kamailio/blob/master/modules/usrloc/ul_mod.c#L32... https://github.com/kamailio/kamailio/blob/master/modules/usrloc/ul_mod.c#L39...
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/165#issuecomment-104037968
Closed #165.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/165#event-309989763