-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix](move-memtable) fix schema use-after-free in delta writer v2 #30254
Conversation
run buildall |
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.
clang-tidy made some suggestions
@@ -70,7 +70,8 @@ inline std::ostream& operator<<(std::ostream& ostr, const TabletStream& tablet_s | |||
return ostr; | |||
} | |||
|
|||
Status TabletStream::init(OlapTableSchemaParam* schema, int64_t index_id, int64_t partition_id) { | |||
Status TabletStream::init(std::shared_ptr<OlapTableSchemaParam> schema, int64_t index_id, |
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.
warning: method 'init' can be made static [readability-convert-member-functions-to-static]
be/src/runtime/load_stream.h:49:
- Status init(std::shared_ptr<OlapTableSchemaParam> schema, int64_t index_id, int64_t partition_id);
+ static Status init(std::shared_ptr<OlapTableSchemaParam> schema, int64_t index_id, int64_t partition_id);
TPC-H: Total hot run time: 39136 ms
|
TPC-DS: Total hot run time: 176150 ms
|
ClickBench: Total hot run time: 30.88 s
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
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
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
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
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.
clang-tidy made some suggestions
@@ -70,7 +70,8 @@ inline std::ostream& operator<<(std::ostream& ostr, const TabletStream& tablet_s | |||
return ostr; | |||
} | |||
|
|||
Status TabletStream::init(OlapTableSchemaParam* schema, int64_t index_id, int64_t partition_id) { | |||
Status TabletStream::init(std::shared_ptr<OlapTableSchemaParam> schema, int64_t index_id, |
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.
warning: method 'init' can be made static [readability-convert-member-functions-to-static]
be/src/runtime/load_stream.h:49:
- Status init(std::shared_ptr<OlapTableSchemaParam> schema, int64_t index_id,
+ static Status init(std::shared_ptr<OlapTableSchemaParam> schema, int64_t index_id,
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 38773 ms
|
TPC-DS: Total hot run time: 186254 ms
|
ClickBench: Total hot run time: 31.23 s
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
run p0 |
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
PR approved by at least one committer and no changes requested. |
Proposed changes
DeltaWriterV2
are shared among sinks (OlapTableSinks).After #30098, sinks who complete first will not wait for stream close.
They will also not waiting for
DeltaWriterV2
close.Use-after-free may happen because
DeltaWriterV2
and its components are referencingTupleDescriptor
andSlotDescriptor
by raw pointer,Since
TupleDescriptor
andSlotDescriptor
are part ofOlapTableSchemaParam
from a sink.This PR changes
OlapTableSchemaParam
passed toDeltaWriterV2
to be a shared pointer.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...