Xuanwo opened a new pull request, #8648: URL: https://github.com/apache/opendal/pull/8648
# Which issue does this PR close? Refs #8266. #8300 implemented owner-preserving synchronous writes. The matched comparison on AWS S3 remains open. # Rationale for this change Since #8645, core treats `chunk=0` as unset. The synchronous Python `Operator.open` only applied the 256 KiB coalescing default when `chunk` was omitted. With explicit zero, two one-byte writes to the nginx WebDAV service used by CI failed on the second write with `OneShotWriter doesn't support multiple write`. # What changes are included in this PR? Apply the existing coalescing default when `chunk` is omitted or zero and the service has no minimum write size. The regression test exercises both forms through `File.write`, repeated `flush()`, and context-manager completion. Against nginx WebDAV, the two-write reproduction now sends one PUT on close and reads back both bytes. ## Local MinIO verification Compared CPython 3.12 release builds on base `fe63a79b27083d3d010227c9c21ba5c0d16d0fed` with the same Cargo lockfile and default features. The baseline restores the synchronous `StdWriter` and `FuturesAsyncWriter` path from before #8300. The candidate uses this PR's synchronous implementation. The branch also incorporates the upstream async-only #8647, which does not enter the measured path. Each upload read the same 59,158,238-byte file in 8 MiB blocks and used 8 MiB multipart parts with CRC32C on loopback MinIO (`RELEASE.2025-01-20T14-49-07Z`). Timing includes opening, file reads, writes, and close. All runs wrote eight parts and passed an independent full SHA-256 readback with boto3. Timing figures are medians of eight alternating before/after pairs per concurrency. Allocation figures are medians of three separate Memray runs per case and include the client process's tracked allocations during the upload. | Metric | Concurrency 1, before → after | Concurrency 4, before → after | | --- | ---: | ---: | | Throughput | 363 → 387 MiB/s | 782 → 799 MiB/s | | Process CPU per upload | 38.73 → 29.58 ms | 56.66 → 46.72 ms | | Native allocation requests of exactly 256 KiB | 227 → 0 | 227 → 0 | | Total tracked allocation requests, bytes | 135,999,424 → 76,335,165 | 136,066,994 → 76,402,639 | | Peak live tracked bytes | 33,573,899 → 25,206,345 | 67,249,903 → 58,860,590 | | Write-path Tokio `block_on` calls per upload | 226 → 8 | 226 → 8 | Separate instrumented builds counted `block_on` at the write boundary. MinIO request traces confirmed CRC32C on all eight parts, a single multipart completion, and peak part overlap of one and four respectively in both builds. AWS S3 timing for synchronous owned-buffer writes remains unmeasured. #8266 records the pre-refactor AWS S3 workload, and #8300 records the remaining live measurement gap. Reference-count checks confirmed that the writer holds immutable input during buffering, an in-flight PUT, and a retry after a failed close. It releases the owner after successful close. Synchronous `File.write` continues to accept Python `bytes` and reject `bytearray` and `memoryview`. Explicitly converting a mutable view to `bytes` preserves the snapshot through close. # Are there any user-facing changes? `Operator.open(..., "wb", chunk=0)` now coalesces small writes like omitting `chunk` on services without a minimum write size. # Breaking changes # AI Usage Statement - **Harness:** Pi - **Model:** `codex/gpt-6.2-sol` - **Effort:** `xhigh` - **Role:** Reproduced the WebDAV regression, implemented and tested the synchronous fix, and ran the local behavior and MinIO comparisons. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
