mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 22:51:02 +00:00
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:
parent
87bf0df786
commit
aaf94c6aeb
2 changed files with 3 additions and 7 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue