-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #536. New nodes should add old shards without panicing
- Loading branch information
Showing
3 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package integration | ||
|
||
import ( | ||
. "integration/helpers" | ||
"os" | ||
. "launchpad.net/gocheck" | ||
) | ||
|
||
type LateJoinSuite struct { | ||
serverProcesses []*Server | ||
} | ||
|
||
var _ = Suite(&LateJoinSuite{}) | ||
|
||
func (self *LateJoinSuite) SetUpSuite(c *C) { | ||
} | ||
|
||
func (self *LateJoinSuite) TearDownSuite(c *C) { | ||
for _, s := range self.serverProcesses { | ||
s.Stop() | ||
} | ||
} | ||
|
||
func (self *LateJoinSuite) TestReplayingWAL(c *C) { | ||
err := os.RemoveAll("/tmp/influxdb/test") | ||
c.Assert(err, IsNil) | ||
s1 := NewServer("src/integration/test_rf_1.toml", c) | ||
defer s1.Stop() | ||
|
||
client := s1.GetClient("", c) | ||
c.Assert(client.CreateDatabase("test"), IsNil) | ||
series := CreatePoints("test_replication_factor_1", 1, 1) | ||
c.Assert(client.WriteSeries(series), IsNil) | ||
|
||
s2 := NewServer("src/integration/test_rf_2.toml", c) | ||
defer s2.Stop() | ||
|
||
s2.WaitForServerToStart() | ||
s1.WaitForServerToSync() | ||
s2.WaitForServerToSync() | ||
|
||
client = s2.GetClient("", c) | ||
c.Assert(client.Ping(), IsNil) | ||
} |