Skip to content

Support up-to-date reads from replicas #145

Open

Description

@srh

IRC user @xetorthio (if the github user is the same person) talked about being able to read from replicas while writing to the master, instead of having to send all reads to the master (which would swamp the machine). But what was desired is for reads to not be out-of-date -- reads and writes should preserve ordering. The wording was more like this:

<xetorthio> srh_: I should check how long it takes. but I could live with that. I wonder if I can tell rethink to replicate to all the available nodes for a shard. and not a specific number
<srh_>I think you need a specific number right now.
<xetorthio> srh_: that sucks, because I requirement would be that a node can never go down to be able to write

However, directly implementing that feature is not a good idea: it wouldn't work in the presence of netsplits, since the parser could send a write to the master and then try a read from a replica that is currently disconnected from the master.

Implementing support for up-to-date reads from replicas, however, is doable and not fragile. The parser sends to some replica a kind of out-of-date read that says "wait until the write with timestamp t comes in before processing", where t is the timestamp of the last write that went through the parser. (And is t actually something trickier, some kind of branch history/timestamp pair??)

Activity

  1. thelinuxlich commented on Mar 12, 2018

    @thelinuxlich

    @srh because of readMode: "outdated", shouldn't this be closed?

  2. srh commented on Mar 26, 2018

    @srh
    ContributorAuthor

    No. readMode: "outdated" means you'll perform an outdated read -- this issue says, wait until you have a non-outdated value.

  3. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions