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

handle the core generated in the lookup on command #3981

Closed
wants to merge 1 commit into from
Closed

handle the core generated in the lookup on command #3981

wants to merge 1 commit into from

Conversation

flymysql
Copy link
Contributor

@flymysql flymysql commented Mar 4, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number: #3978

Description:

When using the lookup on command, if there is only one element in the list where tag.propName in ["xx"], there will be a core generated

just like

lookup on click where click.itemid in ["0"] and click.times >= "2015-10-10 10:10:10"

coredump msg:

#0  0x0000000000ece8e7 in nebula::graph::ExpressionUtils::getContainerExprOperands(nebula::Expression const*) ()
#1  0x0000000000eceddc in nebula::graph::ExpressionUtils::rewriteInExpr(nebula::Expression const*) ()
#2  0x0000000001005819 in nebula::opt::OptimizeEdgeIndexScanByFilterRule::transform(nebula::opt::OptContext*, nebula::opt::MatchedResult const&) const ()
#3  0x0000000000fef55b in nebula::opt::OptGroup::explore(nebula::opt::OptRule const*) ()
#4  0x0000000000fefa21 in nebula::opt::OptGroup::exploreUntilMaxRound(nebula::opt::OptRule const*) ()
#5  0x0000000000fefc6c in nebula::opt::OptGroupNode::explore(nebula::opt::OptRule const*) ()
#6  0x0000000000fef489 in nebula::opt::OptGroup::explore(nebula::opt::OptRule const*) ()
#7  0x0000000000fefa21 in nebula::opt::OptGroup::exploreUntilMaxRound(nebula::opt::OptRule const*) ()
#8  0x0000000000fee445 in nebula::opt::Optimizer::doExploration(nebula::opt::OptContext*, nebula::opt::OptGroup*) ()
#9  0x0000000000fee887 in nebula::opt::Optimizer::findBestPlan(nebula::graph::QueryContext*) ()
#10 0x0000000000f1e89f in nebula::graph::QueryInstance::findBestPlan() ()
#11 0x0000000000f2082a in nebula::graph::QueryInstance::validateAndOptimize() ()
#12 0x0000000000f20ce1 in nebula::graph::QueryInstance::execute() ()
#13 0x0000000000f1b5a2 in nebula::graph::QueryEngine::execute(std::unique_ptr<nebula::graph::RequestContext<nebula::ExecutionResponse>, std::default_delete<nebula::graph::RequestContext<nebula::ExecutionResponse> > >) ()
#14 0x0000000000ef3d49 in nebula::graph::GraphService::future_execute(long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda(nebula::StatusOr<std::shared_ptr<nebula::graph::ClientSession> >)#1}::operator()(nebula::StatusOr<std::shared_ptr<nebula::graph::ClientSession> >) ()
#15 0x0000000000ef48af in _ZN5folly6detail8function14FunctionTraitsIFvRNS_7futures6detail8CoreBaseEONS_8Executor9KeepAliveIS7_EEPNS_17exception_wrapperEEE9callSmallIZNS4_4CoreIN6nebula8StatusOrISt10shared_ptrINSH_5graph13ClientSessionEEEEE11setCallbackIZNS4_10FutureBaseISN_E18thenImplementationIZNOS_6FutureISN_E9thenValueIZNSK_12GraphService14future_executeElRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEUlSN_E_EENST_INS4_19valueCallableResultISN_T_E10value_typeEEEOS17_EUlSA_ONS_3TryISN_EEE_NS4_25tryExecutorCallableResultISN_S1F_vEEEENSt9enable_ifIXntsrNT0_13ReturnsFutureE5valueENS1J_6ReturnEE4typeES1B_S1J_NS4_18InlineContinuationEEUlSA_S1E_E_EEvS1B_OSJ_INS_14RequestContextEES1O_EUlS6_SA_SC_E_EEvS6_SA_SC_RNS1_4DataE ()
#16 0x0000000001df506c in ?? ()
#17 0x0000000001bff887 in virtual thunk to apache::thrift::concurrency::FunctionRunner::run() ()
#18 0x0000000001d0ff53 in apache::thrift::concurrency::ThreadManager::Impl::Worker::run() ()
#19 0x0000000001d13bad in apache::thrift::concurrency::PthreadThread::threadMain(void*) ()
#20 0x00007fea6db13ea5 in start_thread () from /lib64/libpthread.so.0

How do you solve it?

check the Expr kind before getContainerExprOperands

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@CLAassistant
Copy link

CLAassistant commented Mar 4, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


兰州小红鸡 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@flymysql flymysql changed the title Update ExpressionUtils.cpp handle the core generated in the lookup on command Mar 4, 2022
@Sophie-Xie Sophie-Xie requested review from Aiee and CPWstatic March 4, 2022 07:22
@Sophie-Xie Sophie-Xie added ready-for-testing PR: ready for the CI test community Source: who proposed the issue labels Mar 4, 2022
@Shylock-Hg
Copy link
Contributor

Please add test case.

auto containerOperands = getContainerExprOperands(inExpr->right());
std::vector<Expression *> containerOperands;
if (inExpr->kind() == Expression::Kind::kRelIn) {
containerOperands = getContainerExprOperands(inExpr->right());
Copy link
Contributor

Choose a reason for hiding this comment

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

if containerOperands is empty, the orExpr might not construct correctly. Besides, rewriteInExpr require a IN expression.

@Aiee
Copy link
Contributor

Aiee commented Mar 4, 2022

What is the version you are using?
I am able to run LOOKUP ON player WHERE player.age IN [40] AND player.name >= "Kobe Bryant" YIELD id(vertex) as id, player.age without problem:

(root@nebula) [nba]>  LOOKUP ON player WHERE player.age IN [40] AND player.name >= "Kobe Bryant" YIELD id(vertex) as id, player.age
+---------------+------------+
| id            | player.age |
+---------------+------------+
| "Kobe Bryant" | 40         |
+---------------+------------+
Got 1 rows (time spent 5283/5653 us)

@Aiee
Copy link
Contributor

Aiee commented Mar 7, 2022

Also, are there indexes built for itemid or times?

@flymysql
Copy link
Contributor Author

flymysql commented Mar 7, 2022

Also, are there indexes built for itemid or times?

yes, i have build a mul index on itemid and times

@Aiee
Copy link
Contributor

Aiee commented Mar 8, 2022

What is the version you are using?

From the issue, seems you are using v2.6.1.
This problem has been fixed in v3.0.0 PR: #3525

@Sophie-Xie
Copy link
Contributor

What is the version you are using?

From the issue, seems you are using v2.6.1. This problem has been fixed in v3.0.0 PR: #3525

@flymysql pls try it. If it's ok, we will close this pr. Thanks for you contributing:)

@flymysql flymysql closed this Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Source: who proposed the issue ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants