Skip to content

Commit 99e45a4

Browse files
author
Igor Makhlin
authored
Merge pull request #89 from v3io/development
Development -> Master
2 parents 6f1b055 + 2795a34 commit 99e45a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/partmgr/partmgr.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (p *PartitionManager) updatePartitionInSchema(partition *DBPartition) error
196196
func (p *PartitionManager) PartsForRange(mint, maxt int64) []*DBPartition {
197197
var parts []*DBPartition
198198
for _, part := range p.partitions {
199-
if part.startTime >= mint && (maxt == 0 || part.startTime < maxt) {
199+
if part.InRange(mint) || part.InRange(maxt) || (mint < part.GetStartTime() && maxt > part.GetEndTime()) {
200200
parts = append(parts, part)
201201
}
202202
}
@@ -311,7 +311,7 @@ func (p *DBPartition) TimeToChunkId(tmilli int64) (int, error) {
311311
if tmilli >= p.startTime && tmilli <= p.GetEndTime() {
312312
return int((tmilli-p.startTime)/p.chunkInterval) + 1, nil
313313
} else {
314-
return 0, errors.New("time " + string(tmilli) + " is not covered by time partition")
314+
return -1, errors.Errorf("time %d is not covered by time partition", tmilli)
315315
}
316316
}
317317

@@ -320,7 +320,7 @@ func (p *DBPartition) InRange(t int64) bool {
320320
if p.manager.cyclic {
321321
return true
322322
}
323-
return t >= p.startTime && t < p.GetEndTime()
323+
return t >= p.startTime && t <= p.GetEndTime()
324324
}
325325

326326
// return the mint and maxt for this partition, may need maxt for cyclic partition

0 commit comments

Comments
 (0)