Skip to content

s3: add blob offload rollout scaffolding - #1057

Merged
bootjp merged 4 commits into
mainfrom
design/s3-blob-offload-scaffold
Jul 19, 2026
Merged

s3: add blob offload rollout scaffolding#1057
bootjp merged 4 commits into
mainfrom
design/s3-blob-offload-scaffold

Conversation

@bootjp

Copy link
Copy Markdown
Owner

Summary

  • add chunkref/chunkblob key builders, parsers, and chunk reference value codec for the S3 blob-offload keyspace
  • add ELASTICKV_S3_BLOB_OFFLOAD admission scaffolding that fails closed to legacy blob writes until cluster capability and the data path are ready
  • add S3 blob-offload decision and chunkblob durability metrics
  • add Admin GetClusterOverview capabilities and advertise feature_s3_blob_offload=false until the offload data path is implemented
  • include chunkref cleanup in AdminDeleteBucket per-bucket prefix sweeps

Validation

  • make -C proto gen
  • go test ./internal/s3keys ./monitoring . -count=1 -timeout=180s
  • go test ./adapter -run 'Test(S3BlobOffload|S3Server_PutObjectBlobOffload|S3Server_AdminDeleteBucket_SweepsOrphansAcrossAllPerBucketPrefixes|GetClusterOverviewReturnsCapabilities)' -count=1 -timeout=240s
  • go test ./... -run TestNonexistent -count=0 -timeout=300s
  • golangci-lint run ./internal/s3keys ./monitoring ./adapter . --timeout=5m
  • git diff --check

Note: go test ./adapter -count=1 -timeout=300s was also attempted and timed out in existing Raft/SQS integration tests after the targeted adapter tests had passed.

@coderabbitai

coderabbitaiBot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bootjp, you've reached your PR review limit, so we couldn't start this review.

Next review available in:15 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c63f956d-bea4-4817-bea5-e9d6e89e0524

📥 Commits

Reviewing files that changed from the base of the PR and between 5d81bfa and 1632247.

⛔ Files ignored due to path filters (1)
  • proto/admin.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (18)
  • Makefile
  • adapter/admin_grpc.go
  • adapter/admin_grpc_test.go
  • adapter/s3.go
  • adapter/s3_admin.go
  • adapter/s3_admin_test.go
  • adapter/s3_blob_offload.go
  • adapter/s3_blob_offload_test.go
  • internal/s3keys/chunkref.go
  • internal/s3keys/keys.go
  • internal/s3keys/keys_test.go
  • main.go
  • main_s3.go
  • main_s3_test.go
  • monitoring/registry.go
  • monitoring/s3.go
  • monitoring/s3_test.go
  • proto/admin.proto

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bootjp

Copy link
Copy Markdown
OwnerAuthor

@codex review

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces scaffolding for S3 blob offloading, including capabilities tracking in the admin server, S3 blob offload configuration, and key/value encoding/decoding for chunk references and chunk blobs. The review feedback highlights two valuable performance optimizations: avoiding a heap allocation when encoding chunk reference values by appending the string directly, and reducing redundant string allocations when parsing the blob offload environment variable by trimming it only once.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment threadinternal/s3keys/chunkref.go Outdated
Comment on lines +70 to +83
sourcePeer := []byte(ref.SourcePeer)
sourcePeerLen, err := chunkRefSourcePeerLen(len(sourcePeer))
if err != nil {
return nil, err
}
out := make([]byte, 0, chunkRefValueFixedBytes+len(sourcePeer))
out = append(out, chunkRefValueVersionV1)
out = append(out, ref.ContentSHA256[:]...)
out = appendU64(out, ref.Size)
var sourceLen [chunkRefSourcePeerLenSize]byte
binary.BigEndian.PutUint16(sourceLen[:], sourcePeerLen)
out = append(out, sourceLen[:]...)
out = append(out, sourcePeer...)
return out, nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Converting ref.SourcePeer to a []byte slice allocates a new byte slice on the heap. We can avoid this allocation entirely by using len(ref.SourcePeer) directly and appending the string ref.SourcePeer to the []byte slice using the built-in append(dst, string...) syntax, which is optimized by the Go compiler to avoid allocations.

Suggested change
sourcePeer:= []byte(ref.SourcePeer)
sourcePeerLen, err:=chunkRefSourcePeerLen(len(sourcePeer))
iferr!=nil {
returnnil, err
}
out:=make([]byte, 0, chunkRefValueFixedBytes+len(sourcePeer))
out=append(out, chunkRefValueVersionV1)
out=append(out, ref.ContentSHA256[:]...)
out=appendU64(out, ref.Size)
varsourceLen [chunkRefSourcePeerLenSize]byte
binary.BigEndian.PutUint16(sourceLen[:], sourcePeerLen)
out=append(out, sourceLen[:]...)
out=append(out, sourcePeer...)
returnout, nil
sourcePeerLen, err:=chunkRefSourcePeerLen(len(ref.SourcePeer))
iferr!=nil {
returnnil, err
}
out:=make([]byte, 0, chunkRefValueFixedBytes+len(ref.SourcePeer))
out=append(out, chunkRefValueVersionV1)
out=append(out, ref.ContentSHA256[:]...)
out=appendU64(out, ref.Size)
varsourceLen [chunkRefSourcePeerLenSize]byte
binary.BigEndian.PutUint16(sourceLen[:], sourcePeerLen)
out=append(out, sourceLen[:]...)
out=append(out, ref.SourcePeer...)
returnout, nil

Comment threadadapter/s3_blob_offload.go Outdated
Comment on lines +84 to +88
raw, ok := os.LookupEnv(s3BlobOffloadEnvVar)
if !ok || strings.TrimSpace(raw) == "" {
return false
}
enabled, err := strconv.ParseBool(strings.TrimSpace(raw))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The strings.TrimSpace(raw) function is called twice on the same string. We can optimize this by trimming the string once and reusing the result, which avoids redundant string allocations and operations.

Suggested change
raw, ok:=os.LookupEnv(s3BlobOffloadEnvVar)
if!ok||strings.TrimSpace(raw) =="" {
returnfalse
}
enabled, err:=strconv.ParseBool(strings.TrimSpace(raw))
raw, ok:=os.LookupEnv(s3BlobOffloadEnvVar)
if!ok {
returnfalse
}
raw=strings.TrimSpace(raw)
ifraw=="" {
returnfalse
}
enabled, err:=strconv.ParseBool(raw)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit:c0e31fa34d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjp
bootjpforce-pushed the design/s3-blob-offload-scaffold branch from c0e31fa to f8efc93CompareJuly 10, 2026 20:21
@bootjp

Copy link
Copy Markdown
OwnerAuthor

Addressed latest-head review findings:

  • EncodeChunkRefValue now avoids the temporary []byte allocation for SourcePeer
  • S3 blob offload env parsing now trims the raw value once and reuses it

Validation:

  • go test ./internal/s3keys -run 'TestChunkRef' -count=1 -timeout=120s
  • go test ./adapter -run 'TestS3BlobOffload' -count=1 -timeout=180s
  • golangci-lint run ./internal/s3keys ./adapter --timeout=5m
  • git diff --check
  • git verify-commit HEAD

@codex review

@bootjp

Copy link
Copy Markdown
OwnerAuthor

Addressed latest-head review findings and re-ran focused validation.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit:f8efc9326a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjpbootjp mentioned this pull request Jul 10, 2026
@bootjp

Copy link
Copy Markdown
OwnerAuthor

Merged current main and resolved the S3 write-path conflict. The resolved path keeps the main-branch helper split for PutObject/UploadPart and preserves the S3 blob-offload decision observation before chunk upload.

Validation:

  • go test ./adapter -run 'TestS3.*(BlobOffload|PutObject|UploadPart|Multipart|Chunk)' -count=1 -timeout=240s\n- go test ./internal/s3keys -count=1 -timeout=120s\n- go test ./adapter -run 'TestS3' -count=1 -timeout=300s\n- go test ./... -run '^$' -count=1 -timeout=300s\n- git diff --check\n- git diff --cached --check\n- git verify-commit HEAD\n\n@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit:d516f9f5e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjp

Copy link
Copy Markdown
OwnerAuthor

Rerunning the failed test (ubuntu-latest) job. The failure was isolated to TestRedis_LuaRPopLPushPreservesTTL returning transient NOTLEADER; focused local validation passed:

  • GOCACHE=$(pwd)/.cache GOTMPDIR=$(pwd)/.cache/tmp go test -race ./adapter -run ^TestRedis_LuaRPopLPushPreservesTTL$ -count=10 -timeout=180s

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit:d516f9f5e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjp

Copy link
Copy Markdown
OwnerAuthor

Updated the stacked base to current main with signed merge commit d5c9df8df47e.

Verification:

  • go test ./adapter . -run 'TestS3BlobOffload|TestConfigureAdminService' -count=1 -timeout=240s\n- git diff --check HEAD^1..HEAD\n- git log -1 --show-signature\n\n@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit:d5c9df8df4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjp

Copy link
Copy Markdown
OwnerAuthor

TLA CI reproducibility fix pushed at 1632247.

Evidence:

  • Upstream v1.8.0 is a rolling pre-release and its release asset was replaced; the current GitHub asset digest no longer matches the repository pin.
  • Pinned the latest stable v1.7.4 asset at SHA-256 936a262061c914694dfd669a543be24573c45d5aa0ff20a8b96b23d01e050e88.
  • make tla-tools: PASS, downloaded TLC 2.19 rev 5a47802.
  • make tla-check: PASS; all safe models and liveness models passed, and every gap model failed on its expected invariant.
  • commit signature: verified bootjp contact@bootjp.me.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit:163224793e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjp
bootjp merged commit 71730d8 into mainJul 19, 2026
11 checks passed
@bootjp
bootjp deleted the design/s3-blob-offload-scaffold branch July 19, 2026 06:03
bootjp added a commit that referenced this pull request Aug 21, 2026
Review findings on the current HEAD:
- The hotspot split M2 and S3 blob offload rows cited the pre-rename
*_proposed_* filenames. Both docs were promoted to *_partial_* and the
pointers were left behind.
- The streaming transport row and the §5 gap table still called the
multi-group soak evidence outstanding. It landed with the design's §8:
cmd/elastickv-raft-stream-soak, the Jepsen soak script, and a
fail-closed verifier over docs/evidence/raft_streaming_multigroup_soak.json.
The reviewer also flagged that the cited PR states were a 2026-07-19
snapshot and needed a spot-check. Re-audited every cited PR against
GitHub: #1096, #1097, #1108, #1082, #1057, #1063, and #1059 have merged
since. Rows updated and the audit date moved to 2026-08-22.
Claude-Session: https://claude.ai/code/session_013rNHooj7NF3giihWVba8QE
Sign up for freeto 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.

1 participant

@bootjp