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
Also, it is strange that blobs protected with additional RWLock. In every places this lock acquired right after acquire of RWLock on safe, thus can be removed.
This incorrect locking mechanism results in significant performance degradation
The text was updated successfully, but these errors were encountered:
RwLock on blobs can be removed. But lock can't be made read in write_with_optional_meta, since blob.write(...) requires mutable reference (due to index modification). But mutex on current_offset can be removed instead.
Exclusive lock should be as close to actual write to file as possible, so it is better to keep lock on current_offset and somehow avoid write lock in write_with_optional_meta
RWLock
onsafe
does protectactive_blob
+blobs
updates inside, so thewrite
lock should be acquired only when these 2 fields updating. But if we look atwrite_with_optional_meta
function, it is incorrectly acquirewrite
lock (https://github.com/qoollo/pearl/blob/master/src/storage/core.rs#L313). It should acquireread
lock, because it does not update neitheractive_blob
norblobs
fields.Same thing here: https://github.com/qoollo/pearl/blob/master/src/storage/core.rs#L890 and here: https://github.com/qoollo/pearl/blob/master/src/storage/core.rs#L912. Probably, there are more places where
write
lock taken incorrectly.Also, it is strange that
blobs
protected with additionalRWLock
. In every places this lock acquired right after acquire ofRWLock
onsafe
, thus can be removed.This incorrect locking mechanism results in significant performance degradation
The text was updated successfully, but these errors were encountered: