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

compactor depends on memberlist for memberlist ring option #4643

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

trevorwhitney
Copy link
Collaborator

What this PR does / why we need it:

We seem to have introduced a race condition when using memberlist for the compactor ring:

│ level=info ts=2021-11-03T23:26:34.317080539Z caller=main.go:94 msg="Starting Loki" version="(version=k70-07ea1ed, branch=k70, revision=07ea1ed99)"          ││ level=info ts=2021-11-03T23:26:34.317342925Z caller=server.go:260 http=[::]:3100 grpc=[::]:9095 msg="server listening on addresses"                         ││ panic: runtime error: invalid memory address or nil pointer dereference                                                                                     ││ [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xed5498]                                                                                      ││ goroutine 1 [running]:                                                                                                                                      ││ github.com/grafana/dskit/kv/memberlist.(*KVInitService).GetMemberlistKV(0x0)                                                                                ││     /src/loki/vendor/github.com/grafana/dskit/kv/memberlist/kv_init_service.go:57 +0x18                                                                     ││ github.com/grafana/dskit/kv.createClient({_, _}, {_, _}, {{{0x22456a8, 0xe}, {0x0, 0x0}, 0x4a817c800, 0x0, ...}, ...}, ...)                                 ││     /src/loki/vendor/github.com/grafana/dskit/kv/client.go:146 +0x4b2                                                                                       ││ github.com/grafana/dskit/kv.NewClient({{0x223da05, 0xa}, {0x223f2b3, 0xb}, {{{0x22456a8, 0xe}, {0x0, 0x0}, 0x4a817c800, 0x0, ...}, ...}, ...}, ...)         ││     /src/loki/vendor/github.com/grafana/dskit/kv/client.go:123 +0x11e                                                                                       ││ github.com/grafana/loki/pkg/storage/stores/shipper/compactor.NewCompactor({{0xc000501c10, 0xf}, {0x2231d26, 0x3}, {0x2235bc8, 0x6}, 0x8bb2c97000, 0x0, 0x68 ││     /src/loki/pkg/storage/stores/shipper/compactor/compactor.go:125 +0x33a                                                                                  ││ github.com/grafana/loki/pkg/loki.(*Loki).initCompactor(0xc000343500)                                                                                        ││     /src/loki/pkg/loki/modules.go:668 +0x1df                                                                                                                ││ github.com/grafana/dskit/modules.(*Manager).initModule(0xc00012d710, {0x7ffd92f27d0d, 0x1}, 0xc000245c50, 0xc00091cc18)                                     ││     /src/loki/vendor/github.com/grafana/dskit/modules/modules.go:106 +0x22c                                                                                 ││ github.com/grafana/dskit/modules.(*Manager).InitModuleServices(0xc000434a50, {0xc0007e6bb0, 0x1, 0x40ac5d})                                                 ││     /src/loki/vendor/github.com/grafana/dskit/modules/modules.go:78 +0x10c                                                                                  ││ github.com/grafana/loki/pkg/loki.(*Loki).Run(0xc000343500)                                                                                                  ││     /src/loki/pkg/loki/loki.go:284 +0x4b                                                                                                                    ││ main.main()                                                                                                                                                 ││     /src/loki/cmd/loki/main.go:96 +0xd70

This PR add MemberlistKV as a dependency of Compactor which should fix this.

@trevorwhitney trevorwhitney requested a review from a team as a code owner November 4, 2021 15:25
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

LGTM

@slim-bean slim-bean merged commit 3f9d067 into main Nov 4, 2021
@slim-bean slim-bean deleted the compactor-memberlist branch November 4, 2021 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants