fix: revert broad metadata batching#2
Open
ctxswitch wants to merge 2 commits into
Open
Conversation
Restore the pre-8d2998b transaction model: keep batching on concurrent request paths, use immediate transactions for serialized S3FIFO maintenance, and delete each expiry batch in one transaction. This prevents the bbolt batch window from extending the global eviction lock across a full pinned scan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Narrow the bbolt batching rollback to the operations that caused the production lock contention, while retaining request-path batching controls and telemetry.
The failing production image changed serialized S3FIFO maintenance from immediate transactions to delayed
bbolt.Batchcalls. Eviction holdsqueueMuwhile scanning pinned entries, so every candidate paid the batch delay twice while the global admission lock remained held. Expiry was also changed from one write transaction per reaper batch to one delayed batch call per expired entry.What changed
bbolt.Updatetransactions for serialized S3FIFO eviction and ghost maintenance.METADATA_BATCH_SIZEandMETADATA_BATCH_DELAYconfiguration.1000and delay1ms.Compatibility
No data-format or migration impact. The configuration knobs remain available. Their defaults preserve the effective behavior of the previous production image: the service explicitly used a 1 ms delay and inherited bbolt v1.5.0 batch size 1000.
Configuration
METADATA_BATCH_SIZE1000METADATA_BATCH_DELAY1msThese settings affect only operations that use request-path batching. Serialized eviction maintenance and bulk expiry cleanup do not wait on this batch window.
Validation
TestPopTailDoesNotWaitForRequestBatchWindowandTestEnvelopeReaperDeletesEachBatchInSingleWriteTransactionGOCACHE=/tmp/codex-go-build go test ./...gofmtandgit diff --check