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 DB RPC commands don't work with PSQL in 5.6 #3452
Comments
It can be a matter of db mode for usrloc, what it is its value? |
I'm currently using I just tested the command
It seems that the problem lies in the SQL query:
After conducting some research, I discovered that PostgreSQL does not support the To achieve the same functionality, we could use the following query instead:
This doesn't explain the |
The ul.flush depends on db connection being available in the rpc process, I added a small note to the docs. I am not sure who added and what is the real purpose for the other RPC commands with direct db operations, because they are using raw sql queries which should not be done inside the c code of the modules, because they are practically useless with text, redis or mongodb backends. Maybe they are just some old commands. Do you need them for some specific reasons? I recommend to use directly kamctl (or kamcli) to execute the queries over the database. |
The only command that is practically useful is When I restart the service, my goal is to ensure that the in-memory registrations are properly saved to the database, so they are not lost. However, it's unclear if this process happens automatically. I have noticed that sometimes I encounter lost registrations when restarting the service. |
Writing to database is done automatically on shutdown for db mode 2. For db mode 1 is done immediately when registration is processed, but if the database is not available, then some records might not be there and could be the only useful case for ul.flush to be called when the db was not available for db mode 1. For db mode 2 the write to db it is done on timer basis as well, the rpc process cannot write to db for mode 2. |
@miconda Thanks so much the clarification. I didn't realize it was done automatically. |
Description
I'm noticing an issue with certain usrloc RPC commands after upgrading to 5.6. I'm using "db_postgres".
If I run ul.flush like this:
None of the in-memory registrations are flushed to the DB and in the log I see a bunch of lines like this:
I see the same thing with ul.db_users:
Troubleshooting
Reproduction
Seems to happen consistently on 5.6, using psql as the db engine. I tested on 5.4 and it's not happening.
It's easier to test with
kamcmd ul.db_users location
because you need registrations that haven't been flushed to the DB for the error to manifest.The text was updated successfully, but these errors were encountered: