This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
refactor(rpc): refactor request meta to adapt to new version of rpc protocol #82
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hycdong
reviewed
Feb 21, 2020
hycdong
added
backup_request
backup request feature
enhancement
New feature or request
labels
Feb 28, 2020
hycdong
previously approved these changes
Feb 28, 2020
acelyc111
previously approved these changes
Feb 28, 2020
neverchanje
reviewed
Feb 28, 2020
@@ -31,3 +31,10 @@ struct query_cfg_response | |||
4:bool is_stateful; | |||
5:list<partition_configuration> partitions; | |||
} | |||
|
|||
struct request_meta { |
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.
These fields should be defined optional, be consistent with what server-side defines.
Actually I suggest just copy the thrift codes from pegasus.
// Metadata field of the request in rDSN's thrift protocol (version 1).
// TODO(wutao1): add design doc of the thrift protocol.
struct thrift_request_meta_v1
{
// The replica's gpid.
1:optional i32 app_id;
2:optional i32 partition_index;
// The timeout of this request that's set on client side.
3:optional i32 client_timeout;
// The hash value calculated from the hash key.
4:optional i64 client_partition_hash;
// Whether it is a backup request. If true, this request (only if it's a read) can be handled by
// a secondary replica, which does not guarantee strong consistency.
5:optional bool is_backup_request;
}
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.
I don`t suggest to use optional in java client. We use optional in pegasus server because we want it to have good compatibility, so we can delete these data in later version of java client. But in this version, these data is a must.
foreverneverer
previously approved these changes
Feb 28, 2020
neverchanje
approved these changes
Feb 28, 2020
neverchanje
changed the title
refactor(rpc): refactor request meta
refactor(rpc): refactor request meta to adapt to new version of rpc protocol
Feb 28, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor our thrift message parser by redesigning the request header format, to support adding is_backup_request new field.
Side effect:
This pull request will import incompatibility.