mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 19:07:50 +00:00
Drop unneeded locks
The filter and rewrite logic are unlocking and relocking but I don't think they should. I think those locks were added early on during testing of the filter stuff, but I don't think they should be needed, and I've been unable to find a case where they were. I think probably I had something where a ConsiderData function was trying to run a Tx.
This commit is contained in:
parent
e67beb8766
commit
9acc7a6019
1 changed files with 0 additions and 8 deletions
|
|
@ -1754,17 +1754,13 @@ func (s *containerFilter) ApplyFilter() (err error) {
|
|||
if key < minKey {
|
||||
continue
|
||||
}
|
||||
s.tx.mu.RUnlock()
|
||||
res := s.filter.ConsiderKey(key, int32(cell.BitN))
|
||||
s.tx.mu.RLock()
|
||||
if res.Err != nil {
|
||||
return res.Err
|
||||
}
|
||||
if res.YesKey <= key && res.NoKey <= key {
|
||||
data := intoContainer(cell, s.cursor.tx, &s.header, s.body[:])
|
||||
s.tx.mu.RUnlock()
|
||||
res = s.filter.ConsiderData(key, data)
|
||||
s.tx.mu.RLock()
|
||||
if res.Err != nil {
|
||||
return res.Err
|
||||
}
|
||||
|
|
@ -1820,17 +1816,13 @@ func (s *containerFilter) ApplyRewriter() (err error) {
|
|||
if key < minKey {
|
||||
continue
|
||||
}
|
||||
s.tx.mu.RUnlock()
|
||||
res := s.rewriter.ConsiderKey(key, int32(cell.BitN))
|
||||
s.tx.mu.RLock()
|
||||
if res.Err != nil {
|
||||
return res.Err
|
||||
}
|
||||
if res.YesKey <= key && res.NoKey <= key {
|
||||
data := intoWritableContainer(cell, s.cursor.tx, &s.header, s.body[:])
|
||||
s.tx.mu.RUnlock()
|
||||
res = s.rewriter.RewriteData(key, data, writeback)
|
||||
s.tx.mu.RLock()
|
||||
if res.Err != nil {
|
||||
return res.Err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue