Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-51824

Unable to query for recent data

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

      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. 

       

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            arathrelfall135@gmail.com Ara Threlfall
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: