Skip to content

Navigation Menu

Sign in
Sign up

perf(vindex): enable 8-way multipart uploads for index files - #798

Draft
jerry-024 wants to merge 2 commits into
apache:main from
jerry-024:perf/vindex-upload-concurrency
Draft

perf(vindex): enable 8-way multipart uploads for index files #798
jerry-024 wants to merge 2 commits into
apache:main from
jerry-024:perf/vindex-upload-concurrency

Conversation

@jerry-024

@jerry-024 jerry-024 commented Sep 9, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Purpose

Reduce the vector-index serialization/upload bottleneck by allowing up to eight concurrent multipart uploads, while keeping each chunk at 8 MiB.

This is a standalone upload-only change. The existing single remote scan, training, and add flow remain unchanged.

Brief change log

  • Extract an internal async_writer_with_concurrency() helper. Existing async_writer() callers retain concurrency 1 and 8 MiB chunks.
  • Use concurrency 8 for vector-index output directly, without an MVP environment switch.
  • Add round-trip, out-of-order multipart completion, and index-build failure tests through the existing FileIOProvider test entry point. Reuse the existing build failure handling.

Tests

Coverage added or updated; runtime acceptance is still pending:

  • cargo fmt --all -- --check.
  • git diff --no-ext-diff --check.
  • Memory/fs round trips at concurrency 1 and 8: write nine full 8 MiB chunks plus a 12,345-byte tail, then verify length and every byte after shutdown.
  • Exercise OpenDAL's multipart scheduler with deterministic out-of-order part completion and verify the final content.
  • Run existing FileIO, cache-invalidation, and vector-index build tests. The cache-invalidation test now exercises concurrency 8.
  • Inject both a part-write failure and a final close failure: require a build error, unchanged committed index metadata, unchanged existing index bytes and query results, and cleanup of newly completed shard files.
  • Run the ignored streaming_upload_oss test against real OSS multipart storage and verify scratch-object cleanup. It requires PAIMON_CATALOG_OPTIONS, PAIMON_UPLOAD_TEST_DATABASE, and PAIMON_UPLOAD_TEST_TABLE.
  • Complete three interleaved runs per variant on vdb2: default upload versus 8-way upload, with the same source baseline, PR90 core, 10M data, index parameters, and queries. Record source/binary checksums, total build and serialization/upload time, peak memory, index size, and Recall; retain all runs and check an absolute Recall difference of at most 0.005.

The vdb2 verification attempt stopped during dependency download, before compilation, because the Cargo registry connection timed out. Runtime correctness and performance acceptance have not been established; no measured speedup is claimed here.

API and Format

No public API or storage-format changes. Upload concurrency changes only for vector-index output.

Known existing limitation: the AsyncWrite adapter does not expose multipart abort. The failure test explicitly records one unfinished upload and zero abort calls, separately from completed-object cleanup. This patch does not add multipart-abort support; real OSS failure cleanup still needs verification.

Documentation

No new user-facing configuration. No documentation changes are included.

Keep 8 MiB chunks and default FileIO upload concurrency at 1. Add multipart ordering, round-trip, and index build failure coverage.
Validation: formatting and diff checks passed. Runtime tests and benchmarks remain blocked by a Cargo registry connection timeout.
jerry-024 marked this pull request as draft September 9, 2026 02:40
@jerry-024 jerry-024 changed the title (削除) perf(vindex): upload index files with concurrency of 8 (削除ここまで) (追記) perf(vindex): enable 8-way multipart uploads for index files (追記ここまで) Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

This PR should remain on hold until paimon-rust can use an official OpenDAL release containing apache/opendal#8224 (or an equivalent backport).

The change from concurrency 1 to 8 exposes a memory regression in the currently used OpenDAL implementation. Concurrent task results retain their original retry input, including the upload payload, even after a part succeeds. The multipart writer uses a hard-coded prefetch of 8192, so completed payloads can accumulate while more parts are submitted. Eight concurrent network uploads therefore do not bound retained payloads to eight 8 MiB parts, and large index builds can run out of memory. The previous concurrency-1 path does not accumulate completed inputs this way.

The upstream fix releases successful task inputs before result collection while retaining failed inputs for retry, preserving concurrent uploads. The upstream PR is merged, but merging upstream is not sufficient for this PR: the selected published dependency must actually contain the fix. Once that release is available, update the dependency and verify buffer release, retry correctness, and peak memory during a large 8-way upload before merging.

Use the native temporary file path so FileIO preserves the Windows drive prefix. Simplify redundant multipart and index upload failure assertions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /