Skip to content

Support streaming replication - #418

Draft
cthulhu-rider wants to merge 2 commits into
masterfrom
replicate-v2
Draft

Support streaming replication#418
cthulhu-rider wants to merge 2 commits into
masterfrom
replicate-v2

Conversation

@cthulhu-rider

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Comment thread object/service.proto Outdated
rpc Replicate(ReplicateRequest) returns (ReplicateResponse);

// TODO: docs.
rpc ReplicateV2(stream ReplicateRequest) returns (ReplicateResponse);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. change method name to Replicate
  2. place full object into the single message

2 will be needed anyway to implement a size-dependent logic transmitting small objects in one message

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants