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

Add Multiraft transport implementation. #292

Closed
wants to merge 1 commit into from

Conversation

tnachen
Copy link
Contributor

@tnachen tnachen commented Jan 27, 2015

I haven't added any test, but this is my first patch for cockroach (and pretty much my foray into golang).
So want to put up a early review to make sure I'm not going down a wrong path.

@tnachen
Copy link
Contributor Author

tnachen commented Jan 27, 2015

@bdarnell I wasn't sure how does the multiraft server id translates into RaftMessageRequest, I assume it is the sender/to info.
And also what's your recommended way to test this?

@@ -23,6 +23,8 @@ import (
"strings"
"sync"

"github.com/cockroachdb/cockroach/gossip"
Copy link
Contributor

Choose a reason for hiding this comment

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

multiraft shouldn't import gossip (it is at least in principle independent from the rest of cockroach). This cockroach-specific RPCTransport should live elsewhere, probably either cockroach/rpc or cockroach/server.

@bdarnell
Copy link
Contributor

The change looks good aside from where the new code will live. For testing, I think we need something that starts up two rpc servers (hopefully this can be done with just a net/rpc server and a dummy channel-based implementation of ServerInterface, instead of pulling in the rest of cockroach) and two RPCTransports, gossips their addresses, and sends some messages back and forth.

We'll also want to wire this in to the storage/raft.go interfaces (although I wouldn't try to do that in the same PR). If we can get rid of singleNodeRaft completely and just use this that would be ideal, although I don't know if we have enough of the gossip machinery running in all the tests to do that. This will probably inform what package the code will live in - we want to be able to import RPCTransport from storage (I think? or maybe we just pass it in when we construct the Store), which rules out cockroach/server.

@bdarnell
Copy link
Contributor

bdarnell commented Feb 2, 2015

FYI I'm going to start working on the storage/raft.go changes I referred to above - replace singleNodeRaft with something that can address multiple nodes, although still using LocalRPCTransport for now.

@tnachen
Copy link
Contributor Author

tnachen commented Feb 3, 2015

Hi Ben,
Sounds good, sorry I am on vacation and traveling overseas until 2/7 so couldn't get
As much as I hope for in this PR.
My latest commit is still pending test,
Let me know how I can help

@bdarnell
Copy link
Contributor

bdarnell commented Feb 4, 2015

OK. This isn't blocking anything yet so we can wait until you're back to finish it up.

@tnachen tnachen changed the title WIP: Add Multiraft transport implementation. Add Multiraft transport implementation. Feb 9, 2015
@tnachen
Copy link
Contributor Author

tnachen commented Feb 9, 2015

@bdarnell Can you take a look? I've added one test and moved to another package.

gossip.AddInfo("node-2", rpcServer2.Addr(), time.Hour)

testServer := &TestTransportServer{}
transport1.Listen(1, testServer)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work? You're only binding one TestTransportServer but both nodes are able to connect. I don't think Connect is a strong enough test; you should actually send messages between the two servers (add a channel to TestTransportServer to get the messages out).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I was going to create another test but let me modify this one. I'm still figuring out how to get the channel to work.

@bdarnell
Copy link
Contributor

Replaced by #483

@bdarnell bdarnell closed this Mar 26, 2015
koorosh pushed a commit to koorosh/cockroach that referenced this pull request May 13, 2021
before: in cluster-ui package we used legacy versions of
tootips based on antd and with a bunch of code duplicates and
hacks.

after: used ui-components tooltip component, removed unneeded
code and styles. also on process of work find out that barchats
legend tooltips missing styles - added them.
koorosh pushed a commit to koorosh/cockroach that referenced this pull request May 18, 2021
before: in cluster-ui package we used legacy versions of
tootips based on antd and with a bunch of code duplicates and
hacks.

after: used ui-components tooltip component, removed unneeded
code and styles. also on process of work find out that barchats
legend tooltips missing styles - added them.
koorosh pushed a commit to koorosh/cockroach that referenced this pull request May 31, 2021
before: in cluster-ui package we used legacy versions of
tootips based on antd and with a bunch of code duplicates and
hacks.

after: used ui-components tooltip component, removed unneeded
code and styles. also on process of work find out that barchats
legend tooltips missing styles - added them.

(cherry picked from commit 359271e)
koorosh pushed a commit to koorosh/cockroach that referenced this pull request May 31, 2021
before: in cluster-ui package we used legacy versions of
tootips based on antd and with a bunch of code duplicates and
hacks.

after: used ui-components tooltip component, removed unneeded
code and styles. also on process of work find out that barchats
legend tooltips missing styles - added them.
@cucaroach cucaroach mentioned this pull request Jun 28, 2021
@cucaroach cucaroach mentioned this pull request Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants