Conversation
mythical-fred
left a comment
There was a problem hiding this comment.
Two issues to resolve before merge.
fac284f to
9137a0f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@gz If you can put more of the PR description into the commit messages, then that would be great (the PR description is very good). I understand that the graphs, etc. wouldn't be able to go in there. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
bdc4f4d to
ffdefb1
Compare
mythical-fred
left a comment
There was a problem hiding this comment.
LGTM. is in. I was wrong about the memory default — old code was also 256 MiB per thread instance, so the total is unchanged. Don't forget to pre-create on crates.io with Trusted Publishing set up (both and workflow entries) before the release runs.
|
@gz these numbers look weaker than sieve right? What changed? |
mythical-fred
left a comment
There was a problem hiding this comment.
Three minor nits below — none are blockers. Approving.
cb6acef to
96d3439
Compare
4e7bcc3 to
d6a59bb
Compare
the absolute hit rate is lower because in this case I used a smaller cache-size to regenerate the graph for scalability, I think (not confirmed) s3-fifo is weaker because the quick_cache underneath uses a "regular RwLock" rather than a sharded rwlock. I did open an issue about it: arthurprs/quick-cache#108 can probably fix it myself but lets see what the maintainer says about it. This is the problem I also had with the sieve cache prototype initially. |
here are some metrics from pipelines the one interesting takeaway was that for a ingest heavy workload u64Njoin-no-match, having a global cache is worse (in s3_fifo) than having a shared_per_worker_pair |
mythical-fred
left a comment
There was a problem hiding this comment.
Retracting the prior REQUEST_CHANGES — publish = true is already in the Cargo.toml (I was wrong). One non-blocking nit below. LGTM.
blp
left a comment
There was a problem hiding this comment.
I read most of this in detail (not all of the tests, and not some of the code that just moved) and it's good work. I especially appreciate how many tests it adds, and the benchmark.
None of my suggestions are important.
654d787 to
23e4c36
Compare
The buffer cache used to be simple. A single mutex protected it.
That design worked because only one thread accessed the cache.
We now want multiple threads to run merges in parallel.
That requires a cache that many threads can access without collapsing under contention.
This change introduces a new multi-threaded buffer cache. It also switches adds a
supposedly better eviction policy, the S3-FIFO algorithm.
For compatibility, this change also adds configuration flags to revert the behavior:
```
"dev_tweaks": {
"buffer_cache_allocation_strategy": "per_thread" | "global" | "shared_per_worker_pair",
"buffer_cache_strategy": "s3_fifo" | "lru"
},
// new defaults: s3_fifo AND shared_per_worker_pair
// previously: lru AND per_thread
```
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>





storage: add s3-fifo buffer cache, more config options
The buffer cache used to be simple. A single mutex protected it.
That design worked because only one thread accessed the cache.
We now want multiple threads to run merges in parallel.
That requires a cache that many threads can access without collapsing under contention.
This change introduces a new multi-threaded buffer cache. It also switches adds a
supposedly better eviction policy, the S3-FIFO algorithm.
For compatibility, this change also adds configuration flags to revert the behavior:
Describe Manual Test Plan
Ran a few pipelines, wrote lots of tests and benchmark programs.
Checklist
Breaking Changes?
Potential for performance regressions, since it changes a critical piece of our infra. Benchmarks are promising though.
We can revert back to the old cache with a dev-tweak.