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

Concurrent create tag and edge with same name may be both succeed. #3376

Closed
cangfengzhs opened this issue Nov 29, 2021 · 0 comments · Fixed by #3735
Closed

Concurrent create tag and edge with same name may be both succeed. #3376

cangfengzhs opened this issue Nov 29, 2021 · 0 comments · Fixed by #3735
Assignees
Labels
priority/med-pri Priority: medium type/bug Type: something is unexpected
Milestone

Comments

@cangfengzhs
Copy link
Contributor

Please check the FAQ documentation before raising an issue

Please check the FAQ documentation and old issues before raising an issue in case someone has asked the same question that you are asking.

Describe the bug (required)

 // CreateTagProcessor.cpp
  {
    // if there is an edge of the same name
    // TODO: there exists race condition, we should address it in the future
    folly::SharedMutex::ReadHolder rHolder(LockUtils::edgeLock());
    auto conflictRet = getEdgeType(spaceId, tagName);
    ......
  }  // <------------------------Unlock!!!!!!!!!
  auto columns = req.get_schema().get_columns();
  ......

Because edgeLock unlock before finish create tag, if there are two threads create tag/edge concurrency, may be both succeed.

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id (e.g. a3ffc7d8)

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1
  2. Step 2
  3. Step 3

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Provide logs and configs, or any other context to trace the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/med-pri Priority: medium type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants