Code Monkey home page Code Monkey logo

Comments (5)

rwynn avatar rwynn commented on August 17, 2024

@battle-mage I've just now published a new release which hopefully should fix this issue.

from monstache.

battle-mage avatar battle-mage commented on August 17, 2024

Thank you for fast reaction!
I did not test the code yet, but when I'm looking at changes - I see that you use only timestamp itself. As we noticed - mongo uses timestamp accurate to 1 second, but if we use this timestamp - issue with document updated twice in a period of 1 second still exists.
As I noticed - mongo stores timestamps in format Timestamp(X, Y), where X - is the timestamp and Y - is the counter for this exact timestamp, so if there will be 2 changes in a short period - they will have
Timestamp(X, 1)
Timestamp(X, 2)
Shouldn't we also use this Y number for versioning?

from monstache.

rwynn avatar rwynn commented on August 17, 2024

@battle-mage I think the MongoDB Timestamp already accounts for the counter within a second in the ordinal bits. Unless I am missing something, if two events where recorded to the oplog within the same second, they would both have the same time_t component of the timestamp, but the 2nd event would have a higher ordinal component than the 1st, and thus a higher value of the entire 64 bit timestamp.

from monstache.

battle-mage avatar battle-mage commented on August 17, 2024

This makes sense, about 64-bit resulting timestamp.
We've been testing the last changes with some stress testing and looks like everything syncs just as it should. Versioning works fine :) Think we can close this issue, thanks for your work!

from monstache.

rwynn avatar rwynn commented on August 17, 2024

Thanks for bringing up this issue as well as the lack of support for sharded clusters. That was a pretty significant gap that has now been filled. I appreciate your contributions!

from monstache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.