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

overflow_error: robin_hood::map overflow #4702

Closed
nebula-bots opened this issue Oct 10, 2022 · 1 comment · Fixed by #4707
Closed

overflow_error: robin_hood::map overflow #4702

nebula-bots opened this issue Oct 10, 2022 · 1 comment · Fixed by #4707
Assignees
Labels
auto-sync severity/minor Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@nebula-bots
Copy link
Contributor

Your Environments (required)
nebula-graphd version 3.3.0-ent, Git: bc87042, Build Time: Oct 8 2022 20:40:03
This source code is licensed under Apache 2.0 License.

How To Reproduce(required)

Steps to reproduce the behavior:

(root@nebula) [sf1]> use sf1
Execution succeeded (time spent 874/444017 us)

Mon, 10 Oct 2022 15:19:10 CST

(root@nebula) [sf1]> profile {GO FROM 32985348833536,24189255813121 OVER KNOWS  REVERSELY  YIELD DISTINCT  properties(edge)}
[ERROR (-1005)]: std::overflow_error: robin_hood::map overflow

Mon, 10 Oct 2022 15:19:12 CST

Expected behavior

ngql execution success

@nebula-bots nebula-bots added auto-sync severity/minor Severity of bug type/bug Type: something is unexpected labels Oct 10, 2022
@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Oct 11, 2022
@jievince
Copy link
Contributor

The dedup executor uses robin_hood to deduplicate data.
The readme of robin_hood says:

Depends on good Hashing. For a really bad hash the performance will not only degrade like in std::unordered_map, the map will simply fail with an std::overflow_error

In the case YIELD DISTINCT properties(edge), properties(edge) returns a MAP, which has a bad hash method for this case:

namespace std {
std::size_t hash<nebula::Map>::operator()(const nebula::Map& m) const noexcept {
  size_t seed = 0;
  for (auto& v : m.kvs) {
    seed ^= hash<std::string>()(v.first) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
  }
  return seed;
}

Only the key of MAP particates in hashing.
While the MAPs returned by properties(edge) have the same keys, which leads to the same hashing result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-sync severity/minor Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants