Slow syncs and Segfault

I have two alpha instances running within docker on two separate machines. As far as I can tell, both machines are identical. I start pumping data into them and everything looked to be working great. However, after a few hours, I came back and found that one of the instances had been streaming warnings like these:

W1113 03:35:13.841935       1 draft.go:958] Raft.Ready took too long to process: Timer Total:
204ms. Breakdown: [{sync 204ms} {disk 0s} {proposals 0s} {advance 0s}] Num entries: 1. MustSync: true
W1113 03:35:14.678171       1 draft.go:958] Raft.Ready took too long to process: Timer Total:
682ms. Breakdown: [{sync 682ms} {disk 0s} {proposals 0s} {advance 0s}] Num entries: 1. MustSync: true
W1113 03:35:16.272393       1 draft.go:958] Raft.Ready took too long to process: Timer Total:
1.594s. Breakdown: [{sync 1.594s} {disk 0s} {proposals 0s} {advance 0s}] Num entries: 1. MustSync: true

And it had finally crashed with a segfault.
Here is a portion of the segfault log dump:

fatal error: fault                                                                            [signal SIGSEGV: segmentation violation code=0x1 addr=0xc030000000 pc=0x11ef2b1]              
                                                                                              goroutine 1281391 [running]:                                                                  
runtime.throw(0x175d0cb, 0x5)                                                                         /usr/local/go/src/runtime/panic.go:617 +0x72 fp=0xc00023bb88 sp=0xc00023bb58 pc=0x9d0f
        /usr/local/go/src/runtime/signal_unix.go:397 +0x401 fp=0xc00023bbb8 sp=0xc00023bb88 pc
=0x9e7151                                                                            , 0x4
, 0x4, 0xc02ffffff0, 0x9, 0x10)                                                               
e_amd64.s:11 +0x11 fp=0xc00023bbc0 sp=0xc00023bbb8 pc=0x11ef2b1                      *Decoder).unpackBlock(0xc015a0b1d0, 0xc01dd16bc0, 0x2, 0x8)
        /tmp/go/src/ +0x226 fp=0xc00023bc68 sp=0
xc00023bbc0 pc=0x11efaa6                                                             *Decoder).LinearSeek(0xc015a0b1d0, 0xb5d9, 0x8, 0xc00344445
8, 0x4a0)
        /tmp/go/src/ +0x62 fp=0xc00023bc98 sp=0xc00023bc68 pc=0x11f00b2                                                              , 0xc00343a000, 0x192b, 0x192b, 0xc00023bd30)                                                                   
        /tmp/go/src/ +0xcd fp=0xc00023bcf8 sp=0xc00023bc98 pc=0x11f0fdd                                                              , 0x0, 0xc01db568c0, 0xc01db56bc0)                                                                                     
        /tmp/go/src/ +0x134 fp=0xc00023bd58 sp=0
xc00023bcf8 pc=0x11f0e64                                                             *List).Uids(0xc002905bc0, 0x16e36, 0x0, 0xc01db568c0, 0x1
76abfe, 0x11, 0x0)                                                                            
        /tmp/go/src/ +0x186 fp=0xc00023bde0 sp=
0xc00023bd58 pc=0x11fea96                                                            *queryState).handleUidPostings.func1(0x0, 0x1, 0xc01176bc8
0, 0xc01de35900)                                                                              
        /tmp/go/src/ +0x11ff fp=0xc00023bf80 sp=
0xc00023bde0 pc=0x1375a2f                                                            *queryState).handleUidPostings.func2(0xc002905a40, 0xc01e$
637c0, 0x0, 0x1)
       /tmp/go/src/ +0x3a fp=0xc00023bfc0 sp=0x
c00023bf80 pc=0x1375e8a                                                                       runtime.goexit()                                                                              
        /usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc00023bfc8 sp=0xc00023bfc0 pc=0xa010d1                                                                                         
created by*queryState).handleUidPostings                         /tmp/go/src/ +0x3b3                     
                                                                                              goroutine 1 [semacquire, 1660 minutes]:                                                       
        /usr/local/go/src/runtime/sema.go:56 +0x39                                            
        /usr/local/go/src/sync/waitgroup.go:130 +0x65                                                                    
        /tmp/go/src/ +0x838                                               
        /tmp/go/src/ +0xd4c   , 0xc0003cee40, 0x0, 0x2
        /tmp/go/src/ +0x52     *Command).execute(0xc0004a2000, 0xc
0003cee00, 0x2, 0x2, 0xc0004a2000, 0xc0003cee00)
        /tmp/go/src/ +0x289                                                                                *Command).ExecuteC(0x22121a0, 0x0, 0x0, 0x0)                                                                                     
        /tmp/go/src/ +0x2ca                                                                                *Command).Execute(...)                     /tmp/go/src/                                              
        /tmp/go/src/ +0x85                   
        /tmp/go/src/ +0x99                       
goroutine 5 [chan receive]:                                                          *loggingT).flushDaemon(0x22b9b20)  
        /tmp/go/src/ +0x8
created by                   
        /tmp/go/src/ +0x$
goroutine 19 [select]:                                                              *worker).start(0xc0002880a0)  
        /tmp/go/src/ +0x100                                                                                     
created by                      /tmp/go/src/
2 +0x57                                                                                                                                                                                     
goroutine 20 [syscall, 1660 minutes]:                                                         
        /usr/local/go/src/runtime/sigqueue.go:139 +0x9c                                       
        /usr/local/go/src/os/signal/signal_unix.go:23 +0x22                                   
created by os/signal.init.0                                                                   
        /usr/local/go/src/os/signal/signal_unix.go:29 +0x41

I’ve started it up again and it almost immediately began to stream the above warnings. No apparent problems with the disk, so I’m not sure what else might cause this.

Both of my alphas were crashed with segfaults this morning. The first alpha began logging the same slow syncs, but not nearly as many.

Thank you for the post. I will assign someone to look at the issue as soon as possible.


Would you be able to share your ‘p’ directory – where the data is so we can reproduce this issue and fix it?



Please tell me which version of dgraph you are running on? It looks like we have fixed a similar issue and the master branch has the fix. If you would upgrade to master and try and reproduce it, that would be very helpful.


Hi Shekar,

I can’t share my current ‘p’ directory, though I could potentially try and reproduce with mocked data. I will grab the master branch first, and see if the issue manifests overnight.

Sounds good. Thanks for the prompt reply.

Hello Shekar,

No crashes overnight running on master. I will assume it’s fixed, but will let you know if anything changes.


I’m afraid I’ve gotten another crash, sometime last night. I assume it was a segfault, but my backlog does not go back far enough to show me the beginning of the stack trace.

I have two alphas running on the master branch (717710a26ba56e5ea05f3b4f4429779c6038f7fc), compiled from source on my host machine. The binaries were running in two separate DigitalOcean droplets. The first was not logging slow sync warnings, but the second one was.

It was the first one that crashed. The second one is still running and logging the warnings.

If you need my ‘p’ directory, I can try to reproduce with mock data over the weekend. Let me know if there’s anything else I can try.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.