Skip to content

Commit

Permalink
Rename new shardmanager service to shard-distributor (#6496)
Browse files Browse the repository at this point in the history
What changed?
Renamed the new shard-manager service to shard-distributor

Why?
We want to split the shard management system in two service, shard-distributor and a load-balancer. Also there is already a shard manager struct in the code, which would be quite confusing

How did you test it?
Unit tests

Potential risks
The change is NOT backwards compatible, the service is still prototyping so noone show rely on it. We need to change the names internally when we pull in this change.

Release notes

Documentation Changes
  • Loading branch information
jakobht authored Nov 15, 2024
1 parent 4976e3f commit b97e553
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions cmd/server/cadence/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import (
"github.com/uber/cadence/service/frontend"
"github.com/uber/cadence/service/history"
"github.com/uber/cadence/service/matching"
"github.com/uber/cadence/service/shardmanager"
"github.com/uber/cadence/service/sharddistributor"
"github.com/uber/cadence/service/worker"
)

Expand Down Expand Up @@ -272,8 +272,8 @@ func (s *server) startService() common.Daemon {
daemon, err = matching.NewService(&params)
case service.Worker:
daemon, err = worker.NewService(&params)
case service.ShardManager:
daemon, err = shardmanager.NewService(&params, resource.NewResourceFactory())
case service.ShardDistributor:
daemon, err = sharddistributor.NewService(&params, resource.NewResourceFactory())
}
if err != nil {
params.Logger.Fatal("Fail to start "+s.name+" service ", tag.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const (
History
Matching
Worker
ShardManager
ShardDistributor
NumServices
)

Expand Down
4 changes: 2 additions & 2 deletions common/service/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func GetMetricsServiceIdx(serviceName string, logger log.Logger) metrics.Service
return metrics.Matching
case Worker:
return metrics.Worker
case ShardManager:
return metrics.ShardManager
case ShardDistributor:
return metrics.ShardDistributor
default:
logger.Fatal("Unknown service name for metrics!")
}
Expand Down
6 changes: 3 additions & 3 deletions common/service/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ const (
Matching = "cadence-matching"
// Worker is the name of the worker service
Worker = "cadence-worker"
// ShardManager is the name of the shard manager service
ShardManager = "cadence-shard-manager"
// ShardDistributor is the name of the shard distributor service
ShardDistributor = "cadence-shard-distributor"
)

// ListWithRing contains the list of all cadence services that has a hash ring
var ListWithRing = []string{Frontend, History, Matching, Worker}

// List contains the list of all cadence services
var List = []string{Frontend, History, Matching, Worker, ShardManager}
var List = []string{Frontend, History, Matching, Worker, ShardDistributor}

// ShortName returns cadence service name without "cadence-" prefix
func ShortName(name string) string {
Expand Down
4 changes: 2 additions & 2 deletions common/service/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ func TestServiceNames(t *testing.T) {
assert.Equal(t, fullName, FullName(shortName))
assert.Equal(t, fullName, FullName(fullName))

assert.Equal(t, []string{"cadence-frontend", "cadence-history", "cadence-matching", "cadence-worker", "cadence-shard-manager"}, List)
assert.Equal(t, []string{"frontend", "history", "matching", "worker", "shard-manager"}, ShortNames(List))
assert.Equal(t, []string{"cadence-frontend", "cadence-history", "cadence-matching", "cadence-worker", "cadence-shard-distributor"}, List)
assert.Equal(t, []string{"frontend", "history", "matching", "worker", "shard-distributor"}, ShortNames(List))
}
2 changes: 1 addition & 1 deletion config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ services:
pprof:
port: ${WORKER_PORT_PPROF:7940}

shard-manager:
shard-distributor:
rpc:
port: 7941
bindOnLocalHost: true
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package shardmanager
package sharddistributor

import (
"sync/atomic"
Expand All @@ -27,10 +27,10 @@ import (
"github.com/uber/cadence/common/dynamicconfig"
"github.com/uber/cadence/common/resource"
"github.com/uber/cadence/common/service"
"github.com/uber/cadence/service/shardmanager/config"
"github.com/uber/cadence/service/sharddistributor/config"
)

// Service represents the shard manager service
// Service represents the shard distributor service
type Service struct {
resource.Resource

Expand All @@ -57,13 +57,13 @@ func NewService(

serviceResource, err := factory.NewResource(
params,
service.ShardManager,
service.ShardDistributor,
&service.Config{
PersistenceMaxQPS: serviceConfig.PersistenceMaxQPS,
PersistenceGlobalMaxQPS: serviceConfig.PersistenceGlobalMaxQPS,
ThrottledLoggerMaxRPS: serviceConfig.ThrottledLogRPS,
IsErrorRetryableFunction: common.IsServiceTransientError,
// shard manager doesn't need visibility config as it never read or write visibility
// shard distributor doesn't need visibility config as it never read or write visibility
},
)
if err != nil {
Expand All @@ -85,7 +85,7 @@ func (s *Service) Start() {
}

logger := s.GetLogger()
logger.Info("shard manager starting")
logger.Info("shard distributor starting")

// setup the handler

Expand All @@ -103,5 +103,5 @@ func (s *Service) Stop() {

s.Resource.Stop()

s.GetLogger().Info("shard manager stopped")
s.GetLogger().Info("shard distributor stopped")
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

package shardmanager
package sharddistributor

import (
"sync/atomic"
Expand Down

0 comments on commit b97e553

Please sign in to comment.