Skip to content

Server crash & corruption with large mutations #2238

@alexmilowski

Description

@alexmilowski

What version of Dgraph are you using?

1.0.4

What is the hardware spec (RAM, OS)?

Mac OS / Docker

Steps to reproduce the issue (command/config used to run Dgraph).

my setup

Running dgraph locally via docker:

zero:

docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/workspace/dgraph/data/:/dgraph --name dgraph-local dgraph/dgraph dgraph zero

one server:

docker exec -it dgraph-local dgraph server --memory_mb 16384 --zero localhost:5080

Generating Data

The following program generates mutations like:

{
set {
_:n1 <count> "1"^^<xs:int> .
_:n2 <count> "2"^^<xs:int> .
_:n3 <count> "3"^^<xs:int> .
_:n4 <count> "4"^^<xs:int> .
_:n5 <count> "5"^^<xs:int> .
_:n6 <count> "6"^^<xs:int> .
_:n7 <count> "7"^^<xs:int> .
_:n8 <count> "8"^^<xs:int> .
_:n9 <count> "9"^^<xs:int> .
_:n10 <count> "10"^^<xs:int> .
}
}
import sys

def blank_id(prefix='n'):
    n = 0
    while True:
       n += 1
       yield '_:' + prefix + str(n)

ids = blank_id()

print('{')
print('set {')
for i in range(1,1 + (int(sys.argv[1]) if len(sys.argv)>1 else 1000)):
   id = next(ids)
   print('{} <count> "{}"^^<xs:int> .'.format(id,i))
print('}')
print('}')

Procedure

  1. Start with an empty database.

  2. This will succeed:

    python generate.py 100 | curl -X POST -H "X-Dgraph-CommitNow: true" --data-binary @- -o /dev/null -v http://localhost:8080/mutate
  3. This will fail and the server will crash:

    python generate.py 1000000 | curl -X POST -H "X-Dgraph-CommitNow: true" --data-binary @- -o /dev/null -v http://localhost:8080/mutate
  4. Restart the server:

    docker exec -it dgraph-local dgraph server --memory_mb 16384 --zero localhost:5080
  5. Now the simple mutation will not work:

    python generate.py 100 | curl -X POST -H "X-Dgraph-CommitNow: true" --data-binary @- -o /dev/null -v http://localhost:8080/mutate

Expected behaviour and actual result.

The server should gracefully fail if the mutation is too large. Instead, the server process crashes and the database is left in some unrecoverable state.

Metadata

Metadata

Assignees

Labels

investigateRequires further investigationpriority/P1Serious issue that requires eventual attention (can wait a bit)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions