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

New transaction does not pick random stub when connected to more then one alpha node #112

Closed
igormiletic opened this issue Sep 25, 2019 · 1 comment
Assignees
Labels
kind/question something requiring a response status/more-info-needed The issue has been sent back to reporter asking for clarification

Comments

@igormiletic
Copy link

Version 2.0.1

  • When create client that connects to more then one stub, it does not pick random nodes for new transaction. It always talk to one node.

E.g.

Alpha-1 => IP 123.1.1.0
Alpha-2 => IP 123.1.1.1
Alpha-3 => IP 123.1.1.2

if you do something like:

val channel1: ManagedChannel = ManagedChannelBuilder.forAddress("123.1.1.0", port).usePlaintext(true).build
val stub1 = DgraphGrpc.newStub(channel1)

val channel2: ManagedChannel = ManagedChannelBuilder.forAddress("123.1.1.1", port).usePlaintext(true).build
val stub2 = DgraphGrpc.newStub(channel2)

val channel3: ManagedChannel = ManagedChannelBuilder.forAddress("123.1.1.2", port).usePlaintext(true).build
val stub3 = DgraphGrpc.newStub(channel3)

// and then create client
val stubs = Seq(stub1, stub2, stub3)
val client = new DgraphAsyncClient(stubs: _*)

// when you call newTrasaction it always goes only to one alpha node (e.g. Alpha-1)
client.newTransaction()

Expected: to randomly pick nodes (alpha-1, alpha-2, alpha-3)

@mangalaman93 mangalaman93 self-assigned this Oct 1, 2019
@mangalaman93
Copy link
Member

mangalaman93 commented Oct 1, 2019

Hi @igormiletic

I modified the tests and printed the node that Alpha is connecting to, seems to connect to all of them. Could you let me know how you verified that the request was going to only one Alpha?

If you could share the code snippet of setting up the DgraphClient, that'd be great too.

Thanks

@mangalaman93 mangalaman93 added kind/question something requiring a response status/more-info-needed The issue has been sent back to reporter asking for clarification labels Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question something requiring a response status/more-info-needed The issue has been sent back to reporter asking for clarification
Development

No branches or pull requests

2 participants