Read-modify-write behavior instead of simple write #1426
Replies: 3 comments 5 replies
-
I think the culprit will be somewhere in this function: Line 1874 in 4132f36 In particular, if you fail to enter this branch, you are doomed to read the chunk before writing. So I would throw a breakpoint in this function and check which condition is preventing you from taking the fast path |
Beta Was this translation helpful? Give feedback.
-
@d-v-b Sorry, I may be misunderstanding, but isn't that function to read data from storage rather than writing to storage? |
Beta Was this translation helpful? Give feedback.
-
you are right, that's the wrong function to look at. I think this is likely the routine to examine: Line 2119 in 4132f36 |
Beta Was this translation helpful? Give feedback.
-
Here's a piece of code we're running using a
DirectoryStore
backed array:The array is chunked in a way that this should only change one single chunk and change the full chunk contents. I would expect this to only write out data. But we're seeing read-modify-write behavior which adds a lot of overhead. Here is a profile screenshot:
It seems like we only see a write without a read when the chunk doesn't already exist. But when it does exist, it is always a read-modify-write.
Would like to understand why this is happening and how to maybe get around this behavior.
cc @aleckohlhoff
Beta Was this translation helpful? Give feedback.
All reactions