这是indexloc提供的服务,不要输入任何密码
Skip to content

Learner Node is not working #9393

@MichelDiz

Description

@MichelDiz

Describe the bug

Supposedly, the Learner node would be an instance of Dgraph outside of the RAFT Group. There is no in-depth material on the subject. This makes it difficult to effectively test it. However, in theory, we should have an instance that would supposedly be a replica for readonly.

What is still unknown to me is whether the replica would be total for the entire cluster or individual for each group/shard. The second option would be a bit strange. But plausible.

To Reproduce

Steps to reproduce the behavior:

I have created a cluster with 1 zero and 3 alphas. After I tried run a Learner Alpha and no luck.

go run main.go alpha --zero 0.0.0.0:5080 --security "whitelist=0.0.0.0/0;" --my 0.0.0.0:7090 --tmp alphaLearner/t -p=alphaLearner/p -w=alphaLearner/w -o=10 --raft "learner=true;"

In order to effectively test it, I had to comment out a line in the code that was forcing a fatal error.

	// if n.RaftContext.IsLearner && !hasPeer {
	// 	glog.Fatal("Cannot start a learner node without peer alpha nodes")
	// }

I think the issue here(the fatal one) is due to lack of flag value propagation.

Expected behavior

To work

Environment

  • OS: macOS
  • Language Go
  • Version Latest Main - v25.0.0-preview1

Additional context

Investigations

At this line

m := &pb.Member{

I saw that the Learner flag was activated.
But in the state it is "learner": false, sounds like the flag is not being propagated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions