mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
added logging on import;crashing bug on sync on empty fragment
This commit is contained in:
parent
849b10c2f5
commit
dab399e328
4 changed files with 6 additions and 2 deletions
|
|
@ -71,7 +71,6 @@ func (e *Executor) Execute(db string, q *pql.Query, slices []uint64, opt *ExecOp
|
|||
}
|
||||
results = append(results, v)
|
||||
}
|
||||
|
||||
return results, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -854,8 +854,8 @@ func (f *Fragment) Import(bitmapIDs, profileIDs []uint64) error {
|
|||
if bitmap.SetBit(profileID) {
|
||||
bmCounter += 1
|
||||
}
|
||||
// Update the cache.
|
||||
}
|
||||
f.cache.Invalidate()
|
||||
return nil
|
||||
}(); err != nil {
|
||||
_ = f.closeStorage()
|
||||
|
|
|
|||
|
|
@ -398,12 +398,14 @@ func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
// Find the correct fragment.
|
||||
h.logger().Println("Go Import:", db, frame, slice)
|
||||
f, err := h.Index.CreateFragmentIfNotExists(db, frame, slice)
|
||||
if err != nil {
|
||||
h.logger().Printf("fragment error: db=%s, frame=%s, slice=%d, err=%s", db, frame, slice, err)
|
||||
http.Error(w, "fragment error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
h.logger().Println("Import into Fragment:", db, frame, slice, len(reg.GetProfileIDs()))
|
||||
|
||||
// Import into fragment.
|
||||
err = f.Import(req.GetBitmapIDs(), req.GetProfileIDs())
|
||||
|
|
|
|||
|
|
@ -638,6 +638,9 @@ func (c *container) max() uint16 {
|
|||
}
|
||||
|
||||
func (c *container) arrayMax() uint16 {
|
||||
if len(c.array) == 0 {
|
||||
return 0 //probably hiding some ugly bug but it prevents a crash
|
||||
}
|
||||
return c.array[len(c.array)-1]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue