Make the WAL cursor create a copy of the cache

pull/3747/head
Paul Dix 2015-08-19 17:25:44 -04:00
parent d785f09bf9
commit 4c1f7110f8
1 changed files with 4 additions and 1 deletions

View File

@ -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