-
Notifications
You must be signed in to change notification settings - Fork 8
Support for read your writes consistency #55
base: master
Are you sure you want to change the base?
Conversation
src/fabric_view_reduce.erl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "stale trumps RYW" logic would be relevant here as well, right?
|
All of the signature changes in fabric.erl are unfortunate. I really want to refactor that interface to accept Options as proplist and do away with the record crap. Then we could have just added this directly to Options. C'est la vie; at least we're only talking about changing the interface on a single node at a time (as opposed to modifying the RPC protocol between nodes). We should think about how to deal with multi-valued X-Couch-RYW headers. Could certainly see a client saving two different documents and combining the X-Couch-RYW headers on a subsequent request. We ought to be able to merge those, provided we document the behavior in the case where the header values specify non-intersectin sets of copies for a shard. |
|
This last commit addresses the comment about including the current sequence number to help speed queries up. I don't like what I had to do in I'll see if I can refactor this some more after dinner |
|
For the multi-valued RYW headers, we would assume the user would supply a list of values? It seems the machinery to do this is now there with this last commit where we capture the current seq for each of the shards involved. For the multi-valued case we would then need to take the maximum of the sequences whenever we have an intersection. We also have to be careful in |
|
@kocolosk this has seen a lot of changes now, let me know if you'd like a rebase/squash before you have another read. |
|
@kocolosk - actually I see a better approach here, ignore this for now |
|
@bdionne, I just realized there's a problem with your |
|
@kocolosk - thanks for the feedback. The I should be able to eliminate it and add to the Good catch on the |
|
Cool. I'm not so concerned with the extra message send (though it'll be nice to optimize that away) as I am with the possibility that a shard copy can "claim" some portion of the ring by sending that message even though that copy's view index is nowhere near built. |
|
@kocolosk - here's a new cut that takes your suggestions to heart. It's a little more complex. I didn't fix the I've only tested the easy paths and will likely refactor this more and do another squash |
|
@bdionne can you shove the |
src/fabric.erl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I missed this. You're suppressing the EncShards here, so your old code was actually correct. I'd rather keep parity with the ok case and report them to the client.
On updates, an encoding of the shards that participate, along with the current
sequence, is returned to the client in a header X-Couch-RYW. If this header is then
passed in to subsequent view queries, the encoded shards will be used.
Multiple X-Couch-RYW headers can be used.
This encoded list of {shard, seq} is also returned on view requests, even if an
X-Couch_RYW header was not specified from a previous update. In the case
stale=ok is not used, and view groups are kicked off these sequences will provide
something between stale=ok and the current sequence on subsequent calls.
Multiple X-Couch_RYW headers can also be specified, in which case the maximum sequence
number is used for shards that are in the intersection of the two sets.
BugzID: 11393
BigzID: 11393
BugzID: 11393
On updates, an encoding of the shards that participate is returned to the client in a header X-Couch-RYW. If this header is then passed in to subsequent view queries, the encoded shards will be used.
BugzID: 11393