Skip to content

Commit

Permalink
fix #321. Fix a off-by-one bug in the splitting algo
Browse files Browse the repository at this point in the history
The algorithm that splits the data to multiple shards had an off-by-one
bug that caused one point from the next shard to be included in the
current shard.
  • Loading branch information
jvshahid committed Mar 11, 2014
1 parent 7e659b9 commit 471039a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func (self *CoordinatorImpl) CommitSeriesData(db string, series *protocol.Series
if shardToWrite == nil {
shardToWrite = shard
} else if shardToWrite.Id() != shard.Id() {
newIndex := i + 1
newIndex := i
newSeries := &protocol.Series{Name: series.Name, Fields: series.Fields, Points: series.Points[lastPointIndex:newIndex]}
self.write(db, newSeries, shardToWrite)
lastPointIndex = newIndex
Expand Down

0 comments on commit 471039a

Please sign in to comment.