greptimedb
greptimedb copied to clipboard
Pass query context down to region server service in Datanode
What type of enhancement is this?
Refactor
What does the enhancement do?
Now the region server service in Datanode needs a meaningful query context. For example, it needs the time zone info to correctly construct datetime related udf. You can see this in RegionServerInner::handle_read
. Currently we only pass down the time zone info through RegionRequestHeader
, it's better to pass down the whole query context.
Implementation challenges
No response
I would like to try. Can you give me more details?
I would like to try. Can you give me more details?
Hi @Kelvinyu1117, I recommend reading the code for splitting and inserting values into different datanodes. It's the opposite operation of inserting, and it could be a little tricky.
I would like to try. Can you give me more details?
Hi @Kelvinyu1117, I recommend reading the code for splitting and inserting values into different datanodes. It's the opposite operation of inserting, and it could be a little tricky.
Looks like you misunderstand this issue.
Looks like you misunderstand this issue.
Oh, I see. I took it as another issue pruning partition during predicate pushdown.🥲
Thanks, anyway, I am trying to understand how the Datanode interact with the region server now.
Thanks, anyway, I am trying to understand how the Datanode interact with the region server now.
Feel free to ask if you have any questions. @MichaelScofield Could you provide some related code link that may help @Kelvinyu1117 ?
Thanks, anyway, I am trying to understand how the Datanode interact with the region server now.
Feel free to ask if you have any questions. @MichaelScofield Could you provide some related code link that may help @Kelvinyu1117 ?
Sure.
@Kelvinyu1117 :
- First you can define how the query context is represented in protobuf message here. And place it in
message RegionRequestHeader
- Then in
MergeScanExec::to_stream
, serialize theQueryContext
to its protobuf counterparts, set the corresponding field inRegionRequestHeader
. This is how the query context get passed down to region server(datanode). - Finally in
RegionServerInner::handle_read
, reconstruct theQueryContext
from the protobuf bytes.
Thanks, anyway, I am trying to understand how the Datanode interact with the region server now.
Feel free to ask if you have any questions. @MichaelScofield Could you provide some related code link that may help @Kelvinyu1117 ?
Sure.
@Kelvinyu1117 :
- First you can define how the query context is represented in protobuf message here. And place it in
message RegionRequestHeader
- Then in
MergeScanExec::to_stream
, serialize theQueryContext
to its protobuf counterparts, set the corresponding field inRegionRequestHeader
. This is how the query context get passed down to region server(datanode).- Finally in
RegionServerInner::handle_read
, reconstruct theQueryContext
from the protobuf bytes.
Thanks, let me try it and open an PR.