Commit 3cf82d7
authored
### What changes were proposed in this pull request?
- Introduce a ShuffleBlockIdManagerFactory to create configured implementation.
- Introduce PartitionedShuffleBlockIdManager to individual bitmap for each partition.
### Why are the changes needed?
Fix: #2219
<img width="1596" alt="image" src="https://github.com/user-attachments/assets/c7752f94-941b-45d2-9a45-1da197e38984">
This is the maximum partition num with node metrics in our cluster, it is ~410K, it cost heap size 410K * 50KiB = 2GiB if we say a bitmap related a partition avg 10000 blocks(cost 50KiB heap).
I think this is worth to choose this new policy in our production cluster.
### Does this PR introduce _any_ user-facing change?
- Config option: rss.server.blockIdStrategyClass
### How was this patch tested?
Test Locally, check result by `arthas`
- Common case, test with default config
```
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[0].shuffleBlockIdManager'
@DefaultShuffleBlockIdManager[
LOG=@Log4jLogger[org.apache.logging.slf4j.Log4jLogger@3f211bae],
partitionsToBlockIds=@ConcurrentHashMapForJDK8[isEmpty=false;size=1],
]
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[0].shuffleBlockIdManager.partitionsToBlockIds.get("application_1729845342052_431031_1730297736664") '
@ConcurrentHashMapForJDK8[
@integer[0]:@Roaring64NavigableMap[][isEmpty=false;size=10],
@integer[1]:@Roaring64NavigableMap[][isEmpty=false;size=10],
@integer[2]:@Roaring64NavigableMap[][isEmpty=false;size=10],
]
```
- Config to PartitionedShuffleBlockIdManager
```
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[0].shuffleBlockIdManager'
@PartitionedShuffleBlockIdManager[
LOG=@Log4jLogger[org.apache.logging.slf4j.Log4jLogger@6aa6fea0],
partitionsToBlockIds=@ConcurrentHashMap[isEmpty=false;size=1],
]
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[0].shuffleBlockIdManager.partitionsToBlockIds'
@ConcurrentHashMap[
@string[application_1729845342052_432324_1730299397916]:@ConcurrentHashMapForJDK8[isEmpty=false;size=2],
]
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[0].shuffleBlockIdManager.partitionsToBlockIds.get("application_1729845342052_432324_1730299397916")'
@ConcurrentHashMapForJDK8[
@integer[0]:@ConcurrentHashMap[isEmpty=false;size=2000],
@integer[1]:@ConcurrentHashMap[isEmpty=false;size=2000],
]
```
- Use client app level config
submit two app with `spark.rss.client.blockIdStrategyClass=org.apache.uniffle.server.block.DefaultShuffleBlockIdManager` and `spark.rss.client.blockIdStrategyClass=org.apache.uniffle.server.block.PartitionedShuffleBlockIdManager`
```
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[0].shuffleBlockIdManager'
@DefaultShuffleBlockIdManager[
LOG=@Log4jLogger[org.apache.logging.slf4j.Log4jLogger@ed3b52a],
partitionsToBlockIds=@ConcurrentHashMapForJDK8[isEmpty=false;size=1],
]
[arthas@264]$ vmtool --action getInstances --className org.apache.uniffle.server.ShuffleTaskInfo --express 'instances[1].shuffleBlockIdManager'
@PartitionedShuffleBlockIdManager[
LOG=@Log4jLogger[org.apache.logging.slf4j.Log4jLogger@5fc14628],
partitionsToBlockIds=@ConcurrentHashMap[isEmpty=false;size=1],
]
```
Log example
```
[2024-10-30 23:01:37.585] [Grpc-709] [INFO] ShuffleTaskInfo - application_1729845342052_432387_1730300440568 use app configured ShuffleBlockIdManager to org.apache.uniffle.server.block.DefaultShuffleBlockIdManager@3c6b75a8
```
1 parent 4eebbd4 commit 3cf82d7
File tree
13 files changed
+590
-142
lines changed- common/src/main/java/org/apache/uniffle/common/config
- docs
- client_guide
- integration-test/common/src/test/java/org/apache/uniffle/test
- server/src
- main/java/org/apache/uniffle/server
- block
- test/java/org/apache/uniffle/server
13 files changed
+590
-142
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
298 | 306 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
186 | 194 | | |
187 | 195 | | |
188 | 196 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
746 | 754 | | |
747 | 755 | | |
748 | 756 | | |
| |||
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
327 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
328 | 360 | | |
329 | 361 | | |
0 commit comments