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
*: add a flag EncodeType for response to use Arrow/Default format to decode. #5584
Conversation
/run-all-tests tidb=pr/12536 |
I change the proto and adjust tidb and tikv's code. |
/run-all-tests tidb=pr/12536 |
@@ -393,29 +393,29 @@ impl<SS: 'static> BatchExecutorsRunner<SS> { | |||
// Although `schema()` can be deeply nested, it is ok since we process data in | |||
// batch. | |||
match self.encode_type { | |||
EncodeType::TypeDefault => { | |||
data.reserve(result.physical_columns.maximum_encoded_size( | |||
EncodeType::TypeArrow => { |
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.
How about:
let response_encode_type;
match self.desired_encode_type {
EncodeType::TypeArrow => {
response_encode_type = EncodeType::TypeArrow;
....
}
_ => {
// For the default or unsupported encode type, use datum format.
response_encode_type = EncodeType::TypeDefault;
}
}
...
sel_resp.set_encode_type(response_encode_type);
We will only need to change code in one place when a new encoding is added.
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.
Ok. I update the code. PTAL again.
I think compatibility test (against current master) will never pass, since we made a breaking change in the protocol itself. However it is compatible with 3.0 because the breaking change has not been made over 3.0. Let's ignore this failed test? |
Signed-off-by: wshwsh12 <793703860@qq.com>
I also think so. Ignore this failed test is ok. |
@wshwsh12 Nice job. I have given my approval and you need another one to merge this PR. |
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.
LGTM
By the way, is it a problem that tipb does not have a branch for version control? I worry the tipb version in a release branch may be upgraded accidentally. |
@sticnarf 3.0 branch TiKV should rely on 3.0 branch tipb. |
/run-all-tests |
Yes. That's what I hope it were. But actually it is not specified now: https://github.com/tikv/tikv/blob/release-3.0/Cargo.toml#L137 |
@wshwsh12 I believe you need to open a small PR that upgrades the tipb dependency in TiDB and merge that PR in order to make integration test not broken after this PR is merged, right? Otherwise TiKV and TiDB will talk with different and incompatible protocol until tidb=pr/12536 is merged, which takes long time. |
/run-all-tests tidb=pr/12536 |
/run-integration-tests |
/run-all-tests tidb=pr/12536 |
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.
Change review state to "Request change" to avoid this PR being merged accidentally. You need to open a small PR in TiDB that only upgrades the tipb dependency and merge the two PR at once, in order to not break the integration.
/test tidb=pr/12536 |
/test tidb=pr/12536 |
…decode. (tikv#5584) Signed-off-by: wshwsh12 <793703860@qq.com>
…decode. (tikv#5584) Signed-off-by: wshwsh12 <793703860@qq.com>
…decode. (tikv#5584) Signed-off-by: wshwsh12 <793703860@qq.com>
Signed-off-by: wshwsh12 793703860@qq.com
What have you changed?
Please explain in detail what the changes are in this PR and why they are needed:
Now the
SelectResponse
use two field to save Arrow/Default format data. But they are both bytes array and can use the same field. We can add fieldEncodeType
instead of fieldRowBatchData
.So remove the field
RowBatchData
and add the flag fieldEncodeType
.What is the type of the changes?
Pick one of the following and delete the others:
How is the PR tested?
Please select the tests that you ran to verify your changes:
Does this PR affect documentation (docs) or should it be mentioned in the release notes?
Does this PR affect
tidb-ansible
?Refer to a related PR or issue link (optional)
TiDB: pingcap/tidb#12536
TiPB: pingcap/tipb#135
Benchmark result if necessary (optional)
Any examples? (optional)