fix the automatic snapshot queue enable check

The "needs snapshot queue" check was broken, as it only checked inside a loop over indices.
If there are no indexes yet (or more likely if the indices have not yet been loaded off of disk), then this would never use the snapshot queue on roaring.
This commit is contained in:
Nia Weiss 2020-12-16 08:03:37 -05:00
parent 87bf0df786
commit aaf94c6aeb
No known key found for this signature in database
GPG key ID: 895E83409BFDA1BB
2 changed files with 3 additions and 7 deletions

View file

@ -782,12 +782,8 @@ func (h *Holder) Close() error {
func (h *Holder) NeedsSnapshot() bool {
h.mu.RLock()
defer h.mu.RUnlock()
for _, idx := range h.Indexes() {
if idx.NeedsSnapshot() {
return true
}
}
return false
return h.cfg.Txsrc == "roaring"
}
// HasData returns true if Holder contains at least one index.

View file

@ -88,7 +88,7 @@ type Server struct { // nolint: maligned
dataDir string
// Threshold for logging long-running queries
longQueryTime time.Duration
longQueryTime time.Duration
queryHistoryLength int
}