The chunk splitter is currently relying on the splitVector function that can easily suggest to always split at a chunk at (maxChunkSize / 2).
While the documentation states that a chunk gets partitioned when it reaches the maximum chunk size, the current implementation can force a split simply if the current size is (maxChunkSize / 2 + ε). This results in the max chunk size being actually (maxChunkSize / 2).
Not only that, some corner cases can produce very large chunk counts relative to document count.
This ticket has two objectives to make the auto-splitter less aggressive:
- As a precondition for splitting, wait for a chunk size to get closer to the maximum
- Consider making bigger chunks, with a size closer to the maxChunkSize set by the user rather than half of it