Skip to content

Commit

Permalink
Merge pull request #3747 from influxdb/pd-fix-wal-race
Browse files Browse the repository at this point in the history
Make the WAL cursor create a copy of the cache
  • Loading branch information
pauldix committed Aug 19, 2015
2 parents 990e21c + 4c1f711 commit 4753346
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tsdb/engine/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,10 @@ func (p *Partition) cursor(key string) *cursor {
entry.isDirtySort = false
}

return &cursor{cache: entry.points}
// build a copy so modifications to the partition don't change the result set
a := make([][]byte, len(entry.points))
copy(a, entry.points)
return &cursor{cache: a}
}

// idFromFileName parses the segment file ID from its name
Expand Down

0 comments on commit 4753346

Please sign in to comment.