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(bulk): removed buffer max size #8841

Merged
merged 1 commit into from
May 29, 2023
Merged

Conversation

davideaimar
Copy link
Contributor

Problem

On huge datasets, bulk import crashes with this stack trace:

panic: z.Buffer max size exceeded: 68719476736 offset: 68719476718 grow: 51

goroutine 421 [running]:
github.com/dgraph-io/ristretto/z.(*Buffer).Grow(0xc050d17c00, 0x33)
        /home/runner/go/pkg/mod/github.com/dgraph-io/[email protected]/z/buffer.go:180 +0x55b
github.com/dgraph-io/ristretto/z.(*Buffer).SliceAllocate(0xc050d17c00, 0x2f)
        /home/runner/go/pkg/mod/github.com/dgraph-io/[email protected]/z/buffer.go:266 +0x2e
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.(*mapIterator).Next(0xc00e56f410, 0x3?, {0xc034740c40, 0x1d, 0x20})
        /home/runner/work/dgraph/dgraph/dgraph/cmd/bulk/reduce.go:206 +0x126
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.(*reducer).reduce.func2()
        /home/runner/work/dgraph/dgraph/dgraph/cmd/bulk/reduce.go:486 +0x5aa
created by github.com/dgraph-io/dgraph/dgraph/cmd/bulk.(*reducer).reduce
        /home/runner/work/dgraph/dgraph/dgraph/cmd/bulk/reduce.go:476 +0x452

Solution

Removing hard limit of 64GB to buffer sizes avoided panic and successfully completed the import.

@dgraph-bot dgraph-bot added area/bulk-loader Issues related to bulk loading. go Pull requests that update Go code labels May 26, 2023
Copy link
Contributor

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

If tests pass, good to merge!

@mangalaman93 mangalaman93 merged commit 82c4a71 into dgraph-io:main May 29, 2023
dgraph-bot pushed a commit that referenced this pull request Jul 7, 2023
## Problem

On huge datasets, bulk import crashes with this stack trace:

```
panic: z.Buffer max size exceeded: 68719476736 offset: 68719476718 grow: 51

goroutine 421 [running]:
github.com/dgraph-io/ristretto/z.(*Buffer).Grow(0xc050d17c00, 0x33)
        /home/runner/go/pkg/mod/github.com/dgraph-io/[email protected]/z/buffer.go:180 +0x55b
github.com/dgraph-io/ristretto/z.(*Buffer).SliceAllocate(0xc050d17c00, 0x2f)
        /home/runner/go/pkg/mod/github.com/dgraph-io/[email protected]/z/buffer.go:266 +0x2e
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.(*mapIterator).Next(0xc00e56f410, 0x3?, {0xc034740c40, 0x1d, 0x20})
        /home/runner/work/dgraph/dgraph/dgraph/cmd/bulk/reduce.go:206 +0x126
github.com/dgraph-io/dgraph/dgraph/cmd/bulk.(*reducer).reduce.func2()
        /home/runner/work/dgraph/dgraph/dgraph/cmd/bulk/reduce.go:486 +0x5aa
created by github.com/dgraph-io/dgraph/dgraph/cmd/bulk.(*reducer).reduce
        /home/runner/work/dgraph/dgraph/dgraph/cmd/bulk/reduce.go:476 +0x452
```

## Solution

Removing hard limit of 64GB to buffer sizes avoided panic and
successfully completed the import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bulk-loader Issues related to bulk loading. go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

5 participants