[SERVER-51824] Unable to query for recent data Created: 23/Oct/20  Updated: 30/Nov/20  Resolved: 17/Nov/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ara Threlfall Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

I have two micro services where one write to DB and another read from DB.

The first micro service is written in C++ while the other is written in NodeJS.

When querying for data say for a IP the MongoDB return older data or no data at all (In case if the client is new) but If I query like say after 5 min it returns the recent data.

await Sessions.find({ ip: ip}).sort({ receive_time: -1 }).lean().limit(1).exec();

Every record on DB has a field called receive_time which I used to store 64 bit timestamp 

I don't think this has to do with concurrency at all because C++ is performant enough to write to DB faster

Worth noting, The database is in a separate server.

If it possible to disable cache, please tell me how, I'd disable it completely. 

 



 Comments   
Comment by Kelsey Schubert [ 30/Nov/20 ]

arathrelfall135@gmail.com, I’ve removed your last two comments as they violate our MongoDB Code of Conduct. Reviewing the threads on this ticket and on the community forums, there is no evidence of a MongoDB Server issue as Stennie explained in his comment. I recognize your frustration, but, unfortunately, it is not feasible for us to investigate and diagnose issues outside of MongoDB that require a deep understanding of the application layer on this jira project.

Comment by Eric Sedor [ 17/Nov/20 ]

arathrelfall135@gmail.com, I understand your frustration but encourage staying engaged on the community forums and working towards example code that clearly demonstrates the behavior outside of the app, if possible, or highlights what the app is doing that's leading to this. Again, the SERVER project is for issues with the MongoDB core server, so we need a clearer starting point that implicates server behavior. I'm going to close this ticket but we can re-open it given additional information.

Sincerely,
Eric

Comment by Ara Threlfall [ 10/Nov/20 ]

Any update?

Comment by Ara Threlfall [ 03/Nov/20 ]

I did like you said but received no further responses after providing everything they have asked.

Here is the thread

https://developer.mongodb.com/community/forums/t/unable-to-query-for-recent-data/10943

Comment by Eric Sedor [ 26/Oct/20 ]

I'm sorry to hear that arathrelfall135@gmail.com and understand that would be frustrating. It is indeed possible a bug is involved, but to investigate that here we would need to see the problem narrowed down. That no data is returned by a new client does suggest some kind of race condition even if it is not an issue of the performance of concurrent operations.

Unless you are able to reproduce the issue on a specific set of documents outside of the use of await and lean, we really do think the best next step is to post on the MongoDB Developer Community Forums. MongoDB team members and community champions are active in the community forums and may be able to assist you there. When you post there, it would be helpful to share more details about your environment such as your versions of Node.js, MongoDB Node.js driver, and MongoDB server; the type of deployment (standalone, replica set, or sharded cluster); and the indexes on the collection.

Comment by Ara Threlfall [ 26/Oct/20 ]

Eric,

I've asked on many communities including Stackoverflow and even waited a year to get an answer so I assume this is a bug that no one can find answer for. 

Comment by Eric Sedor [ 26/Oct/20 ]

Hi arathrelfall135@gmail.com,

The SERVER project is for bugs and feature suggestions for the MongoDB server. For this issue we'd like to encourage you to start by asking our community for help by posting on the MongoDB Developer Community Forums.

If the discussion there leads you to suspect a bug in the MongoDB server, then we'd want to discuss here in the SERVER project. Does this make sense?

Sincerely,
Eric

Generated at Thu Feb 08 05:26:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.