Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the limit to the number of keys that can be scaned #225

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/datastore/leveldb_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const (
ONE_GIGABYTE = ONE_MEGABYTE * 1024
TWO_FIFTY_SIX_KILOBYTES = 256 * 1024
BLOOM_FILTER_BITS_PER_KEY = 64
MAX_POINTS_TO_SCAN = 1000000
MAX_SERIES_SIZE = ONE_MEGABYTE
REQUEST_SEQUENCE_NUMBER_KEY = "r"
REQUEST_LOG_BASE_DIR = "request_logs"
Expand Down Expand Up @@ -771,10 +770,10 @@ func (self *LevelDbDatastore) executeQueryForSeries(database, series string, col
result := &protocol.Series{Name: &series, Fields: fieldNames, Points: make([]*protocol.Point, 0)}

limit := query.Limit
shouldLimit := true
if limit == 0 {
limit = MAX_POINTS_TO_SCAN
shouldLimit = false
}

resultByteCount := 0

// TODO: clean up, this is super gnarly
Expand Down Expand Up @@ -886,7 +885,7 @@ func (self *LevelDbDatastore) executeQueryForSeries(database, series string, col
resultByteCount = 0
result = &protocol.Series{Name: &series, Fields: fieldNames, Points: make([]*protocol.Point, 0)}
}
if limit < 1 {
if shouldLimit && limit < 1 {
break
}
}
Expand Down