-
Notifications
You must be signed in to change notification settings - Fork 322
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: core dump in macos running sql_cluster_test #1892
fix: core dump in macos running sql_cluster_test #1892
Conversation
if case contains resource field
`DistributeWindowIterator::SeekToFirst` will set `it_` even there is no data locally, this lead to use `it_` instead `kv_it_` to fetch row data when using `GetKey()`, which will core the test
Codecov Report
@@ Coverage Diff @@
## main #1892 +/- ##
============================================
- Coverage 75.69% 75.69% -0.01%
Complexity 347 347
============================================
Files 613 613
Lines 117018 117031 +13
Branches 1024 1024
============================================
+ Hits 88579 88584 +5
- Misses 28230 28238 +8
Partials 209 209
Continue to review full report at Codecov.
|
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
kv_it_ = kv.second->Traverse(tid_, cur_pid_, index_name_, "", 0, FLAGS_traverse_cnt_limit, count); | ||
if (kv_it_ && kv_it_->Valid()) { | ||
response_vec_.emplace_back(kv_it_->GetResponse()); | ||
auto it = kv.second->Traverse(tid_, kv.first, index_name_, "", 0, FLAGS_traverse_cnt_limit, count); |
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.
the Seek
has the same problem. it's better to check it_ validation in GetKey
and GetValue
function
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.
we should ensure only zero or one of it_
and kv_it_
is not null.
So the check here is whether it_
and kv_it_
both not null.
It is it_
and kv_it_
's duty to check valid itself before GetKey
or GetValue
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.
we should improve type safety for iterators, in both definition and implementation. E.g the GetKey
method of WindowIterator
should mark as const
sql_cluster_test
core in darwin: when there is no partition data for a table locally, theDistributeWindowIterator::SeekToFirst
setit_
still. This cores the program when user want toDistributeWindowIterator::GetKey()
becauseit_
is not null, so it try to get key data fromit_
toydb_run_engine
bootstrapping