Support streaming replication - #418
Conversation
| rpc Replicate(ReplicateRequest) returns (ReplicateResponse); | ||
|
|
||
| // TODO: docs. | ||
| rpc ReplicateV2(stream ReplicateRequest) returns (ReplicateResponse); |
There was a problem hiding this comment.
my initial thought how to make new op as close to Replicate as possible is to stream its requests. Require additional messages to have object.payload (i.e. chunk) field only
having this, for new client to go back to old API, the only things to be done are
- change method name to
Replicate - place full object into the single message
2 will be needed anyway to implement a size-dependent logic transmitting small objects in one message
There was a problem hiding this comment.
Object size is known before the request is made, so I'd opt for simpler v2 protocol (two specific request-level fields for header and payload). Magic payload/non-payload handling is harder to implement to me. ReplicateRequest can be extended with payload field as well leaving object for complete object or header only depending on version. Needs to be checked against real code anyway.
There was a problem hiding this comment.
same as in #333, the main thing to decide is whether 1st message carries payload prefix (full payload in particular) or not
if no, we'll have PutRequest-like stream w/o meta/verification headers. Otherwise, prefix and extra chunk fields can be transmitted in the same field (currently proposed) or in the diff ones (PUT)
i'll make diff commits for all opts to make it clear
No description provided.