Commit 12cd0ac
haijieg
Fix a incorrect cache eviction
Fix the bug where the fileio cache layer allows read of a
evicted cache_block.
The cache eviction relies on the evicting thread being the only
holder of the cache_block. However, the union_fstream took an optimization
to directly grab the underlying input stream of a cache_stream,
thus giving up the cahce_block handle, allowing eviction to happen.
The fix is to remember the orignal cachestream which holds reference to
the cache_block. This prevents the block from being evicted.1 parent ea65a77 commit 12cd0ac
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
0 commit comments