[SERVER-46797] session refresh does not use localLogicalSessionTimeoutMinutes to delete old sessions Created: 11/Mar/20 Updated: 27/Oct/23 Resolved: 07/Jul/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Remi Jolin | Assignee: | Dmitry Agranat |
| Resolution: | Community Answered | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Steps To Reproduce: | set localLogicalSessionTimeoutMinutes: 120 and cursorTimeoutMillis : 7200000 restart mongoDB, start a cursor, get a few records and wait for 40mn, issue a getMore on the cursor (try to retrieve all the cursor's values). You'll get a cursorNotFound error |
| Participants: |
| Description |
|
If you change localLogicalSessionTimeoutMinutes parameter to a value greater then 30, for example 120, sessions are still deleted after 30mn. And the attached cursors are deleted too
program was started at 14:07
|
| Comments |
| Comment by Dmitry Agranat [ 07/Jul/20 ] | |||||||||||||||||||||||||||||||||
|
We haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. If this is still an issue for you, please provide additional information and we will reopen the ticket. Regards, | |||||||||||||||||||||||||||||||||
| Comment by Carl Champain (Inactive) [ 23/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
Thanks for getting back to us. | |||||||||||||||||||||||||||||||||
| Comment by Remi Jolin [ 23/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
Hi, I'll try the dropIndex, wait, ... process before next week but as I said before, the is no lsidTTLIndex when you issue a db.system.sessions.getIndexes() on mongos. Only the index on _id. And regarding not changing localLogicalSessionTimeoutMinutes, it's ok now for me. I added a "auto-refresh" session to my ODM and use this session in the find/aggregate below. Syntax is something like (python):
When running start_session(), there a thread n the background that will do a refreshSessions every 10mn
| |||||||||||||||||||||||||||||||||
| Comment by Carl Champain (Inactive) [ 19/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
Thank you for sending us the information.
Note that our documentation mentions the following regarding the use of localLogicalSessionTimeoutMinutes:
This means that we maintain commands for testing and commands for production differently.
We were also able to successfully recreate the single node behavior. Consequently, we opened
It is difficult for us to diagnose this particular problem without the logs.
Finally, the following log line you provided from your production cluster
appears to be an issue which was worked on in Kind regards, | |||||||||||||||||||||||||||||||||
| Comment by Remi Jolin [ 13/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
Done. zip file contains db files + conf file Enjoy | |||||||||||||||||||||||||||||||||
| Comment by Carl Champain (Inactive) [ 13/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
I've created a secure upload portal for you. Files uploaded to this portal are visible only to MongoDB employees and are routinely deleted after some time. Can you upload the test DB and the production log file? Thank you, | |||||||||||||||||||||||||||||||||
| Comment by Remi Jolin [ 13/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
if you have a private repo, I can upload the test DB. | |||||||||||||||||||||||||||||||||
| Comment by Remi Jolin [ 13/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
As it was difficult to send you the production log file (too many private information in it), I tried to reproduce the issue on a full new mongoDB installation. So test is mongoDB 4.2.3 no shard, no replication. and... I could not reproduce the issue but found some différences between the 2. production is mongoDB 4.2.3, + sharding + replication on the test system, it seems that the sessions never timeout. Here you can see LocalSessions was lastUse earlier than 2 hours :
And no sessions in system.sessions... the index on system.sessions are :
(seems ok) Many I-Control messages regarding sessions in mongodb.log (see complete log joined) 2
repeated every 5 mn.
On the other end, on the production system, there are sessions in system.sessions. But there is no "expireAfter" index. Only the index on _id.
And I found those messages in mongodb.log (every 5mn)
It seems to try to create the "expireAfter" index and cannot do it. But why is it trying to set the timeout to 1800 seconds and not 7200 ? (in conf file and with getParameter command: localLogicalSessionTimeoutMinutes: 120) Well... in test, sessions never expire and on production, they expire before timeout... | |||||||||||||||||||||||||||||||||
| Comment by Carl Champain (Inactive) [ 12/Mar/20 ] | |||||||||||||||||||||||||||||||||
|
Thank you for the report. Kind regards, |