Skip to content

Deadlock occurred during update #2231

@tttttttts

Description

@tttttttts

Describe the bug

I encountered a deadlock situation during the update process

To Reproduce

We can only confirm that there were a large number of concurrent reads and writes at that time, calling update and view

Expected behavior

My program holds its own lock, but when using the badger update function, it encounters a deadlock that cannot be executed. The version used is v3.2103.5, and this is the stack information at the time of the deadlock. I want to confirm if this issue has been fixed by a commit or if it is an unknown problem.

Screenshots

goroutine 16782802941 [semacquire, 27 minutes]:
sync.runtime_SemacquireMutex(0x2030f3?, 0xf3?, 0xc3cd2ed040?)
runtime/sema.go:71 +0x25
sync.(*Mutex).lockSlow(0xc00022c36c)
sync/mutex.go:162 +0x165
sync.(*Mutex).Lock(...)
sync/mutex.go:81
github.com/dgraph-io/badger/v3.(*Txn).commitAndSend(0xc128d46200)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:537 +0x96
github.com/dgraph-io/badger/v3.(*Txn).Commit(0xc128d46200)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:671 +0x8c
github.com/dgraph-io/badger/v3.(*DB).Update(0xf622e0?, 0xc0214e1df8)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:826 +0xce

goroutine 16843731325 [semacquire, 1 minutes]:
sync.runtime_SemacquireMutex(0xd92f2b?, 0xd8?, 0xc543cd9a40?)
runtime/sema.go:71 +0x25
sync.(*Mutex).lockSlow(0xc00022c364)
sync/mutex.go:162 +0x165
sync.(*Mutex).Lock(...)
sync/mutex.go:81
github.com/dgraph-io/badger/v3.(*oracle).readTs(0xc00022c360)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:94 +0x4f
github.com/dgraph-io/badger/v3.(*DB).newTransaction(0xc000667200, 0xe0?, 0x0)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:786 +0x110
github.com/dgraph-io/badger/v3.(*DB).NewTransaction(...)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:764
github.com/dgraph-io/badger/v3.(*DB).View(0x0?, 0xc543cd9b40)
github.com/dgraph-io/badger/v3@v3.2103.5/txn.go:802 +0x6c

Environment

  • OS: debian 10
  • Language GO
  • Version v3.2103.5

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions