Skip to content

Fix flushing of RocksDB sparse vector storage - #5908

Merged
agourlay merged 1 commit into
devfrom
fix-rocksdb-sparse-storage-flushing
Jan 30, 2025
Merged

agourlay merged 1 commit into
devfrom
fix-rocksdb-sparse-storage-flushing

Conversation

@agourlay

@agourlay agourlay commented Jan 29, 2025 •

Copy link
Copy Markdown
Member

The SimpleSparseVectorStorage based on RocksDB is not honoring the flushing sequence as it persists eagerly changes.

This causes discrepancies in testing with the new MmapSparseStorage which behaves properly.

With this patch, both implementations trigger the same consistency issue in Crasher which is unrelated to the sparse storages.

@timvisee timvisee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

I've a comment on the mutex we use, not strictly related to this change, but it may be a good time to improve upon now.

Comment on lines +85 to +90
if let Some(value) = self.insert_pending_persistence.lock().get(key.as_ref()) {
return Ok(value.clone());
}
if self
.deleted_pending_persistence
.lock()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we basically always lock these two mutexes together.

How about using a single mutex for both pending insertions and deletions?

@agourlay agourlay Jan 30, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a single Mutex is indeed better perf. wise 👍

I will do it in a follow up PR to get a cleaner diff.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agourlay
agourlay merged commit 87cd169 into dev Jan 30, 2025
@agourlay
agourlay deleted the fix-rocksdb-sparse-storage-flushing branch January 30, 2025 13:19
@timvisee timvisee mentioned this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants