Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop] add request type field at the head of task data, exchange parse order between Log and GetRequest #7871

Merged
merged 2 commits into from Mar 10, 2022

Conversation

zrlw
Copy link
Contributor

@zrlw zrlw commented Mar 2, 2022

What is the purpose of the change

see #7757

@zrlw zrlw changed the title [develop] add request type field at the head of task data [develop] add request type field at the head of task data, exchange parse order between Log and GetRequest Mar 2, 2022
Copy link
Collaborator

@KomachiSion KomachiSion left a comment

Choose a reason for hiding this comment

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

这会导致升级不兼容。

@KomachiSion
Copy link
Collaborator

我同意两次try catch非常不优雅,但是目前这样运行起来无问题,

关于issue中提出的关于先Write的异议,目前没有WriteRequest只设置了2个字段,我查看至少都有设置3个以上,比如data,operation和group。

因此在找到合理的替代方式之前建议保持原样。

return result;
if (bytes[0] == REQUEST_TYPE_FIELD_TAG) {
if (bytes[1] == REQUEST_TYPE_READ) {
result = ReadRequest.parseFrom(bytes);
Copy link
Collaborator

Choose a reason for hiding this comment

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

bytes中添加了2个标示位, parse之前应该移除掉这两个标示位,才能正确解析吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不用删除,只是解析的结果多了个unknown fields,field的名称为编号7,grpc服务端和客户端可以通过unknown fields配置自己特有的字段,目的就是为了相互兼容老版本

@zrlw
Copy link
Contributor Author

zrlw commented Mar 3, 2022

这会导致升级不兼容。

兼容的,利用的是unknown fields机制

@KomachiSion
Copy link
Collaborator

有搭建集群进行一下测试吗?

@zrlw
Copy link
Contributor Author

zrlw commented Mar 8, 2022

有搭建集群进行一下测试吗?

1.x一直在用集群压测试,2.0只测了单元功能。

@KomachiSion KomachiSion merged commit 94f894f into alibaba:develop Mar 10, 2022
@KomachiSion KomachiSion added area/Nacos Core kind/bug Category issues or prs related to bug. labels Mar 10, 2022
@KomachiSion KomachiSion added this to the 2.1.0 milestone Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Nacos Core kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants