8000 drpc: request compression support · Issue #148490 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
drpc: request compression support #148490
Open
@cthumuluru-crdb

Description

@cthumuluru-crdb

gRPC support request/response compression and we use snappy compressor. Evaluate the need for the compression in DRPC and add it if needed.

cockroach/pkg/rpc/context.go

Lines 1551 to 1565 in 4c2a546

// Request request compression. Note that it's the client that
// decides to opt into compressions; the server accepts either
// compressed or decompressed payloads, and the specific codec used
// is named in the request (so different clients can use different
// compression algorithms.)
//
// On a related note, this configuration uses our own snappy codec.
// We believe it works better than the gzip codec provided natively
// by grpc, although the specific reason is now lost to history. It
// would be possible to change/simplify this, and since it's for
// each client to decide changing this will not require much
// cross-version compatibility dance.
if rpcCtx.rpcCompression {
dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.UseCompressor((snappyCompressor{}).Name())))
}

Jira issue: CRDB-51641

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-server-networkingPertains to network addressing,routing,initializationC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-db-server

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0