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

Fix/create variable map #4822

Merged
merged 9 commits into from
Nov 10, 2022
Merged

Conversation

Shylock-Hg
Copy link
Contributor

@Shylock-Hg Shylock-Hg commented Nov 3, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Close https://github.com/vesoft-inc/nebula-ent/issues/1539

Description:

The MT-safe of variable map is guaranteed by pre inserted before runtime, so I force to insert variable to map when symbol table create new variable.

How do you solve it?

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 .....

@Shylock-Hg Shylock-Hg added ready-for-testing PR: ready for the CI test type/bug Type: something is unexpected cherry-pick-v3.3 PR: need cherry-pick to this version labels Nov 3, 2022
@Sophie-Xie Sophie-Xie removed the cherry-pick-v3.3 PR: need cherry-pick to this version label Nov 3, 2022
Feature: Test MT-safe varaibles

Scenario: Binary plan of minus
# It's not stable to reproduce the bug, so we run it 100 times
Copy link
Contributor

Choose a reason for hiding this comment

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

So, what's the real reason about the crash? not thread-safe data structure usage?

Copy link
Contributor Author

@Shylock-Hg Shylock-Hg Nov 7, 2022

Choose a reason for hiding this comment

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

Yes, all variable should insert to map in building stage, and executor is running on MT-environment, so executor insert new variable will lead to condition race.

Copy link
Contributor

Choose a reason for hiding this comment

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

Which line of code inserts new variabes to map in runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it leads the query YIELD 1 AS number MINUS YIELD 2 AS number to crash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

inputVar = vctx_->anonVarGen()->getVar();

@dutor
Copy link
Contributor

dutor commented Nov 9, 2022

Anything related to vesoft-inc/nebula-ent#1576 ?
And please take care similar issue introduced in #4498

@Shylock-Hg
Copy link
Contributor Author

Anything related to vesoft-inc/nebula-ent#1576 ? And please take care similar issue introduced in #4498

Yes I created a issue related to #4498 in #4843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready-for-testing PR: ready for the CI test type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants