Skip to content
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

feat(coordinator): support update service info when new term #558

Closed
wants to merge 9 commits into from

Conversation

mattisonchao
Copy link
Member

@mattisonchao mattisonchao commented Nov 4, 2024

Motivation

In practice, we might want to update the service public address for the existing cluster for some reason. This PR supports the functionalities by identifying the internal address as a logical node ID and updating the public address when the new term is used.

also, we can introduce a node Id that can help us update the internal address or other information introduced in the future.

Modification

  • Refresh service ensemble information at the newTerm safe point.
  • Introduce ConcurrentShardMetadata to avoid data racing

@mattisonchao
Copy link
Member Author

Write at 0x00c00068a5b0 by goroutine 3033:
  github.com/streamnative/oxia/server.(*followerController).setLogger()
      /home/runner/work/oxia/oxia/server/follower_controller.go:179 +0x32d
  github.com/streamnative/oxia/server.(*followerController).NewTerm()
      /home/runner/work/oxia/oxia/server/follower_controller.go:296 +0x4c4
  github.com/streamnative/oxia/server.(*internalRpcServer).NewTerm()
      /home/runner/work/oxia/oxia/server/internal_rpc_server.go:125 +0xa21
  github.com/streamnative/oxia/proto._OxiaCoordination_NewTerm_Handler.func1()
      /home/runner/work/oxia/oxia/proto/replication_grpc.pb.go:207 +0xbe
  github.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).UnaryServerInterceptor.func3()
      /home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:107 +0xbb
  github.com/streamnative/oxia/proto._OxiaCoordination_NewTerm_Handler()
      /home/runner/work/oxia/oxia/proto/replication_grpc.pb.go:209 +0x1f3
  google.golang.org/grpc.(*Server).processUnaryRPC()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1379 +0x1a2c
  google.golang.org/grpc.(*Server).handleStream()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1790 +0x1824
  google.golang.org/grpc.(*Server).serveStreams.func2.1()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1029 +0x158
Previous read at 0x00c00068a5b0 by goroutine 3058:
  github.com/streamnative/oxia/server.(*followerController).Close()
      /home/runner/work/oxia/oxia/server/follower_controller.go:192 +0x50
  github.com/streamnative/oxia/server.(*shardsDirector).GetOrCreateLeader()
      /home/runner/work/oxia/oxia/server/shards_director.go:137 +0x1e3
  github.com/streamnative/oxia/server.(*internalRpcServer).BecomeLeader()
      /home/runner/work/oxia/oxia/server/internal_rpc_server.go:166 +0x2ae
  github.com/streamnative/oxia/proto._OxiaCoordination_BecomeLeader_Handler.func1()
      /home/runner/work/oxia/oxia/proto/replication_grpc.pb.go:225 +0xbe
  github.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).UnaryServerInterceptor.func3()
      /home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:107 +0xbb
  github.com/streamnative/oxia/proto._OxiaCoordination_BecomeLeader_Handler()
      /home/runner/work/oxia/oxia/proto/replication_grpc.pb.go:227 +0x1f3
  google.golang.org/grpc.(*Server).processUnaryRPC()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1379 +0x1a2c
  google.golang.org/grpc.(*Server).handleStream()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1790 +0x1824
  google.golang.org/grpc.(*Server).serveStreams.func2.1()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1029 +0x158

Sign up for free to 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