Add completion-driven direct dispatch behind spt.dispatch.direct - #186
Merged
Conversation
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
Completion-driven direct dispatch for the built-in Netty drivers, gated by the JVM property
spt.dispatch.direct(default off; behaviour with the property unset is unchanged).When a request completes successfully on an event-loop thread,
NettyStorageDriverBase.complete()keeps the concurrency permit and the channel, publishes the completed operation, and — under the existing admission lock — polls the next plain operation from the driver queue, marks it dispatched, and sends it on the same channel from the same thread. This removes the per-operation dispatcher hand-off and the second event-loop wake that the dispatcher's foreign-thread write used to cause. The dispatcher remains the path for composite/MPU work, child operations, NOOP, the batchsubmit(List)API, drivers that opt out, and any completion that refuses the direct path.CoopStorageDriverBase:pollForDirectDispatch(),dispatcherBacklog(),directDispatchEnabled(),supportsDirectDispatch()capability (default false),handleCompleted(op, wakeDispatcher). No existing signature changed.OperationDispatchTask: with direct dispatch on, drains only what it can submit now, publishes its backlog before parking so completions yield to buffered work, and parks instead of spinning when queued work has no capacity.NettyStorageDriverBase: direct path incomplete(), capabilitytrue.S3RdmaStorageDriverandS3TablesStorageDriveropt out: theirsubmit()does per-op preparation (RDMA buffer/context; control-plane modes) thatsendRequestalone does not perform. NIO/fs and third-party cooperative extensions are unaffected by the property.The default stays off. Flipping it is tracked separately: capability audit done; integrated canaries (TLS, streamed payloads, cancellation, failure injection, soak, distributed real-target run) and READ-at-concurrency screens still to run.