Giter Club home page Giter Club logo

Comments (4)

coffeemug avatar coffeemug commented on July 20, 2024

Depending on what you mean by out-of-date count, I think count command itself should be out-of-date. It essentially already is because of the traversal -- while the system runs the traversal to count the number of keys, the user may insert or delete keys which count won't see. Since there are no cluster-wide snapshot isolation guarantees here, and the traversal may take a long time, our current count is technically more "out-of-date" than an out-of-date constant time count would be.

As long as we still go to the masters to grab the number per b-tree (so there is no chance of getting it from a heavily out-of-date replica on a net split), it should just be done as the count command. If the user passes an out-of-date flag, we should do it from the replicas. And we should drop the traversal version of count all together.

from rethinkdb.

jdoliner avatar jdoliner commented on July 20, 2024

I think up-to-date might be getting a bit conflated right now.

Count is an up-to-date command by default right now (like every command in reql). This means that it may interleave with commands from other connections but it is guaranteed to see anything that has been acknowledged on the same connection. That is you can't take an empty table, insert a document on a connection do count and get back 0 (all on the same connection). I think we want to keep this as a guaranteed behavior since we advertise it heavily and people could be depending on it.

As long as we still go to the masters to grab the number per b-tree (so there is no chance of getting it from a heavily out-of-date replica)

Remember masters don't actually store a copy of the data. Replicas do. There's a replica on the same machine as the master which is I assume what you're talking about but that replica is the same as every other replica it's not guaranteed to be anymore up to date. In fact in this case it's going to almost certainly be the least up-to-date replica.

And we should drop the traversal version of count all together.

We can't drop traversal version of count all together because we still need it for anything that isn't just a simple table traversal. For example if someone does

table.filter(lambda x: x["foo"] == 5).count()

We don't have any prestored counts which will tell us the answer to this so we need to just do the traversal version of count.

from rethinkdb.

coffeemug avatar coffeemug commented on July 20, 2024

Moving to 1.14-polish. This isn't as important as major features, and I'd like to agree on those first. We can tackle this later.

from rethinkdb.

coffeemug avatar coffeemug commented on July 20, 2024

Closing in favor of #152. There is no reason to have two issues for this.

from rethinkdb.

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.