Skip to content

Commit

Permalink
dialog sync: Fix some subtle backup box restart bugs
Browse files Browse the repository at this point in the history
In an HA setup, following a restart of the backup box, there would be:

    * an extra ref for dialogs loaded from DB but not confirmed through
      sync, leading to a few hanging state 5 dialogs (added in 51b5ec3)
    * too little 'active_dlgs' stat decrements during the above
      corner-cases, since update_dlg_stats() ignores state 5 dialogs
  • Loading branch information
liviuchircu committed Jul 31, 2019
1 parent 66f3d97 commit 509e181
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/dialog/dlg_replication.c
Expand Up @@ -1031,8 +1031,6 @@ void rcv_cluster_event(enum clusterer_event ev, int node_id)

destroy_linkers_unsafe(dlg, 0);

/* make sure dialog is not freed while we don't hold the lock */
ref_dlg_unsafe(dlg, unref);
dlg_unlock(d_table, &d_table->entries[i]);

remove_dlg_prof_table(dlg, 0, 0);
Expand Down Expand Up @@ -1061,7 +1059,8 @@ void rcv_cluster_event(enum clusterer_event ev, int node_id)
if (dlg_db_mode == DB_MODE_DELAYED)
unref++;

update_dlg_stats(dlg, -1);
if (old_state != DLG_STATE_DELETED)
if_update_stat(dlg_enable_stats, active_dlgs, -1);

next_dlg = dlg->next;
unref_dlg_unsafe(dlg, unref, &d_table->entries[i]);
Expand Down

0 comments on commit 509e181

Please sign in to comment.