[kamailio/kamailio] htable dbmode 1 not insterting all records (Issue #3422)
### Description The dbmode behavior was modified (see the commit reference bellow) and does not clearly align with the documentation anymore, I still need the feature when we can persist htable records that were inserted at runtime. In fact I do not understand that value of writing back only records that where loaded from the DB, this seems equivalent to dbmode 0 (if the db is not altered) ? Maybe you can help me understand why we the change is needed @miconda ? ``` dbmode - if set to 1, the content of hash table is written to database table when the SIP server is stopped (i.e., ensure persistency over restarts). Default value is 0 (no write back to db table). ``` ``` commit b1fa63b1547fc5af6cc1e97db42ea76db1bf927b Author: Daniel-Constantin Mierla <miconda@gmail.com> Date: Wed Apr 13 13:11:30 2022 +0200 htable: track when records were successfully loaded from database - write back only in such case diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c index 00023e7153..f212600e21 100644 --- a/src/modules/htable/ht_api.c +++ b/src/modules/htable/ht_api.c @@ -1099,7 +1099,7 @@ int ht_db_sync_tables(void) ht = _ht_root; while(ht) { - if(ht->dbtable.len>0 && ht->dbmode!=0 && ht->ncols==0) + if(ht->dbtable.len>0 && ht->dbmode!=0 && ht->dbload!=0 && ht->ncols==0) { LM_DBG("sync db table [%.*s] from ht [%.*s]\n", ht->dbtable.len, ht->dbtable.s, ``` -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/3422@github.com>
@jchavanton: I tracked back and seems related to: - https://github.com/kamailio/kamailio/issues/3082 However, your observations seem to be valid, so needs another fix for dbmode 1. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#issuecomment-1517598422 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/3422/1517598422@github.com>
Cheers Daniel ! Thanks, I get the intent. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#issuecomment-1517739103 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/3422/1517739103@github.com>
Hopefully the commit ba9d663c5d the case of not writing back to db at shut down when there were no records in db at start up. If not, reopen. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#issuecomment-1549897847 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/3422/1549897847@github.com>
Closed #3422 as completed. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#event-9259611833 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issue/3422/issue_event/9259611833@github.com>
Reopened #3422. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#event-9724717481 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issue/3422/issue_event/9724717481@github.com>
Just tested with `5.7.1` and it does not seems to work, I will try reverting the commit who broke it to be sure. https://github.com/jchavanton/kamailio/commit/db041f386fdf8b1a3c2d47911c09f4... -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#issuecomment-1620695879 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/3422/1620695879@github.com>
my config was incomplete, I can confirm that on 5.7.1 the htable db persistency is working Thanks for fixing it ! -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#issuecomment-1620733530 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/3422/1620733530@github.com>
Closed #3422 as completed. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3422#event-9724899281 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issue/3422/issue_event/9724899281@github.com>
participants (2)
-
Daniel-Constantin Mierla -
Julien Chavanton