You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The call to reverse above assumes to_delete is in ascending order, which isn't necessarily the case. I didn't thoroughly test, so I don't know what combinations of to_mem and sra.policy cause an error, but I got an error about trying to delete an index that didn't exist when using a LRU policy (don't know if to_mem was true or not). The problem did not occur when I switched to a MRU policy. Sorry I don't have a MWE, though I can reliably reproduce the issue.
My problem went away when I replaced reverse(to_delete) with sort(to_delete; rev = true).
The text was updated successfully, but these errors were encountered:
Yeah that's a good find - an alternative to sort(to_delete; rev=true) is to call sort!(to_delete; rev=true), which would reuse the to_delete array, and should still return it too. Would you be willing to open a PR? I don't know how exactly to test this, aside from implementing a stress-test for MemPool's swap-to-disk (which I do want to do once I find the time).
MemPool.jl/src/storage.jl
Line 963 in 8508088
The call to
reverse
above assumesto_delete
is in ascending order, which isn't necessarily the case. I didn't thoroughly test, so I don't know what combinations ofto_mem
andsra.policy
cause an error, but I got an error about trying to delete an index that didn't exist when using a LRU policy (don't know ifto_mem
was true or not). The problem did not occur when I switched to a MRU policy. Sorry I don't have a MWE, though I can reliably reproduce the issue.My problem went away when I replaced
reverse(to_delete)
withsort(to_delete; rev = true)
.The text was updated successfully, but these errors were encountered: