Skip to content

[BUG]: increase max payload size of log service (Go) #4534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions go/cmd/logservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"context"
"net"

"github.com/chroma-core/chroma/go/pkg/grpcutils"
"github.com/chroma-core/chroma/go/pkg/log/configuration"
"github.com/chroma-core/chroma/go/pkg/log/leader"
"github.com/chroma-core/chroma/go/pkg/log/metrics"
Expand All @@ -15,7 +15,6 @@ import (
"github.com/chroma-core/chroma/go/pkg/utils"
libs "github.com/chroma-core/chroma/go/shared/libs"
"github.com/chroma-core/chroma/go/shared/otel"
sharedOtel "github.com/chroma-core/chroma/go/shared/otel"
"github.com/pingcap/log"
"github.com/rs/zerolog"
"go.uber.org/automaxprocs/maxprocs"
Expand Down Expand Up @@ -50,22 +49,21 @@ func main() {
sysDb := sysdb.NewSysDB(config.SYSDB_CONN)
lr := repository.NewLogRepository(conn, sysDb)
server := server.NewLogServer(lr)
var listener net.Listener
listener, err = net.Listen("tcp", ":"+config.PORT)

_, err = grpcutils.Default.StartGrpcServer("log-service", &grpcutils.GrpcConfig{
Copy link
Contributor

Choose a reason for hiding this comment

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

This line loses sharedOtel?

Copy link
Contributor

Choose a reason for hiding this comment

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

inside of the grpcutils package, it's using the shared otel package (, so I think this should be equivalent, but I might be missing something.

BindAddress: ":" + config.PORT,
}, func(registrar grpc.ServiceRegistrar) {
healthcheck := health.NewServer()
healthgrpc.RegisterHealthServer(registrar, healthcheck)
logservicepb.RegisterLogServiceServer(registrar, server)
})
if err != nil {
log.Fatal("failed to listen", zap.Error(err))
log.Fatal("failed to create grpc server", zap.Error(err))
}
s := grpc.NewServer(grpc.UnaryInterceptor(sharedOtel.ServerGrpcInterceptor))
healthcheck := health.NewServer()
healthgrpc.RegisterHealthServer(s, healthcheck)

logservicepb.RegisterLogServiceServer(s, server)
log.Info("log service started", zap.String("address", listener.Addr().String()))
log.Info("log service started")
go leader.AcquireLeaderLock(ctx, func(ctx context.Context) {
go purging.PerformPurgingLoop(ctx, lr)
go metrics.PerformMetricsLoop(ctx, lr)
})
if err := s.Serve(listener); err != nil {
log.Fatal("failed to serve", zap.Error(err))
}
}
5 changes: 3 additions & 2 deletions go/pkg/grpcutils/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"github.com/chroma-core/chroma/go/shared/otel"
"io"
"net"
"os"

"github.com/chroma-core/chroma/go/shared/otel"

"github.com/pingcap/log"
"go.uber.org/zap"
"google.golang.org/grpc"
Expand Down Expand Up @@ -82,7 +83,7 @@ func newDefaultGrpcProvider(name string, grpcConfig *GrpcConfig, registerFunc fu
OPTL_TRACING_ENDPOINT := os.Getenv("OPTL_TRACING_ENDPOINT")
if OPTL_TRACING_ENDPOINT != "" {
otel.InitTracing(context.Background(), &otel.TracingConfig{
Service: "sysdb-service",
Service: name,
Endpoint: OPTL_TRACING_ENDPOINT,
})
}
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/sysdb/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func NewWithGrpcProvider(config Config, provider grpcutils.GrpcProvider) (*Serve
s.softDeleteCleaner.Start()

log.Info("Starting GRPC server")
s.grpcServer, err = provider.StartGrpcServer("coordinator", config.GrpcConfig, func(registrar grpc.ServiceRegistrar) {
s.grpcServer, err = provider.StartGrpcServer("sysdb-service", config.GrpcConfig, func(registrar grpc.ServiceRegistrar) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this change? does anything downstream for telemetry use it are we sure nothing depends on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the coordinator value was not previously used because sysdb-service was hard coded in the common helper

coordinatorpb.RegisterSysDBServer(registrar, s)
healthgrpc.RegisterHealthServer(registrar, s.healthServer)
})
Expand Down
Loading