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

usrloc fix #66

Closed
wants to merge 7 commits into from
Closed

usrloc fix #66

wants to merge 7 commits into from

Conversation

sokhapkin
Copy link
Contributor

When multiple instances of kamailio share location table, kamailio on starup loads all records from the table and lately removes records which belongs to another kamailio instance(s), bringing the table out of sync with running instances.

Sergey Okhapkin added 7 commits January 27, 2015 08:24
- the patch allows to share location table between multiple instances of kamailio. On startup kamailio
will only read location table records belonging to the current instance and will not remove those
records from the table on registration expiry.
@miconda
Copy link
Member

miconda commented Feb 4, 2015

The ignoring was made on purpose, allowing to handle the registrations even the socket is different. Think about the case when kamailio is running on a server changing the IP (eg, on a DSL link), being restarted when the provider changes the address.

In current form, the patch will not be accepted - solutions:

  • save server_id in usrloc and rely on that for loading only own records (it requires adding a new column to location database)
  • make a parameter to enable/disable this behavior

The parameter should be done even with server_id, because I think that two servers are configured to use the same database table when they want to share the location. If you don't want the two (or more) servers to share the location, then you can create many location tables with different name but same structure (and add a record to version table) and each server is using a different one.

As for the pull request, you have to re-sync your repository with the main one, because in pull requests you push now also the patches for geoip2 module, which is already part of the kamailio.

I am going to close this item here.

@miconda miconda closed this Feb 4, 2015
@sokhapkin
Copy link
Contributor Author

I strictly disagree with the purpose of the ignoring.

On Wednesday 04 February 2015 01:51:14 Daniel-Constantin Mierla wrote:

The ignoring was made on purpose, allowing to handle the registrations even
the socket is different. Think about the case when kamailio is running on a
server changing the IP (eg, on a DSL link), being restarted when the
provider changes the address.

In current form, the patch will not be accepted - solutions:

  • save server_id in usrloc and rely on that for loading only own records
    (it requires adding a new column to location database) * make a parameter
    to enable/disable this behavior

The parameter should be done even with server_id, because I think that two
servers are configured to use the same database table when they want to
share the location. If you don't want the two (or more) servers to share
the location, then you can create many location tables with different name
but same structure (and add a record to version table) and each server is
using a different one.

As for the pull request, you have to re-sync your repository with the main
one, because in pull requests you push now also the patches for geoip2
module, which is already part of the kamailio.

I am going to close this item here.


Reply to this email directly or view it on GitHub:
#66 (comment)

@miconda
Copy link
Member

miconda commented Feb 5, 2015

Can you give more details? I think I presented the reasons and I know it is used that way. Also, I gave you suggestions on how to get what you want. The proposed patch is breaking existing used behavior, so you have to provide a patch that preserves it.

@kamailio-sync
Copy link

On Wednesday 04 February 2015, Daniel-Constantin Mierla wrote:

  • save server_id in usrloc and rely on that for loading only own records
    (it requires adding a new column to location database)

What would be the use case of this? If you would want to restrict records to
only one proxy, just use separate location tables. No need to clutter the
module code for this.

Greetings,

Alex Hermann

@linuxmaniac
Copy link
Member

I just wanted to point that I have a WIP 4.2.X https://github.com/linuxmaniac/kamailio/tree/vseva/nathelper_socket_filter that we use (4.1.X) in order to share usrloc.location between proxies, using dbmode=3, splitting the work of natpinger between them filtering the users by socket.

So nathelper has a new module parameter filter_socket to control this behavior

Maybe we can get to common point to deal with different scenarios

@sokhapkin
Copy link
Contributor Author

What the parameter will do? I use db_mode 2.

@linuxmaniac
Copy link
Member

Please move the discussion to sr-users@lists.sip-router.org

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

Successfully merging this pull request may close these issues.

None yet

4 participants