Skip to content

Commit

Permalink
fix #507. Cluster admin passwords don't propagate to other nodes in c…
Browse files Browse the repository at this point in the history
…luster
  • Loading branch information
jvshahid authored and pauldix committed May 27, 2014
1 parent 4d1e818 commit 3133acf
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- [Issue #500](https://github.com/influxdb/influxdb/issues/500). Support `y` sufix in time durations
- [Issue #501](https://github.com/influxdb/influxdb/issues/501). Writes with invalid payload should be rejected
- [Issue #507](https://github.com/influxdb/influxdb/issues/507). New cluster admin passwords don't propagate properly to other nodes in a cluster

## v0.6.0 [2014-05-02]

Expand Down
1 change: 1 addition & 0 deletions src/cluster/cluster_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ func (self *ClusterConfiguration) SaveClusterAdmin(u *ClusterAdmin) {
return
}
self.clusterAdmins[u.GetName()] = u
u.ChangePassword(u.Hash)
}

type SavedConfiguration struct {
Expand Down
2 changes: 1 addition & 1 deletion src/coordinator/raft_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (s *RaftServer) ChangeConnectionString(raftName, protobufConnectionString,
for _, s := range s.raftServer.Peers() {
// send the command and ignore errors in case a server is down
SendCommandToServer(s.ConnectionString, command)
log.Info("sent command to change port to %s", s.ConnectionString)
log.Info("sent %#v to %s", command, s.ConnectionString)
}

// make the change permament
Expand Down
25 changes: 25 additions & 0 deletions src/integration/multiple_servers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,31 @@ func (self *ServerSuite) TearDownSuite(c *C) {
}
}

func (self *ServerSuite) TestChangingRootPassword(c *C) {
rootClient := self.serverProcesses[0].GetClient("", c)
c.Assert(rootClient.CreateClusterAdmin("newroot", "root"), IsNil)

for _, s := range self.serverProcesses {
s.WaitForServerToSync()
}

for _, s := range self.serverProcesses {
client := s.GetClient("", c)
c.Assert(client.AuthenticateClusterAdmin("newroot", "root"), IsNil)
}

c.Assert(rootClient.ChangeClusterAdminPassword("newroot", "root2"), IsNil)

for _, s := range self.serverProcesses {
s.WaitForServerToSync()
}

for _, s := range self.serverProcesses {
client := s.GetClient("", c)
c.Assert(client.AuthenticateClusterAdmin("newroot", "root2"), IsNil)
}
}

func (self *ServerSuite) TestGraphiteInterface(c *C) {
conn, err := net.Dial("tcp", "localhost:60513")
c.Assert(err, IsNil)
Expand Down
8 changes: 8 additions & 0 deletions src/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ func (self *Server) ListenAndServe() error {
raftConnectionString := self.Config.RaftConnectionString()
if self.ClusterConfig.LocalServer.ProtobufConnectionString != self.Config.ProtobufConnectionString() ||
self.ClusterConfig.LocalServer.RaftConnectionString != raftConnectionString {

log.Info("Sending change connection string command (%s,%s) (%s,%s)",
self.ClusterConfig.LocalServer.ProtobufConnectionString,
self.Config.ProtobufConnectionString(),
self.ClusterConfig.LocalServer.RaftConnectionString,
raftConnectionString,
)

err := self.RaftServer.ChangeConnectionString(
self.ClusterConfig.LocalRaftName,
self.Config.ProtobufConnectionString(),
Expand Down

0 comments on commit 3133acf

Please sign in to comment.