Conversation
c953108 to
e98073c
Compare
e98073c to
8fb001f
Compare
|
|
||
| /// Create flusher that durably persists all pending changes when invoked | ||
| pub fn flusher(&self) -> Flusher { | ||
| let pending_updates = self.tracker.read().pending_updates.clone(); |
There was a problem hiding this comment.
Key change: here we now take a snapshot of all pending changes. Only these are flushed. This is consistent with our other flushers.
| old_pointers.extend(updates.to_outdated_pointers()); | ||
|
|
||
| // Bump the pending updates for this point offset, drop entry if fully persisted | ||
| if let Some(pending_updates) = self.pending_updates.get_mut(&point_offset) | ||
| && pending_updates.drain_persisted_and_drop(&updates) | ||
| { | ||
| self.pending_updates.remove(&point_offset); | ||
| } |
There was a problem hiding this comment.
This function now takes the snapshot of pending changes.
Here we bump the latest pending changes, so that we drain all changes that we now persist.
Once this function is complete, the list of pending changes will only contain changes that still need to be persisted.
bda5571 to
2181b95
Compare
|
This now has a bunch of tests added to ensure correct behavior. The tests are actually the majority of this PR. |
2181b95 to
4738476
Compare
| let instant = Instant::now(); | ||
|
|
||
| storage.flush().unwrap(); | ||
| storage.flusher()().unwrap(); |
There was a problem hiding this comment.
Could you please run the flush_bench for a quick sanity check that the performance is similar to dev 🤞
There was a problem hiding this comment.
I have done some basic profiling on the benchmark and I cannot find a clear root cause for the degradation.
The previous code was sub-millisecond fast already, maybe the additional locking makes things slower 🤷
I think this is fine.
There was a problem hiding this comment.
10 μs even for 100 updates. Likely measuring locks.
Agreed 👍
There was a problem hiding this comment.
bustle_bench does not show any noticeable degradation 👍
|
Let's postpone merging this till after the 1.16 release. Then we can test it on chaos testing for some time without the risk of affecting the release. |
575ec80 to
d482fa7
Compare
* Wrap the tracker and bitmask in Arc * Implement deferred flusher for gridstore, defer tracker writes * Remove clone * Dynamically adjust list of pending updates to drain what is flushed * Return proper flusher, defer premature Gridstore flushing errors * Use deferred Gridstore flusher across storages * Remove all Arc<RwLock<_>> wrappers around Gridstore in storages * Flush pages inside closure, also wrap them in a lock * Remove direct flush function from Gridstore * Add test to assert behavior of deferred flushing in Gridstore * Add much more extensive test, including concurrent flushes and deletes * Add test for draining value pointer, make sure to drop when flushed * Feature gate RocksDB components

Add a deferred flusher to Gridstore, using which we flush asynchronously through a closure.
This makes the flushing behavior of Gridstore consistent with the other storage types we have.
Specifically this:
a. write the copied updates to disk (ignoring any new updates)
b. bump the list of pending updates to remove the now persisted entries
This is a building block I need for #7443.
As a bonus this removes all
Arc<RwLock<_>>wrappers around Gridstore, making the world a nicer place 🍀. It now also respects&self/&mut self.Crasher run: https://github.com/qdrant/crasher/actions/runs/18755857443 🟢
All Submissions:
devbranch. Did you create your branch fromdev?Changes to Core Features: