Skip to content

Bump opendal to 0.58.1 and fix fallout (fixes local GCS cache usage) - #2797

Closed
codspeed-hq[bot] wants to merge 6 commits into
mainfrom
gcs-reqsign-fix
Closed

Bump opendal to 0.58.1 and fix fallout (fixes local GCS cache usage)#2797
codspeed-hq[bot] wants to merge 6 commits into
mainfrom
gcs-reqsign-fix

Conversation

@codspeed-hq

@codspeed-hq codspeed-hq Bot commented Aug 6, 2026

Copy link
Copy Markdown

Motivation

The gcs cache can currently not be used with authorized_user application-default credentials, as this was not supported in reqsign version 0.16.5, which opendal version 0.55.0 depended on. This was fixed in a later version of reqsign and since has been updated in opendal

With this, the gcs cache should Just Work ™️ after a gcloud auth application-default login.

Changes

I split this PR into the following commits for easier commit-by-commit review:

Bump opendal to 0.58.1

Run cargo update

I first did just a partial Cargo.lock update for only the dependencies that were bumped in this PR. But the churn was quite big when just doing that. So I figured why not do a full, clean cargo update of the Cargo.lock file.

Fix fallout in code

  • HttpClientLayer was removed and now has to be built from the OperationContext
  • LoggingLayer was moved to its own crate
  • allow_anonymous was deprecated in favor of skip_signature
  • Use sha256 instead of sha1, as that is quasi-deprecated. I'm not sure if this is actually necessary. I think it fixed some issue in the tests? In any case, I think this is a good change
  • Check if native_certs are available when building a reqwest client, and if not set the TLS certs to an empty vector. With reqwest 0.13, the client would fail otherwise.

Size the zstd compression context to the stdout/stderr length

Addresses the benchmark regressions reported by CodSpeed on this PR. The cargo update above upgraded the bundled zstd C library from 1.5.6 to 1.5.7, which is ~7% more expensive per byte compressed and added a new block splitter, and that showed up in the cache-entry benchmarks.

Rather than pinning zstd back, this removes a much larger inefficiency that the profiles exposed: CacheWrite::put_bytes used zstd::stream::copy_encode, which cannot know the input size, so zstd allocated and zeroed a compression context sized for the default 2 MiB window for every stdout/stderr blob — typically a handful of bytes. That single memset accounted for up to a third of the cost of writing a cache entry. Pledging the (known) source size lets zstd size its workspace for the actual input. Compression ratio is unchanged.

flip1995 and others added 6 commits August 6, 2026 11:37
- Required bump of reqwest to 0.13.0
    - Rename and remove features deprecated in that release
- Remove direct `reqsign` dependency that was not used in the code
- Add new (optional) opendal-* dependencies that were split out of opendal
I first did just a partial Cargo.lock update for only the dependencies
that were bumped in this PR. But the churn was quite big when just doing
that. So I figured why not do a full, clean `cargo update` of the
`Cargo.lock` file.
- `HttpClientLayer` was removed and now has to be built from the
  `OperationContext`
- `LoggingLayer` was moved to its own crate
- `allow_anonymous` was deprecated in favor of `skip_signature`
- Use `sha256` instead of `sha1`, as that is quasi-deprecated. I'm not
  sure if this is actually necessary. I think it fixed some issue in the
  tests? In any case, I think this is a good change
- Check if `native_certs` are available when building a reqwest client,
  and if not set the TLS certs to an empty vector. With reqwest 0.13,
  the client would fail otherwise.
This fixes the Clippy findings after the dep bump and `cargo update`.
`CacheWrite::put_bytes` compresses stdout and stderr, which are usually a
handful of bytes, but it went through `zstd::stream::copy_encode`, which
cannot know the input size up front. zstd therefore allocated and zeroed a
compression context sized for the default 2 MiB window on every call, and
profiles showed that single memset accounting for up to a third of the cost of
writing a cache entry.

Compress those blobs with an explicit encoder and pledge the source size, so
zstd sizes its workspace for the actual input. Compression ratio is unchanged;
writing cache entries gets 16-47% cheaper depending on the benchmark.
@sylvestre sylvestre closed this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants