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

Broker discovery #2128

Merged
merged 4 commits into from
Apr 2, 2015
Merged

Broker discovery #2128

merged 4 commits into from
Apr 2, 2015

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Mar 31, 2015

This sends data node urls via the broker heartbeat from each data node. The urls are tracked on the broker to support simpler cluster setup as well as distributed queries.

This is a prerequisite for splitting data and broker nodes.

cc @benbjohnson @otoolep

@@ -23,7 +23,7 @@ import (
"github.com/influxdb/influxdb/udp"
)

func Run(config *Config, join, version string) (*messaging.Broker, *influxdb.Server) {
func Run(config *Config, join, version string) (*messaging.Broker, *influxdb.Server, *raft.Log) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like the return values are getting a little bit out of control. Perhaps we need a more generic node type which returned by Run(). This node type would have a Close() method, which would take of closing whatever was opened. Sometimes node would have a broker, sometimes a log, sometimes a server, sometimes all, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. We started down that path in #2118. We're moving in that direction but planning to do that in a separate PR.

@otoolep
Copy link
Contributor

otoolep commented Apr 1, 2015

Does our design allow a node's URL to change? If so, using a node's URL as a key in a map could be problematic. If it does not allow a node's URL to change, then why continually send it over the heartbeat channel?

@jwilder jwilder force-pushed the broker-discovery branch 2 times, most recently from 5d471a3 to 9013842 Compare April 1, 2015 22:22
@jwilder
Copy link
Contributor Author

jwilder commented Apr 1, 2015

@otoolep Updated based on your feedback.

@jwilder jwilder force-pushed the broker-discovery branch from 9013842 to 90b0057 Compare April 2, 2015 05:17
mu sync.Mutex
path string // config file path
conns []*Conn // all connections opened by client
url url.URL // current known leader URL
Copy link
Contributor

Choose a reason for hiding this comment

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

This was there before, but we need to come back and fix this naming. url and urls are not great names on the same object. As names they don't mean much, and are too similar. They need to become leaderURL and brokerURLs.

Not something required for this PR, one of us can fix it up afterwards.

@otoolep
Copy link
Contributor

otoolep commented Apr 2, 2015

OK, makes sense to me. Just some nits, which I don't need to re-review. You may wish to get this blessed by @benbjohnson, whatever you think.

Don't forget the CHANGELOG -- you could probably call it a "feature".

@jwilder jwilder force-pushed the broker-discovery branch from 90b0057 to 570c3f3 Compare April 2, 2015 16:25
@@ -84,6 +88,7 @@ func TestRestoreCommand(t *testing.T) {
f.Close()

// Stop server.
l.Close()
s.Close()
b.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you defer the closing right after you validate that b, s, & l are non-nil?

jwilder added 2 commits April 2, 2015 11:27
This sends data node urls via the broker heartbeat from each data
node.  The urls are tracked on the broker to support simpler
cluster setup as well as distributed queries.
@jwilder jwilder force-pushed the broker-discovery branch from 570c3f3 to cf9e0b2 Compare April 2, 2015 17:29
jwilder added a commit that referenced this pull request Apr 2, 2015
@jwilder jwilder merged commit ea7fe9b into master Apr 2, 2015
@jwilder jwilder deleted the broker-discovery branch April 2, 2015 18:41
mark-rushakoff pushed a commit that referenced this pull request Jan 11, 2019
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.

3 participants