Commit 70ff956
[CELEBORN-2321] Avoid locking disk writers during memory split checks
### Why are the changes needed?
`needHardSplitForMemoryShuffleStorage()` runs on the push path. Disk-backed writers can never require this memory-only split check, but the method currently acquires the writer lock before returning `false`. For the common disk-backed case, that adds avoidable contention with writes and evictions on a hot path.
### What changes were proposed in this PR?
This PR adds an unlocked fast path for non-memory writers so they return immediately without taking the `PartitionDataWriter` monitor. For memory-backed writers, it rechecks `currentTierWriter` after entering the synchronized block before evaluating the existing hard-split conditions, which preserves the original behavior if the writer tier changes concurrently.
### Does this PR resolve a correctness bug?
No.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
- Attempted `build/mvn -pl worker -am -DskipTests compile` on current `main`.
- The Maven reactor fails before reaching `worker` because `celeborn-master_2.12` cannot resolve snapshot test-jar artifacts for `celeborn-common_2.12` and `celeborn-service_2.12`; that failure is unrelated to this change.
Closes #3680 from sunchao/dev/chao/codex/celeborn-fast-memory-split-check-oss-main.
Authored-by: Chao Sun <chao@openai.com>
Signed-off-by: SteNicholas <programgeek@163.com>1 parent 8d473c5 commit 70ff956
1 file changed
Lines changed: 15 additions & 5 deletions
File tree
- worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
0 commit comments