Commit 3676846
authored
[CHORE]: Create per-tenant config in the compactor for shard sizes (#6847)
## Description of changes
This change creates a hashmap config in the compactor called `tenant_shard_sizes` from where one can specify a per-tenant limit on shard size. If a tenant is not specified in this config then it is considered to not have sharding enabled. Sample config:
```
compactor:
shard_size: 1000000 # 1MB shard size limit
sharding_enabled_tenant_patterns:
- "*" # Enable for all tenants
- "test-tenant-1" # Enable for specific test tenant
```
tenant_id had to be plumbed into the `CompactionJob` structure for this to work out. Due to this, the `rebuild_batch` endpoint was changed to retrieve tenant information from the sysdb before proceeding with a rebuild.
- Improvements & Bug fixes
- ^
- New functionality
- ...
## Test plan
Manual testing. Created a collection and specified a low shard size limit for the default tenant. Observed sharding working on this collection as expected.
- [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust
## Migration plan
_Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?_
## Observability plan
_What is the plan to instrument and monitor this change?_
## Documentation Changes
_Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the_ [_docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_1 parent 6ee8c75 commit 3676846
File tree
5 files changed
+73
-12
lines changed- rust/worker/src/compactor
5 files changed
+73
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| 206 | + | |
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
| |||
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
260 | | - | |
261 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
262 | 277 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
269 | 298 | | |
270 | 299 | | |
271 | 300 | | |
| |||
435 | 464 | | |
436 | 465 | | |
437 | 466 | | |
| 467 | + | |
438 | 468 | | |
439 | 469 | | |
440 | 470 | | |
| |||
452 | 482 | | |
453 | 483 | | |
454 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
455 | 491 | | |
456 | 492 | | |
457 | 493 | | |
| |||
472 | 508 | | |
473 | 509 | | |
474 | 510 | | |
475 | | - | |
| 511 | + | |
476 | 512 | | |
477 | 513 | | |
478 | 514 | | |
| |||
686 | 722 | | |
687 | 723 | | |
688 | 724 | | |
| 725 | + | |
689 | 726 | | |
690 | 727 | | |
691 | 728 | | |
692 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
693 | 742 | | |
694 | 743 | | |
695 | 744 | | |
| |||
1245 | 1294 | | |
1246 | 1295 | | |
1247 | 1296 | | |
| 1297 | + | |
1248 | 1298 | | |
1249 | 1299 | | |
1250 | 1300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
| |||
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
198 | | - | |
| 205 | + | |
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
| |||
222 | 229 | | |
223 | 230 | | |
224 | 231 | | |
| 232 | + | |
225 | 233 | | |
226 | 234 | | |
227 | 235 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments